From 99562075c53eb41cf0b575a63d75a5380d04bdb1 Mon Sep 17 00:00:00 2001 From: Misa Date: Tue, 19 May 2020 18:09:47 -0700 Subject: [PATCH] Don't draw "Game paused" when in blackout mode Blackout mode doesn't work properly, because the game doesn't actually black out the screen, it merely stops drawing things. Oh and only some things at that, some other things are still drawn. This results in a freeze-frame effect, which is apparently fixed in the Switch version. Custom levels utilize this freeze-frame effect, so it's a bit annoying that the "Game paused" screen draws on top of it and makes it so that the freeze-frame freezes on "Game paused" until blackout is turned off. So I'm making it so that "Game paused" doesn't get drawn in blackout mode. However it will still do graphics.render() because otherwise it'll just result in a black screen. --- desktop_version/src/main.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/desktop_version/src/main.cpp b/desktop_version/src/main.cpp index c96faf7f..6e722260 100644 --- a/desktop_version/src/main.cpp +++ b/desktop_version/src/main.cpp @@ -382,11 +382,14 @@ int main(int argc, char *argv[]) Mix_Pause(-1); Mix_PauseMusic(); - FillRect(graphics.backBuffer, 0x00000000); - graphics.bprint(5, 110, "Game paused", 196 - help.glow, 255 - help.glow, 196 - help.glow, true); - graphics.bprint(5, 120, "[click to resume]", 196 - help.glow, 255 - help.glow, 196 - help.glow, true); - graphics.bprint(5, 220, "Press M to mute in game", 164 - help.glow, 196 - help.glow, 164 - help.glow, true); - graphics.bprint(5, 230, "Press N to mute music only", 164 - help.glow, 196 - help.glow, 164 - help.glow, true); + if (!game.blackout) + { + FillRect(graphics.backBuffer, 0x00000000); + graphics.bprint(5, 110, "Game paused", 196 - help.glow, 255 - help.glow, 196 - help.glow, true); + graphics.bprint(5, 120, "[click to resume]", 196 - help.glow, 255 - help.glow, 196 - help.glow, true); + graphics.bprint(5, 220, "Press M to mute in game", 164 - help.glow, 196 - help.glow, 164 - help.glow, true); + graphics.bprint(5, 230, "Press N to mute music only", 164 - help.glow, 196 - help.glow, 164 - help.glow, true); + } graphics.render(); //We are minimised, so lets put a bit of a delay to save CPU SDL_Delay(100);