Stop changing alpha levels of hp/xp bars if the unit is invisible.

Bars are part of the UI and must not be affected by the unit "look"
(and orbs, ellipses etc.. are always fully visible) This fix a
flickering bar bug of ghost reported by Aethaeryn and will prevent
almost invisible bars for almost invisble unit.
This commit is contained in:
Ali El Gariani 2008-02-13 23:23:59 +00:00
parent 17f441d3de
commit 0464c67d1f

View file

@ -1796,7 +1796,6 @@ void unit::redraw_unit(game_display& disp, const gamemap::location& loc)
if(draw_bars) {
const std::string* movement_file = NULL;
const std::string* energy_file = &game_config::energy_image;
const fixed_t bar_alpha = highlight_ratio < ftofxp(1.0) && blend_with == 0 ? highlight_ratio : (loc == disp.mouseover_hex() ? ftofxp(1.0): ftofxp(0.7));
if(size_t(side()) != disp.viewing_team()+1) {
if(disp.team_valid() &&
@ -1832,6 +1831,8 @@ void unit::redraw_unit(game_display& disp, const gamemap::location& loc)
#endif
const int hp_bar_height = static_cast<int>(max_hitpoints()*game_config::hp_bar_scaling);
const fixed_t bar_alpha = loc == disp.mouseover_hex() ? ftofxp(1.0): ftofxp(0.7);
disp.draw_bar(*energy_file, xsrc+bar_shift, ysrc_adjusted, hp_bar_height, unit_energy,hp_color(), bar_alpha);
if(experience() > 0 && can_advance()) {