added configurability of different window size for title screens
[rocksndiamonds.git] / src / screens.c
index 8ec78ee60f455d7f0518bfd3517549040ca72c5f..e68ec1a8d37efb07cee16488cc4a1c64f5a1a93f 100644 (file)
@@ -1252,14 +1252,6 @@ void DrawHeadline()
                    setup.internal.program_copyright);
 }
 
-int effectiveGameStatus()
-{
-  if (game_status == GAME_MODE_INFO && info_mode == INFO_MODE_TITLE)
-    return GAME_MODE_TITLE;
-
-  return game_status;
-}
-
 void DrawTitleScreenImage(int nr, boolean initial)
 {
   int graphic = getTitleScreenGraphic(nr, initial);
@@ -1434,6 +1426,7 @@ void DrawMainMenu()
 
   if (CheckTitleScreen(levelset_has_changed))
   {
+    game_status_last_screen = GAME_MODE_MAIN;
     game_status = GAME_MODE_TITLE;
 
     DrawTitleScreen();
@@ -1557,7 +1550,7 @@ void HandleTitleScreen(int mx, int my, int dx, int dy, int button)
     last_sound = SND_UNDEFINED;
     last_music = MUS_UNDEFINED;
 
-    if (game_status == GAME_MODE_INFO)
+    if (game_status_last_screen == GAME_MODE_INFO)
     {
       if (num_title_screens == 0)
       {
@@ -1570,8 +1563,13 @@ void HandleTitleScreen(int mx, int my, int dx, int dy, int button)
       FadeSoundsAndMusic();
 
       FadeOut(REDRAW_ALL);
+
+      /* only required to update logic for redrawing global border */
+      ClearField();
     }
 
+    ChangeViewportPropertiesIfNeeded();
+
     if (tci->is_image)
       DrawTitleScreenImage(tci->local_nr, tci->initial);
     else
@@ -1619,11 +1617,13 @@ void HandleTitleScreen(int mx, int my, int dx, int dy, int button)
   }
   else if (button == MB_MENU_CHOICE)
   {
-    if (game_status == GAME_MODE_INFO && num_title_screens == 0)
+    if (game_status_last_screen == GAME_MODE_INFO && num_title_screens == 0)
     {
       FadeSetEnterScreen();
 
+      game_status = GAME_MODE_INFO;
       info_mode = INFO_MODE_MAIN;
+
       DrawInfoScreen();
 
       return;
@@ -1688,8 +1688,9 @@ void HandleTitleScreen(int mx, int my, int dx, int dy, int button)
     /* force full menu screen redraw after displaying title screens */
     redraw_mask = REDRAW_ALL;
 
-    if (game_status == GAME_MODE_INFO)
+    if (game_status_last_screen == GAME_MODE_INFO)
     {
+      game_status = GAME_MODE_INFO;
       info_mode = INFO_MODE_MAIN;
 
       DrawInfoScreen();
@@ -2159,6 +2160,8 @@ static void DrawInfoScreen_Main()
 
   FadeOut(fade_mask);
 
+  ChangeViewportPropertiesIfNeeded();
+
   OpenDoor(GetDoorState() | DOOR_NO_DELAY | DOOR_FORCE_REDRAW);
 
   ClearField();
@@ -2662,6 +2665,9 @@ void DrawInfoScreen_HelpText(int element, int action, int direction, int ypos)
 
 void DrawInfoScreen_TitleScreen()
 {
+  game_status_last_screen = GAME_MODE_INFO;
+  game_status = GAME_MODE_TITLE;
+
   DrawTitleScreen();
 }