Skip to content

Commit

Permalink
Add lower range for nanopb 0.4.5 (fixes #829)
Browse files Browse the repository at this point in the history
  • Loading branch information
cxong committed Jan 1, 2024
1 parent fa53088 commit 49a579d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions src/cdogs/hud/health_gauge.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 49a579d

Please sign in to comment.