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

Move returning to lab to separate variables

Again, what I've done here is removed the over-reliance on Terry's State
Machine to return to the lab, and just moved it into separate variables
instead. This means that returning to the lab is ALMOST entirely
self-contained in MAPMODE, except there's a quick jaunt over to GAMEMODE
to run a script because you can only run scripts in GAMEMODE.
This commit is contained in:
Misa 2020-05-07 15:30:26 -07:00 committed by Ethan Lee
parent 17e7c6983b
commit fc2f269548
3 changed files with 19 additions and 0 deletions

View file

@ -372,6 +372,8 @@ void Game::init(void)
fadetomenu = false; fadetomenu = false;
fadetomenudelay = 0; fadetomenudelay = 0;
fadetolab = false;
fadetolabdelay = 0;
/* Terry's Patrons... */ /* Terry's Patrons... */
superpatrons.push_back("Anders Ekermo"); superpatrons.push_back("Anders Ekermo");

View file

@ -383,6 +383,8 @@ public:
void returntolab(); void returntolab();
bool fadetomenu; bool fadetomenu;
int fadetomenudelay; int fadetomenudelay;
bool fadetolab;
int fadetolabdelay;
}; };
extern Game game; extern Game game;

View file

@ -1825,6 +1825,19 @@ void mapinput()
} }
} }
if (game.fadetolab)
{
if (game.fadetolabdelay > 0)
{
game.fadetolabdelay--;
}
else
{
game.returntolab();
game.fadetolab = false;
}
}
if(graphics.menuoffset==0) if(graphics.menuoffset==0)
{ {
if (graphics.flipmode) if (graphics.flipmode)
@ -2001,6 +2014,8 @@ void mapinput()
game.swnmode = false; game.swnmode = false;
graphics.fademode = 2; graphics.fademode = 2;
music.fadeout(); music.fadeout();
game.fadetolab = true;
game.fadetolabdelay = 15;
} }
} }