1
0
Fork 0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-12-23 10:09:43 +01:00

Set fademode to temp 0 when going to in-game options

While I've decoupled fademode from gamemode starting, being faded out on
the title screen results in a black screen and you being unable to make
any input. So we'll need to store the current fademode in a temporary
variable when going to in-game options, then put it back when we return
to the pause menu. Yes, you can turn on glitchrunner mode during the
in-game options, and then immediately return to the pause menu to
instantly go back to the title screen; this is intended.

Due to frame ordering, putting the fademode back needs to be deferred to
the end of the frame to prevent a 1-frame flicker.

It's actually sufficient enough to do this temporary fademode storage to
fix the whole thing, but I also decided to decouple fademode and
gamemode starting just to be sure.
This commit is contained in:
Misa 2021-03-19 23:23:18 -07:00 committed by Ethan Lee
parent 82dfa0b86c
commit be10487c5c
4 changed files with 10 additions and 0 deletions

View file

@ -6666,6 +6666,11 @@ static void nextbgcolor(void)
map.nexttowercolour(); map.nexttowercolour();
} }
static void setfademode(void)
{
graphics.fademode = graphics.ingame_fademode;
}
void Game::returntoingame(void) void Game::returntoingame(void)
{ {
ingame_titlemode = false; ingame_titlemode = false;
@ -6684,6 +6689,7 @@ void Game::returntoingame(void)
DEFER_CALLBACK(returntoingametemp); DEFER_CALLBACK(returntoingametemp);
gamestate = MAPMODE; gamestate = MAPMODE;
graphics.flipmode = graphics.setflipmode; graphics.flipmode = graphics.setflipmode;
DEFER_CALLBACK(setfademode);
if (!map.custommode && !graphics.flipmode) if (!map.custommode && !graphics.flipmode)
{ {
obj.flags[73] = true; obj.flags[73] = true;

View file

@ -98,6 +98,7 @@ void Graphics::init(void)
setfade(0); setfade(0);
fademode = 0; fademode = 0;
ingame_fademode = 0;
// initialize everything else to zero // initialize everything else to zero
backBuffer = NULL; backBuffer = NULL;

View file

@ -295,6 +295,7 @@ public:
int fadeamount; int fadeamount;
int oldfadeamount; int oldfadeamount;
int fadebars[15]; int fadebars[15];
int ingame_fademode;
bool trinketcolset; bool trinketcolset;
int trinketr, trinketg, trinketb; int trinketr, trinketg, trinketb;

View file

@ -2320,6 +2320,8 @@ static void mapmenuactionpress(void)
game.gamestate = TITLEMODE; game.gamestate = TITLEMODE;
graphics.flipmode = false; graphics.flipmode = false;
game.ingame_titlemode = true; game.ingame_titlemode = true;
graphics.ingame_fademode = graphics.fademode;
graphics.fademode = 0;
// Set this before we create the menu // Set this before we create the menu
game.kludge_ingametemp = game.currentmenuname; game.kludge_ingametemp = game.currentmenuname;