Index: view.c
===================================================================
--- view.c (revision 2574)
+++ view.c (working copy)
@@ -3613,7 +3613,15 @@
// tweak as needed, this alters the transparency
c1.a = 140;
- drawIsoEnergyBar(Z_DIR, x, y, 1, 5, 5, w, PercentageDone, &c1, &c2);
+
+ //Minimum width for the "health remaining" display bar in percentage form
+ float percent = 0.05;
+ //ensure the remaining health display shows at minimum "percent" health
+ if (PercentageDone > percent){
+ drawIsoEnergyBar(Z_DIR, x, y, 1, 5, 5, w, PercentageDone, &c1, &c2);
+ }else{
+ drawIsoEnergyBar(Z_DIR, x, y, 1, 5, 5, w, percent, &c1, &c2);
+ }
}
#endif
Index: hud.c
===================================================================
--- hud.c (revision 2574)
+++ hud.c (working copy)
@@ -599,7 +599,7 @@
2.5 * FontHeight(BFont_to_use);
// Width of bars
- bar_width = (text_length) * (cur_enemy->energy / Druidmap[cur_enemy->type].maxenergy);
+ bar_width = (text_length);
barc_width = (text_length) * (1.0 - cur_enemy->energy / Druidmap[cur_enemy->type].maxenergy);
if (bar_width < 0)
bar_width = 0;
@@ -618,10 +618,20 @@
}
// Draw the energy bar complement
- rect.x = bar_x + bar_width;
+ rect.x = bar_x;
rect.y = bar_y;
rect.w = barc_width;
- our_SDL_fill_rect_wrapper(Screen, &rect, SDL_MapRGB(Screen->format, 0x000, 0x000, 0x000));
+
+ //Minimum width for the "health remaining" display bar in percentage form
+ float percent = 0.005;
+
+ //The "if" and "else" statement ensures that the health-bar displays of at least percentage*bar_width remaining health
+ if (barc_width < (bar_width*(1 - percent))){
+ our_SDL_fill_rect_wrapper(Screen, &rect, SDL_MapRGB(Screen->format, 0x000, 0x000, 0x000));
+ }else{
+ rect.w = bar_width*(percent);
+ our_SDL_fill_rect_wrapper(Screen, &rect, SDL_MapRGB(Screen->format, 0x000, 0x000, 0x000));
+ }
// Display droid's short description text
rect.x = translate_map_point_to_screen_pixel_x(description_pos->x, description_pos->y) - text_length / 2;