rnd-20140117-2-src
[rocksndiamonds.git] / src / screens.c
index 6543e1688174a3926e792a91652c81cd859c9d52..23950185c844134ff1c5927f43f3337762cc2e0c 100644 (file)
@@ -1317,6 +1317,8 @@ void DrawMainMenuExt(int fade_mask, boolean do_fading)
   static LevelDirTree *leveldir_last_valid = NULL;
   boolean levelset_has_changed = FALSE;
 
+  LimitScreenUpdates(FALSE);
+
   FadeSetLeaveScreen();
 
   /* do not fade out here -- function may continue and fade on editor screen */
@@ -1344,7 +1346,8 @@ void DrawMainMenuExt(int fade_mask, boolean do_fading)
   }
 
   /* needed if last screen was the setup screen and fullscreen state changed */
-  ToggleFullscreenIfNeeded();
+  // (moved to "execSetupGraphics()" to change fullscreen state directly)
+  // ToggleFullscreenOrChangeWindowScalingIfNeeded();
 
   /* leveldir_current may be invalid (level group, parent link) */
   if (!validLevelSeries(leveldir_current))
@@ -1418,7 +1421,7 @@ void DrawMainMenuExt(int fade_mask, boolean do_fading)
   InitializeMainControls();
 
   DrawCursorAndText_Main(-1, FALSE);
-  DrawPreviewLevel(TRUE);
+  DrawPreviewLevelInitial();
 
   HandleMainMenu(0, 0, 0, 0, MB_MENU_INITIALIZE);
 
@@ -1757,13 +1760,13 @@ void HandleMainMenu_SelectLevel(int step, int direction)
             mci->pos_text->font);
 
     LoadLevel(level_nr);
-    DrawPreviewLevel(TRUE);
+    DrawPreviewLevelInitial();
 
     TapeErase();
     LoadTape(level_nr);
     DrawCompleteVideoDisplay();
 
-    /* needed because DrawPreviewLevel() takes some time */
+    /* needed because DrawPreviewLevelInitial() takes some time */
     BackToFront();
     SyncDisplay();
   }
@@ -1926,11 +1929,13 @@ void HandleMainMenu(int mx, int my, int dx, int dy, int button)
     }
   }
 
+#if 0
   if (game_status == GAME_MODE_MAIN)
   {
-    DrawPreviewLevel(FALSE);
+    DrawPreviewLevelAnimation();
     DoAnimation();
   }
+#endif
 }
 
 
@@ -3303,7 +3308,9 @@ void HandleInfoScreen(int mx, int my, int dx, int dy, int button)
   else
     HandleInfoScreen_Main(mx, my, dx, dy, button);
 
+#if 0
   DoAnimation();
+#endif
 }
 
 
@@ -3849,7 +3856,9 @@ void HandleChooseLevelSet(int mx, int my, int dx, int dy, int button)
 {
   HandleChooseTree(mx, my, dx, dy, button, &leveldir_current);
 
+#if 0
   DoAnimation();
+#endif
 }
 
 void DrawChooseLevelNr()
@@ -3920,7 +3929,9 @@ void HandleChooseLevelNr(int mx, int my, int dx, int dy, int button)
   HandleChooseTree(mx, my, dx, dy, button, &leveldir_current);
 #endif
 
+#if 0
   DoAnimation();
+#endif
 }
 
 void DrawHallOfFame(int highlight_position)
@@ -4066,7 +4077,9 @@ void HandleHallOfFame(int mx, int my, int dx, int dy, int button)
   if (game_status == GAME_MODE_SCORES)
     PlayMenuSoundIfLoop();
 
+#if 0
   DoAnimation();
+#endif
 }
 
 
@@ -4372,6 +4385,9 @@ static void execSetupGraphics()
   setup_mode = SETUP_MODE_GRAPHICS;
 
   DrawSetupScreen();
+
+  // window scaling may have changed at this point
+  ToggleFullscreenOrChangeWindowScalingIfNeeded();
 }
 
 #if !defined(PLATFORM_ANDROID)
@@ -5154,6 +5170,10 @@ static void changeSetupValue(int pos, int dx)
   }
 
   drawSetupValue(pos);
+
+  // fullscreen state may have changed at this point
+  if (setup_info[pos].value == &setup.fullscreen)
+    ToggleFullscreenOrChangeWindowScalingIfNeeded();
 }
 
 static void DrawCursorAndText_Setup(int pos, boolean active)
@@ -6182,7 +6202,9 @@ void HandleSetupScreen(int mx, int my, int dx, int dy, int button)
   else
     HandleSetupScreen_Generic(mx, my, dx, dy, button);
 
+#if 0
   DoAnimation();
+#endif
 }
 
 void HandleGameActions()