mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-02-02 15:32:19 +03:00
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.
This commit is contained in:
committed by
Misa Elizabeth Kai
parent
acfa085fd1
commit
fb15a0b515
@@ -3173,7 +3173,7 @@ void Graphics::screenshake(void)
|
|||||||
clear();
|
clear();
|
||||||
|
|
||||||
// Clear the gameplay texture so blackout() is actually black after a screenshake
|
// 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);
|
set_render_target(gameplayTexture);
|
||||||
clear();
|
clear();
|
||||||
|
|||||||
Reference in New Issue
Block a user