Partial fix bug #1565, unit movement artifacts
Returns code for unit_mover:wait_for_anims to invalidate hexes on unit movements. This removes artifacts being left on screen after large animated units have moved.
This commit is contained in:
parent
68ae0d0f07
commit
b244db3b18
1 changed files with 13 additions and 0 deletions
|
@ -394,6 +394,19 @@ void unit_mover::wait_for_anims()
|
|||
animator_.wait_until(wait_until_);
|
||||
// debug code, see unit_frame::redraw()
|
||||
// std::cout << " end\n";
|
||||
/// @todo For wesnoth 1.14+: check if efficient for redrawing?
|
||||
/// Check with large animated units too make sure artifacts are
|
||||
/// not left on screen after unit movement in particular.
|
||||
if ( disp_ ) { // Should always be true if we get here.
|
||||
// Invalidate the hexes around the move that prompted this wait.
|
||||
map_location arr[6];
|
||||
get_adjacent_tiles(path_[current_-1], arr);
|
||||
for ( unsigned i = 0; i < 6; ++i )
|
||||
disp_->invalidate(arr[i]);
|
||||
get_adjacent_tiles(path_[current_], arr);
|
||||
for ( unsigned i = 0; i < 6; ++i )
|
||||
disp_->invalidate(arr[i]);
|
||||
}
|
||||
}
|
||||
|
||||
// Reset data.
|
||||
|
|
Loading…
Add table
Reference in a new issue