mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2024-12-31 22:19:44 +01:00
Move fading to menu to separate variables
Alright, so what I've done here is made exiting to the menu entirely separate from Terry's State Machine, and thus it can now take place entirely within MAPMODE instead of having to go back to GAMEMODE. Also, it's faster by 15 frames since we don't need to wait for the map screen to go back down.
This commit is contained in:
parent
69aeac2410
commit
17e7c6983b
3 changed files with 20 additions and 0 deletions
|
@ -370,6 +370,9 @@ void Game::init(void)
|
|||
playry = 0;
|
||||
playgc = 0;
|
||||
|
||||
fadetomenu = false;
|
||||
fadetomenudelay = 0;
|
||||
|
||||
/* Terry's Patrons... */
|
||||
superpatrons.push_back("Anders Ekermo");
|
||||
superpatrons.push_back("Andreas K|mper");
|
||||
|
|
|
@ -381,6 +381,8 @@ public:
|
|||
|
||||
void quittomenu();
|
||||
void returntolab();
|
||||
bool fadetomenu;
|
||||
int fadetomenudelay;
|
||||
};
|
||||
|
||||
extern Game game;
|
||||
|
|
|
@ -1812,6 +1812,19 @@ void mapinput()
|
|||
game.press_action = false;
|
||||
game.press_map = false;
|
||||
|
||||
if (game.fadetomenu)
|
||||
{
|
||||
if (game.fadetomenudelay > 0)
|
||||
{
|
||||
game.fadetomenudelay--;
|
||||
}
|
||||
else
|
||||
{
|
||||
game.quittomenu();
|
||||
game.fadetomenu = false;
|
||||
}
|
||||
}
|
||||
|
||||
if(graphics.menuoffset==0)
|
||||
{
|
||||
if (graphics.flipmode)
|
||||
|
@ -1970,6 +1983,8 @@ void mapinput()
|
|||
graphics.fademode = 2;
|
||||
music.fadeout();
|
||||
map.nexttowercolour();
|
||||
game.fadetomenu = true;
|
||||
game.fadetomenudelay = 15;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue