mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-01-30 01:48:15 +03:00
Use enums for swngame
This replaces the swngame int variable with a named enum and enforces strict typechecking on it. Strict typechecking is okay here as the swngame variable is not part of the API surface of the game in any way and is completely internal. And just to make things clear, I've added a SWN_NONE enum to use for initialization, because previously it was being initialized to 0, even though 0 was the Gravitron.
This commit is contained in:
@@ -2020,7 +2020,7 @@ void gamerender(void)
|
||||
if (graphics.fademode == FADE_NONE
|
||||
&& !game.intimetrial
|
||||
&& !game.isingamecompletescreen()
|
||||
&& (!game.swnmode || game.swngame != 1)
|
||||
&& (!game.swnmode || game.swngame != SWN_SUPERGRAVITRON)
|
||||
&& game.showingametimer
|
||||
&& !roomname_translator::enabled)
|
||||
{
|
||||
@@ -2129,12 +2129,12 @@ void gamerender(void)
|
||||
|
||||
if (game.swnmode)
|
||||
{
|
||||
if (game.swngame == 0)
|
||||
if (game.swngame == SWN_GRAVITRON)
|
||||
{
|
||||
std::string tempstring = help.timestring(game.swntimer);
|
||||
font::print(PR_2X | PR_CEN | PR_BOR, -1, 20, tempstring, 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2));
|
||||
}
|
||||
else if (game.swngame == 1)
|
||||
else if (game.swngame == SWN_SUPERGRAVITRON)
|
||||
{
|
||||
if (game.swnmessage == 0)
|
||||
{
|
||||
@@ -2210,7 +2210,7 @@ void gamerender(void)
|
||||
);
|
||||
font::print(PR_BOR | PR_CEN, -1, 228, buffer, 160 - (help.glow/2), 160 - (help.glow/2), 160 - (help.glow/2));
|
||||
}
|
||||
else if(game.swngame==2)
|
||||
else if (game.swngame == SWN_START_GRAVITRON_STEP_3)
|
||||
{
|
||||
if (int(game.swndelay / 15) % 2 == 1 || game.swndelay >= 120)
|
||||
{
|
||||
@@ -2230,7 +2230,7 @@ void gamerender(void)
|
||||
font::print(PR_2X | PR_CEN | PR_BOR, -1, y2, loc::gettext("60 seconds!"), 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2));
|
||||
}
|
||||
}
|
||||
else if(game.swngame==7)
|
||||
else if (game.swngame == SWN_START_SUPERGRAVITRON_STEP_2)
|
||||
{
|
||||
if (game.swndelay >= 60)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user