From ea2ecc81b1276cb850e0f64df5f5e7ff258bde5e Mon Sep 17 00:00:00 2001 From: Misa Date: Tue, 13 Apr 2021 14:42:45 -0700 Subject: [PATCH] Don't process music, fades, or timer when unfocused This fixes being able to make music fully fade in (or out) by unfocusing the game, or making the fade bars fully fade in (or out) by unfocusing the game, or racking up the timer while the game is unfocused. --- desktop_version/src/main.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/desktop_version/src/main.cpp b/desktop_version/src/main.cpp index f1048c5f..b603c52e 100644 --- a/desktop_version/src/main.cpp +++ b/desktop_version/src/main.cpp @@ -728,7 +728,9 @@ static void focused_begin(void) static void focused_end(void) { - /* no-op. */ + game.gameclock(); + music.processmusic(); + graphics.processfade(); } static enum LoopCode loop_end(void) @@ -789,9 +791,5 @@ static enum LoopCode loop_end(void) gameScreen.ResizeScreen(-1, -1); } - music.processmusic(); - graphics.processfade(); - game.gameclock(); - return Loop_continue; }