From: Holger Schemel Date: Thu, 2 Jun 2016 18:02:57 +0000 (+0200) Subject: fixed changing viewport properties not before fading out last screen (more) X-Git-Tag: 4.0.0.0-rc3~22 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=2b37570006f2a25e5e5de1cedac61dda372329b0;p=rocksndiamonds.git fixed changing viewport properties not before fading out last screen (more) --- diff --git a/src/editor.c b/src/editor.c index 3338b0f8..85859907 100644 --- a/src/editor.c +++ b/src/editor.c @@ -7625,14 +7625,14 @@ void DrawLevelEd() FadeSoundsAndMusic(); - /* needed if different viewport properties defined for editor */ - ChangeViewportPropertiesIfNeeded(); - if (CheckIfGlobalBorderHasChanged()) fade_mask = REDRAW_ALL; FadeOut(fade_mask); + /* needed if different viewport properties defined for editor */ + ChangeViewportPropertiesIfNeeded(); + ClearField(); InitZoomLevelSettings(); diff --git a/src/game.c b/src/game.c index 81ac077a..9b20bd43 100644 --- a/src/game.c +++ b/src/game.c @@ -3103,9 +3103,6 @@ void InitGame() SetGameStatus(GAME_MODE_PLAYING); - /* needed if different viewport properties defined for playing */ - ChangeViewportPropertiesIfNeeded(); - if (level_editor_test_game) FadeSkipNextFadeIn(); else @@ -3120,6 +3117,9 @@ void InitGame() FadeOut(fade_mask); + /* needed if different viewport properties defined for playing */ + ChangeViewportPropertiesIfNeeded(); + ClearField(); OpenDoor(GetDoorState() | DOOR_NO_DELAY | DOOR_FORCE_REDRAW); diff --git a/src/screens.c b/src/screens.c index 1748b1aa..12fa2331 100644 --- a/src/screens.c +++ b/src/screens.c @@ -1600,12 +1600,12 @@ void HandleTitleScreen(int mx, int my, int dx, int dy, int button) FadeOut(REDRAW_ALL); - /* only required to update logic for redrawing global border */ - ClearField(); - /* title screens may have different window size */ ChangeViewportPropertiesIfNeeded(); + /* only required to update logic for redrawing global border */ + ClearField(); + if (tci->is_image) DrawTitleScreenImage(tci->local_nr, tci->initial); else @@ -1851,8 +1851,6 @@ void HandleMainMenu(int mx, int my, int dx, int dy, int button) SetGameStatus(GAME_MODE_LEVELNR); - ChangeViewportPropertiesIfNeeded(); - DrawChooseLevelNr(); } else if (pos >= MAIN_CONTROL_NAME && pos <= MAIN_CONTROL_QUIT) @@ -1893,8 +1891,6 @@ void HandleMainMenu(int mx, int my, int dx, int dy, int button) if (setup.internal.choose_from_top_leveldir) gotoTopLevelDir(); - ChangeViewportPropertiesIfNeeded(); - DrawChooseLevelSet(); } } @@ -1928,8 +1924,6 @@ void HandleMainMenu(int mx, int my, int dx, int dy, int button) info_mode = INFO_MODE_MAIN; - ChangeViewportPropertiesIfNeeded(); - DrawInfoScreen(); } else if (pos == MAIN_CONTROL_GAME) @@ -1944,8 +1938,6 @@ void HandleMainMenu(int mx, int my, int dx, int dy, int button) setup_mode = SETUP_MODE_MAIN; - ChangeViewportPropertiesIfNeeded(); - DrawSetupScreen(); } else if (pos == MAIN_CONTROL_QUIT) @@ -2164,8 +2156,11 @@ static void DrawInfoScreen_Main() FadeOut(fade_mask); + /* needed if different viewport properties defined for info screen */ ChangeViewportPropertiesIfNeeded(); + SetMainBackgroundImage(IMG_BACKGROUND_INFO); + ClearField(); OpenDoor(GetDoorState() | DOOR_NO_DELAY | DOOR_FORCE_REDRAW); @@ -3501,8 +3496,6 @@ void HandleInfoScreen_LevelSet(int button) static void DrawInfoScreen() { - SetMainBackgroundImage(IMG_BACKGROUND_INFO); - if (info_mode == INFO_MODE_TITLE) DrawInfoScreen_TitleScreen(); else if (info_mode == INFO_MODE_ELEMENTS) @@ -3660,6 +3653,14 @@ static void DrawChooseTree(TreeInfo **ti_ptr) FadeOut(fade_mask); + /* needed if different viewport properties defined for choosing level (set) */ + ChangeViewportPropertiesIfNeeded(); + + if (game_status == GAME_MODE_LEVELNR) + SetMainBackgroundImage(IMG_BACKGROUND_LEVELNR); + else if (game_status == GAME_MODE_LEVELS) + SetMainBackgroundImage(IMG_BACKGROUND_LEVELS); + ClearField(); OpenDoor(GetDoorState() | DOOR_NO_DELAY | DOOR_FORCE_REDRAW); @@ -4054,8 +4055,6 @@ void DrawChooseLevelSet() { FadeSoundsAndMusic(); - SetMainBackgroundImage(IMG_BACKGROUND_LEVELS); - DrawChooseTree(&leveldir_current); PlayMenuSound(); @@ -4117,8 +4116,6 @@ void DrawChooseLevelNr() if (level_number_current == NULL) level_number_current = level_number; - SetMainBackgroundImage(IMG_BACKGROUND_LEVELNR); - DrawChooseTree(&level_number_current); PlayMenuSound(); @@ -5772,6 +5769,11 @@ static void DrawSetupScreen_Generic() FadeOut(fade_mask); + /* needed if different viewport properties defined for setup screen */ + ChangeViewportPropertiesIfNeeded(); + + SetMainBackgroundImage(IMG_BACKGROUND_SETUP); + ClearField(); OpenDoor(GetDoorState() | DOOR_NO_DELAY | DOOR_FORCE_REDRAW); @@ -6476,8 +6478,6 @@ void DrawSetupScreen() { DeactivateJoystick(); - SetMainBackgroundImage(IMG_BACKGROUND_SETUP); - if (setup_mode == SETUP_MODE_INPUT) DrawSetupScreen_Input(); else if (setup_mode == SETUP_MODE_CHOOSE_GAME_SPEED)