mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-07-28 09:59:29 +03:00
Solve render recaching issues
Past solutions were just "recache the screen textures under these known circumstances" where whenever things OUTSIDE of those known circumstances happened, the issue would reoccur. I recently learned about an SDL event, `SDL_RENDER_TARGETS_RESET`, which is for this exact problem. I ripped out all of the other places `Screen::recacheTextures()` was called, and just slotted it in there, and it worked perfectly. ...well, the old behavior worked perfectly; but the old behavior was flawed as well, because it only checked for "ingame_titlemode" (if you're in the main menu during gameplay) and forgot to check for the map screen... plus, it didn't ever regenerate the minimap in custom levels, which is another "persistant" render target. Hopefully, this is the last time we'll ever have to think about this one. I'm certainly sick of it. This should 100% be backported into 2.4, as the bug occurs there as well.
This commit is contained in:
@@ -7926,7 +7926,6 @@ void Game::mapmenuchange(const enum GameGamestate newgamestate, const bool user_
|
||||
gamestate = newgamestate;
|
||||
graphics.resumegamemode = false;
|
||||
mapheld = true;
|
||||
gameScreen.recacheTextures();
|
||||
|
||||
if (prevgamestate == GAMEMODE)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user