mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2024-12-23 01:59:43 +01:00
Pull out fade mode handling into separate function
The next commit will add logic that more-or-less quits the whole block if ingame_titlemode, and instead of adding another layer of indentation I will just pull this into its own function so we can use a return statement.
This commit is contained in:
parent
cc9c71a94a
commit
5ebc65d1a2
1 changed files with 14 additions and 9 deletions
|
@ -288,6 +288,19 @@ static void startmode(const int mode)
|
||||||
fadetomodedelay = 19;
|
fadetomodedelay = 19;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void handlefadetomode(void)
|
||||||
|
{
|
||||||
|
if (fadetomodedelay > 0)
|
||||||
|
{
|
||||||
|
--fadetomodedelay;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
fadetomode = false;
|
||||||
|
script.startgamemode(gotomode);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static int* user_changing_volume = NULL;
|
static int* user_changing_volume = NULL;
|
||||||
static int previous_volume = 0;
|
static int previous_volume = 0;
|
||||||
|
|
||||||
|
@ -1928,15 +1941,7 @@ void titleinput(void)
|
||||||
|
|
||||||
if (fadetomode)
|
if (fadetomode)
|
||||||
{
|
{
|
||||||
if (fadetomodedelay > 0)
|
handlefadetomode();
|
||||||
{
|
|
||||||
--fadetomodedelay;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
fadetomode = false;
|
|
||||||
script.startgamemode(gotomode);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue