fix uninitialized variables, this should fix -O3 compile
This commit is contained in:
parent
2f39a91320
commit
e8abf97884
5 changed files with 10 additions and 1 deletions
|
@ -546,6 +546,8 @@ surface recolor_image(surface surf, const color_range& new_rgb, const std::vecto
|
|||
new_g=(Uint8)( old_rat * new_green + (1 - old_rat) * max_green);
|
||||
new_b=(Uint8)( old_rat * new_blue + (1 - old_rat) * max_blue);
|
||||
}else{
|
||||
new_r=0; new_g=0; new_b=0; //supress warning
|
||||
wassert(false);
|
||||
//should never get here
|
||||
//would imply old_avg > reference_avg = 255
|
||||
}
|
||||
|
|
|
@ -1550,6 +1550,7 @@ void unit::refresh_unit(display& disp,gamemap::location hex,bool with_status)
|
|||
|
||||
Uint32 blend_with = current_frame.blend_with;
|
||||
double blend_ratio = current_frame.blend_ratio;
|
||||
if(blend_ratio == 0) { blend_with = disp.rgb(0,0,0); }
|
||||
fixed_t highlight_ratio = minimum<fixed_t>(alpha(),current_frame.highlight_ratio);
|
||||
if(invisible(map.underlying_union_terrain(map[hex.x][hex.y]),
|
||||
disp.get_game_status().get_time_of_day().lawful_bonus,hex,
|
||||
|
|
|
@ -39,6 +39,8 @@ unit_frame::unit_frame(const config& cfg)
|
|||
end_time = atoi(cfg["end"].c_str());
|
||||
highlight_ratio = ftofxp(1);
|
||||
halo = prepare_halo(cfg["halo"],begin_time,end_time);
|
||||
blend_with= 0;
|
||||
blend_ratio = 0;
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -24,7 +24,10 @@
|
|||
|
||||
//a class to describe a unit's animation sequence
|
||||
struct unit_frame {
|
||||
unit_frame() : xoffset(0), halo_x(0), halo_y(0), begin_time(0), end_time(0),highlight_ratio(ftofxp(1)){}
|
||||
unit_frame() : xoffset(0), image(), image_diagonal(),halo(), sound(),
|
||||
halo_x(0), halo_y(0), begin_time(0), end_time(0),
|
||||
blend_with(0),blend_ratio(0),
|
||||
highlight_ratio(ftofxp(1)){}
|
||||
explicit unit_frame(const std::string& str, const std::string & diag ="",
|
||||
int begin=0,int end = 0,
|
||||
Uint32 blend_color = 0, double blend_rate = 0.0,
|
||||
|
|
|
@ -254,6 +254,7 @@ bool unit_attack_ranged(display& disp,const gamemap& map, unit_map& units,
|
|||
missile_animation.get_first_frame_time()),-200);
|
||||
missile_animation.start_animation(start_time,acceleration);
|
||||
defender.restart_animation(disp,start_time);
|
||||
animation_time = defender.get_animation()->get_animation_time();
|
||||
while(!defender.get_animation()->animation_finished() ||
|
||||
(leader_loc.valid() && !leader->second.get_animation()->animation_finished())) {
|
||||
const double pos = animation_time < missile_animation.get_first_frame_time()?1.0:
|
||||
|
|
Loading…
Add table
Reference in a new issue