fix unit being drawn under transitions
This commit is contained in:
parent
b081c4466b
commit
43348064f4
3 changed files with 6 additions and 16 deletions
|
@ -1221,20 +1221,6 @@ void display::draw_minimap(int x, int y, int w, int h)
|
|||
}
|
||||
|
||||
|
||||
void display::draw_unit_on_tile(int x, int y)
|
||||
{
|
||||
|
||||
const gamemap::location src(x,y);
|
||||
//see if there is a unit on this tile
|
||||
unit_map::iterator it = units_.find(src);
|
||||
if(it == units_.end()) {
|
||||
return;
|
||||
}
|
||||
|
||||
it->second.refresh_unit(*this,src,true);
|
||||
|
||||
}
|
||||
|
||||
void display::draw_bar(const std::string& image, int xpos, int ypos, size_t height, double filled, const SDL_Color& col, fixed_t alpha)
|
||||
{
|
||||
|
||||
|
@ -1423,7 +1409,10 @@ void display::draw_tile(int x, int y)
|
|||
}
|
||||
|
||||
draw_footstep(loc,xpos,ypos);
|
||||
draw_unit_on_tile(x,y);
|
||||
if(it != units_.end()) {
|
||||
it->second.refresh_unit(*this,loc,true);
|
||||
}
|
||||
|
||||
|
||||
if(!is_shrouded) {
|
||||
draw_terrain_on_tile(x,y,image_type,ADJACENT_FOREGROUND);
|
||||
|
|
|
@ -208,7 +208,6 @@ private:
|
|||
//composes and draws the terrains on a tile
|
||||
void draw_terrain_on_tile(int x, int y, image::TYPE image_type, ADJACENT_TERRAIN_TYPE type);
|
||||
|
||||
void draw_unit_on_tile(int x, int y);
|
||||
|
||||
|
||||
gui::button::TYPE string_to_button_type(std::string type);
|
||||
|
|
|
@ -43,6 +43,7 @@ void teleport_unit_between(display& disp, const gamemap& map, const gamemap::loc
|
|||
|
||||
u.set_teleporting(disp);
|
||||
if (!disp.fogged(a.x, a.y)) { // teleport
|
||||
disp.scroll_to_tile(a.x,a.y,display::ONSCREEN);
|
||||
while(!u.get_animation()->animation_finished() && u.get_animation()->get_animation_time() < 0) {
|
||||
disp.draw_tile(a.x,a.y);
|
||||
disp.update_display();
|
||||
|
@ -52,6 +53,7 @@ void teleport_unit_between(display& disp, const gamemap& map, const gamemap::loc
|
|||
}
|
||||
}
|
||||
if (!disp.fogged(b.x, b.y)) { // teleport
|
||||
u.restart_animation(disp,0);
|
||||
disp.scroll_to_tile(b.x,b.y,display::ONSCREEN);
|
||||
while(!u.get_animation()->animation_finished()) {
|
||||
disp.draw_tile(b.x,b.y);
|
||||
|
|
Loading…
Add table
Reference in a new issue