From fb15a0b5151f5a465a81607ebc048451dde8f3b0 Mon Sep 17 00:00:00 2001 From: AllyTally Date: Sat, 18 Mar 2023 17:36:07 -0300 Subject: [PATCH] Fix the game texture clearing during menu shaking Because of how `blackout` works, screen shaking must clear the gameplay buffer. `blackout` simply pauses rendering, so if the gameplay buffer gets cleared, then the screen will just be black, otherwise it'll look like the game is "frozen". VVVVVV only uses `blackout` during screen shaking, so it works as intended. However, when reimplementing this behavior in the move to using the SDL_Renderer system, I failed to notice that since my implementation always clears the gameplay buffer when shaking, if you open the menu during a shake, instead of seeing gameplay during the transition animation, you only see black. This has been fixed with a simple `game.blackout` check before clearing the gameplay buffer. --- desktop_version/src/Graphics.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/desktop_version/src/Graphics.cpp b/desktop_version/src/Graphics.cpp index d3aa6972..cdf29e9e 100644 --- a/desktop_version/src/Graphics.cpp +++ b/desktop_version/src/Graphics.cpp @@ -3173,7 +3173,7 @@ void Graphics::screenshake(void) clear(); // Clear the gameplay texture so blackout() is actually black after a screenshake - if (game.gamestate == GAMEMODE) + if (game.gamestate == GAMEMODE && game.blackout) { set_render_target(gameplayTexture); clear();