From 21dc90dd0ea3cf5eee728179c4c60bedcc5db67f Mon Sep 17 00:00:00 2001 From: Misa Date: Tue, 11 May 2021 20:03:11 -0700 Subject: [PATCH] Fix 1-frame glitch returning from in-game options with Flip Mode on If you had Flip Mode enabled when exiting from in-game options, the game would flash the in-game options menu as flipped for 1 frame before returning to the pause menu. To fix this, just defer the Flip Mode variable assignment to be done at the end of the frame. --- desktop_version/src/Game.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/desktop_version/src/Game.cpp b/desktop_version/src/Game.cpp index 26becd01..580bd6a1 100644 --- a/desktop_version/src/Game.cpp +++ b/desktop_version/src/Game.cpp @@ -6725,6 +6725,11 @@ static void setfademode(void) graphics.fademode = graphics.ingame_fademode; } +static void setflipmode(void) +{ + graphics.flipmode = graphics.setflipmode; +} + void Game::returntoingame(void) { ingame_titlemode = false; @@ -6742,7 +6747,7 @@ void Game::returntoingame(void) { DEFER_CALLBACK(returntoingametemp); gamestate = MAPMODE; - graphics.flipmode = graphics.setflipmode; + DEFER_CALLBACK(setflipmode); DEFER_CALLBACK(setfademode); if (!map.custommode && !graphics.flipmode) {