added level info config option to disable time limit for all levels
[rocksndiamonds.git] / src / screens.c
index d027efa27227ff95e00338bc6a1c8d457683932f..576f1ff0566a054f1dd9d4fc2df1345cde67da33 100644 (file)
@@ -8456,8 +8456,13 @@ static boolean CustomizeKeyboardMain(int player_nr)
   while (!finished)
   {
     Event event;
+    unsigned int event_frame_delay = 0;
+    unsigned int event_frame_delay_value = GAME_FRAME_DELAY;
 
-    if (NextValidEvent(&event))
+    // reset frame delay counter directly after updating screen
+    ResetDelayCounter(&event_frame_delay);
+
+    while (NextValidEvent(&event))
     {
       switch (event.type)
       {
@@ -8528,6 +8533,10 @@ static boolean CustomizeKeyboardMain(int player_nr)
          HandleOtherEvents(&event);
          break;
       }
+
+      // do not handle events for longer than standard frame delay period
+      if (DelayReached(&event_frame_delay, event_frame_delay_value))
+       break;
     }
 
     BackToFront();
@@ -8630,11 +8639,6 @@ static boolean ConfigureJoystickMapButtonsAndAxes(SDL_Joystick *joystick)
     { 282, 210, MARKER_AXIS_Y, "righty",       },
   };
 
-  unsigned int event_frame_delay = 0;
-  unsigned int event_frame_delay_value = GAME_FRAME_DELAY;
-
-  ResetDelayCounter(&event_frame_delay);
-
   if (!bitmaps_initialized)
   {
     controller = LoadCustomImage("joystick/controller.png");
@@ -8766,6 +8770,12 @@ static boolean ConfigureJoystickMapButtonsAndAxes(SDL_Joystick *joystick)
 
       screen_initialized = TRUE;
 
+      unsigned int event_frame_delay = 0;
+      unsigned int event_frame_delay_value = GAME_FRAME_DELAY;
+
+      // reset frame delay counter directly after updating screen
+      ResetDelayCounter(&event_frame_delay);
+
       while (NextValidEvent(&event))
       {
        switch (event.type)
@@ -9745,6 +9755,10 @@ static void CreateScreenMenubuttons(void)
     int type = GD_TYPE_NORMAL_BUTTON;
     boolean checked = FALSE;
 
+    // do not use touch buttons if overlay touch buttons are disabled
+    if (is_touch_button && !setup.touch.overlay_buttons)
+      continue;
+
     event_mask = menubutton_info[i].event_mask;
 
     x = (is_touch_button ? pos->x : mSX + GDI_ACTIVE_POS(pos->x));