changed internal status handling of global animations
[rocksndiamonds.git] / src / screens.c
index a9448442cefcc3ffb3e47c695885da6624a46849..ab50316dc10ccc35cfd820ea20fd24629e21df9d 100644 (file)
@@ -235,6 +235,9 @@ static TreeInfo *drop_distance_current = NULL;
 static TreeInfo *level_number = NULL;
 static TreeInfo *level_number_current = NULL;
 
+static unsigned int sync_frame_delay = 0;
+static unsigned int sync_frame_delay_value = GAME_FRAME_DELAY;
+
 static struct
 {
   int value;
@@ -1566,6 +1569,9 @@ void HandleTitleScreen(int mx, int my, int dx, int dy, int button)
     {
       if (num_title_screens == 0)
       {
+       /* switch game mode from title screen mode back to info screen mode */
+       game_status = GAME_MODE_INFO;
+
        DrawInfoScreen_NotAvailable("Title screen information:",
                                    "No title screen for this level set.");
 
@@ -5376,7 +5382,7 @@ static struct TokenInfo setup_info_graphics[] =
   { TYPE_SWITCH,       &setup.quick_switch,    "Quick Player Focus Switch:" },
   { TYPE_SWITCH,       &setup.quick_doors,     "Quick Menu Doors:"     },
   { TYPE_SWITCH,       &setup.show_titlescreen,"Show Title Screens:"   },
-  { TYPE_SWITCH,       &setup.toons,           "Show Toons:"           },
+  { TYPE_SWITCH,       &setup.toons,           "Show Menu Animations:" },
   { TYPE_ECS_AGA,      &setup.prefer_aga_graphics,"EMC graphics preference:" },
   { TYPE_SWITCH, &setup.sp_show_border_elements,"Supaplex Border Elements:" },
   { TYPE_SWITCH,       &setup.small_game_graphics, "Small Game Graphics:" },
@@ -5595,8 +5601,7 @@ static Key getSetupKey()
     DoAnimation();
     BackToFront();
 
-    /* don't eat all CPU time */
-    Delay(10);
+    WaitUntilDelayReached(&sync_frame_delay, sync_frame_delay_value);
   }
 
   return key;
@@ -6283,8 +6288,7 @@ void CustomizeKeyboard(int player_nr)
     DoAnimation();
     BackToFront();
 
-    /* don't eat all CPU time */
-    Delay(10);
+    WaitUntilDelayReached(&sync_frame_delay, sync_frame_delay_value);
   }
 
   /* write new key bindings back to player setup */
@@ -6439,8 +6443,7 @@ static boolean CalibrateJoystickMain(int player_nr)
     DoAnimation();
     BackToFront();
 
-    /* don't eat all CPU time */
-    Delay(10);
+    WaitUntilDelayReached(&sync_frame_delay, sync_frame_delay_value);
   }
 
   /* calibrated center position (joystick should now be centered) */
@@ -6462,7 +6465,7 @@ static boolean CalibrateJoystickMain(int player_nr)
       NextEvent(&event);
       HandleOtherEvents(&event);
 
-      Delay(10);
+      WaitUntilDelayReached(&sync_frame_delay, sync_frame_delay_value);
     }
   }