fix a freeze due to new engine

This commit is contained in:
Jérémy Rosen 2006-03-24 21:10:47 +00:00
parent 2861bca50d
commit 075851becd
3 changed files with 7 additions and 1 deletions

View file

@ -1344,6 +1344,10 @@ void display::draw_tile(int x, int y, double offset)
int xpos = int(get_location_x(loc));
int ypos = int(get_location_y(loc));
unit_map::iterator it = units_.find(loc);
if(it != units_.end()) {
it->second.refresh();;
}
SDL_Rect clip_rect = map_area();
if(xpos >= clip_rect.x + clip_rect.w || ypos >= clip_rect.y + clip_rect.h ||
@ -2022,6 +2026,8 @@ void display::invalidate_animations()
}
}
}
}
void display::recalculate_minimap()

View file

@ -1718,7 +1718,6 @@ void unit::refresh_unit(display& disp,gamemap::location hex,const int& x, const
gamemap::location adjacent[6];
get_adjacent_tiles(hex, adjacent);
if(!anim_) set_standing(disp.turbo()?5:1);
anim_->update_current_frame();
const gamemap::TERRAIN terrain = map.get_terrain(hex);
const double submerge = is_flying() ? 0.0 : map.get_terrain_info(terrain).unit_submerge();
const int height_adjust = is_flying() ? 0 : int(map.get_terrain_info(terrain).unit_height_adjust() * disp.zoom());

View file

@ -85,6 +85,7 @@ public:
void new_turn();
void end_turn();
void new_level();
void refresh() {if(anim_ && !refreshing_) anim_->update_current_frame(); }
void set_resting(bool resting);
bool is_resting() const;