From 49a579d7c55fde701845794077d03bcfe3418b8e Mon Sep 17 00:00:00 2001 From: Cong Date: Mon, 1 Jan 2024 13:06:05 +1100 Subject: [PATCH] Add lower range for nanopb 0.4.5 (fixes #829) --- CMakeLists.txt | 2 +- src/cdogs/hud/health_gauge.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 189a75b22..6ade8d9ce 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -65,7 +65,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/src/proto/nanopb/extra") -find_package(Nanopb REQUIRED) +find_package(Nanopb 0.4.5...<1.0.0 REQUIRED) find_package(SDL2 REQUIRED) message("SDL2 include dir: ${SDL2_INCLUDE_DIRS}") find_package(SDL2_image REQUIRED) diff --git a/src/cdogs/hud/health_gauge.c b/src/cdogs/hud/health_gauge.c index 991e4d018..fb30fced1 100644 --- a/src/cdogs/hud/health_gauge.c +++ b/src/cdogs/hud/health_gauge.c @@ -2,7 +2,7 @@ C-Dogs SDL A port of the legendary (and fun) action/arcade cdogs. - Copyright (c) 2017, 2019, 2021 Cong Xu + Copyright (c) 2017, 2019, 2021, 2023-2024 Cong Xu All rights reserved. Redistribution and use in source and binary forms, with or without @@ -116,12 +116,12 @@ void HealthGaugeDraw( const int healthOverMax = actor->health - maxHealth; const int excessHealth = ActorGetMaxHeal(actor, true); const int excessHealthRange = MAX(excessHealth - maxHealth, healthOverMax); - const int innerWidth = MAX(1, width * healthOverMax / excessHealthRange); + const int innerWidth2 = MAX(1, width * healthOverMax / excessHealthRange); hsv.h = 120.0; hsv.v = 1.0; barColor = ColorTint(colorWhite, hsv); barColor.a = opts.Mask.a; - HUDDrawGaugeInner(device, &gPicManager, pos, innerWidth, barColor); + HUDDrawGaugeInner(device, &gPicManager, pos, innerWidth2, barColor); } // Draw health number label