From: Holger Schemel Date: Fri, 6 Sep 2019 06:54:09 +0000 (+0200) Subject: fixed redraw bug if gadget buttons are defined outside viewports X-Git-Tag: 4.1.4.0~23 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=e338cc862574dd965998d636818b8a62e71eccee;p=rocksndiamonds.git fixed redraw bug if gadget buttons are defined outside viewports 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. --- diff --git a/src/game.c b/src/game.c index f0d6aff1..e50017a9 100644 --- a/src/game.c +++ b/src/game.c @@ -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) diff --git a/src/tape.c b/src/tape.c index 6987d5d5..6cf79719 100644 --- a/src/tape.c +++ b/src/tape.c @@ -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)