From 296ac67e718514318e935a0f67245d3ee7bbb6fb Mon Sep 17 00:00:00 2001 From: ALONSO Laurent Date: Thu, 30 Sep 2021 09:29:23 +0200 Subject: [PATCH] game: try to prevent missile animation to appear outside the terrain... --- src/game/boe.newgraph.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/game/boe.newgraph.cpp b/src/game/boe.newgraph.cpp index 0615d9f9..0850a44d 100644 --- a/src/game/boe.newgraph.cpp +++ b/src/game/boe.newgraph.cpp @@ -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")));