fixed updating multiple pause button gadgets when toggling pause mode
[rocksndiamonds.git] / src / game.c
index f0d6aff1d4517c50d0b7aeff690535828c3514c9..15cd41222e7e30e58cba6adf857a1dc87e3c06cc 100644 (file)
@@ -15711,8 +15711,6 @@ void MapUndoRedoButtons(void)
 
   MapGadget(game_gadget[GAME_CTRL_ID_UNDO]);
   MapGadget(game_gadget[GAME_CTRL_ID_REDO]);
-
-  ModifyGadget(game_gadget[GAME_CTRL_ID_PAUSE2], GDI_CHECKED, TRUE, GDI_END);
 }
 
 void UnmapUndoRedoButtons(void)
@@ -15722,8 +15720,21 @@ void UnmapUndoRedoButtons(void)
 
   MapGameButtonsAtSamePosition(GAME_CTRL_ID_UNDO);
   MapGameButtonsAtSamePosition(GAME_CTRL_ID_REDO);
+}
+
+void ModifyPauseButtons(void)
+{
+  static int ids[] =
+  {
+    GAME_CTRL_ID_PAUSE,
+    GAME_CTRL_ID_PAUSE2,
+    GAME_CTRL_ID_PANEL_PAUSE,
+    -1
+  };
+  int i;
 
-  ModifyGadget(game_gadget[GAME_CTRL_ID_PAUSE2], GDI_CHECKED, FALSE, GDI_END);
+  for (i = 0; ids[i] > -1; i++)
+    ModifyGadget(game_gadget[ids[i]], GDI_CHECKED, tape.pausing, GDI_END);
 }
 
 static void MapGameButtonsExt(boolean on_tape)
@@ -15757,9 +15768,6 @@ static void RedrawGameButtonsExt(boolean on_tape)
   for (i = 0; i < NUM_GAME_BUTTONS; i++)
     if (!on_tape || gamebutton_info[i].allowed_on_tape)
       RedrawGadget(game_gadget[i]);
-
-  // RedrawGadget() may have set REDRAW_ALL if buttons are defined off-area
-  redraw_mask &= ~REDRAW_ALL;
 }
 
 static void SetGadgetState(struct GadgetInfo *gi, boolean state)