fixed redraw bug if gadget buttons are defined outside viewports
authorHolger Schemel <info@artsoft.org>
Fri, 6 Sep 2019 06:54:09 +0000 (08:54 +0200)
committerHolger Schemel <info@artsoft.org>
Fri, 6 Sep 2019 06:54:09 +0000 (08:54 +0200)
This bug was introduced with a fix in commit 50a54138. The problem
with this fix was that it clears REDRAW_ALL from the redraw mask,
which may lead to no redraw at all for this game frame.

This bugfix makes sure that at least the playfield and doors area
will always be redrawn in this case.

src/game.c
src/tape.c

index f0d6aff1d4517c50d0b7aeff690535828c3514c9..e50017a9bed88bd57f2cc5403b066657abd53ddf 100644 (file)
@@ -15759,7 +15759,8 @@ static void RedrawGameButtonsExt(boolean on_tape)
       RedrawGadget(game_gadget[i]);
 
   // RedrawGadget() may have set REDRAW_ALL if buttons are defined off-area
-  redraw_mask &= ~REDRAW_ALL;
+  if (redraw_mask & REDRAW_ALL)
+    redraw_mask = REDRAW_FIELD | REDRAW_DOORS;
 }
 
 static void SetGadgetState(struct GadgetInfo *gi, boolean state)
index 6987d5d588d8e2b3efe37d576e66d349f3d6ebb8..6cf797198dcf20bf456c1b76c75f5b1e64d52619 100644 (file)
@@ -1411,7 +1411,8 @@ void RedrawTapeButtons(void)
     RedrawGameButtonsOnTape();
 
   // RedrawGadget() may have set REDRAW_ALL if buttons are defined off-area
-  redraw_mask &= ~REDRAW_ALL;
+  if (redraw_mask & REDRAW_ALL)
+    redraw_mask = REDRAW_FIELD | REDRAW_DOORS;
 }
 
 void RedrawOrRemapTapeButtons(void)