game: try to prevent missile animation to appear outside the terrain...

This commit is contained in:
ALONSO Laurent
2021-09-30 09:29:23 +02:00
committed by Celtic Minstrel
parent e8e3b13c7c
commit 296ac67e71

View File

@@ -398,6 +398,8 @@ void do_missile_anim(short num_steps,location missile_origin,short sound_num) {
// Now, at last, launch missile
for(short t = 0; t < num_steps; t++) {
draw_terrain();
// prevent drawing to happen outside the terrain windows
clip_rect(mainPtr, terrain_screen_rect);
for(short i = 0; i < 30; i++)
if(store_missiles[i].missile_type >= 0) {
// Where place?
@@ -439,6 +441,7 @@ void do_missile_anim(short num_steps,location missile_origin,short sound_num) {
rect_draw_some_item(from_gw,from_rect, mainPtr,temp_rect,sf::BlendAlpha);
}
}
undo_clip(mainPtr);
mainPtr.setActive();
mainPtr.display();
sf::sleep(sf::milliseconds(2 + 5 * get_int_pref("GameSpeed")));