fixed order of some drawing operations to be related to correct screen
authorHolger Schemel <info@artsoft.org>
Sun, 20 Mar 2016 15:01:31 +0000 (16:01 +0100)
committerHolger Schemel <info@artsoft.org>
Sun, 20 Mar 2016 15:01:31 +0000 (16:01 +0100)
src/editor.c
src/game.c
src/screens.c

index 4705b53c874e0b252049170f6676c948fb3b35de..212e1f1016258e1acc996f9818ac1867ffcd1883 100644 (file)
@@ -7625,8 +7625,6 @@ void DrawLevelEd()
 {
   int fade_mask = REDRAW_FIELD;
 
-  CloseDoor(DOOR_CLOSE_ALL);
-
   /* needed if different viewport properties defined for editor */
   ChangeViewportPropertiesIfNeeded();
 
index 2aa3b3458e28d98d216dded012f8ab491bb23e69..87af3c9784116f75271d95b6253658f8af098001 100644 (file)
@@ -3097,11 +3097,11 @@ void InitGame()
   // required here to update video display before fading (FIX THIS)
   DrawMaskedBorder(REDRAW_DOOR_2);
 
-  SetGameStatus(GAME_MODE_PLAYING);
-
   if (!game.restart_level)
     CloseDoor(DOOR_CLOSE_1);
 
+  SetGameStatus(GAME_MODE_PLAYING);
+
   /* needed if different viewport properties defined for playing */
   ChangeViewportPropertiesIfNeeded();
 
@@ -3115,10 +3115,10 @@ void InitGame()
 
   FadeOut(fade_mask);
 
-  OpenDoor(GetDoorState() | DOOR_NO_DELAY | DOOR_FORCE_REDRAW);
-
   ClearField();
 
+  OpenDoor(GetDoorState() | DOOR_NO_DELAY | DOOR_FORCE_REDRAW);
+
   DrawCompleteVideoDisplay();
 
   InitGameEngine();
index 7181f75029922116de9eb5cfa60d19b3f8b0404c..5752a49d0e2308913a6bc3971af728be68904a6c 100644 (file)
@@ -1394,6 +1394,8 @@ void DrawMainMenu()
   /* needed if last screen was the playing screen, invoked from level editor */
   if (level_editor_test_game)
   {
+    CloseDoor(DOOR_CLOSE_ALL);
+
     SetGameStatus(GAME_MODE_EDITOR);
 
     DrawLevelEd();
@@ -2155,8 +2157,6 @@ static void DrawInfoScreen_Main()
   FreeScreenGadgets();
   CreateScreenGadgets();
 
-  CloseDoor(DOOR_CLOSE_2);
-
   /* (needed after displaying title screens which disable auto repeat) */
   KeyboardAutoRepeatOn();
 
@@ -2166,10 +2166,10 @@ static void DrawInfoScreen_Main()
 
   ChangeViewportPropertiesIfNeeded();
 
-  OpenDoor(GetDoorState() | DOOR_NO_DELAY | DOOR_FORCE_REDRAW);
-
   ClearField();
 
+  OpenDoor(GetDoorState() | DOOR_NO_DELAY | DOOR_FORCE_REDRAW);
+
   DrawTextSCentered(mSY - SY + 16, FONT_TITLE_1, "Info Screen");
 
   info_info = info_info_main;
@@ -2191,11 +2191,6 @@ static void DrawInfoScreen_Main()
   PlayMenuSound();
   PlayMenuMusic();
 
-#if 1
-  // needed after returning from title screens with different window size
-  OpenDoor(GetDoorState() | DOOR_NO_DELAY | DOOR_FORCE_REDRAW);
-#endif
-
   DrawMaskedBorder(fade_mask);
 
   FadeIn(fade_mask);
@@ -3667,14 +3662,12 @@ static void DrawChooseTree(TreeInfo **ti_ptr)
   FreeScreenGadgets();
   CreateScreenGadgets();
 
-  CloseDoor(DOOR_CLOSE_2);
-
   FadeOut(fade_mask);
 
-  OpenDoor(GetDoorState() | DOOR_NO_DELAY | DOOR_FORCE_REDRAW);
-
   ClearField();
 
+  OpenDoor(GetDoorState() | DOOR_NO_DELAY | DOOR_FORCE_REDRAW);
+
   HandleChooseTree(0, 0, 0, 0, MB_MENU_INITIALIZE, ti_ptr);
   MapScreenTreeGadgets(*ti_ptr);
 
@@ -4153,9 +4146,6 @@ void DrawHallOfFame(int highlight_position)
 {
   int fade_mask = REDRAW_FIELD;
 
-  /* required before door position may be changed in next step */
-  CloseDoor(DOOR_CLOSE_ALL);
-
   /* needed if different viewport properties defined for scores */
   ChangeViewportPropertiesIfNeeded();
 
@@ -5780,17 +5770,15 @@ static void DrawSetupScreen_Generic()
   FreeScreenGadgets();
   CreateScreenGadgets();
 
-  CloseDoor(DOOR_CLOSE_2);
-
   if (redraw_mask & REDRAW_ALL)
     redraw_all = TRUE;
 
   FadeOut(fade_mask);
 
-  OpenDoor(GetDoorState() | DOOR_NO_DELAY | DOOR_FORCE_REDRAW);
-
   ClearField();
 
+  OpenDoor(GetDoorState() | DOOR_NO_DELAY | DOOR_FORCE_REDRAW);
+
   if (setup_mode == SETUP_MODE_MAIN)
   {
     setup_info = setup_info_main;