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:
Misa
2023-06-04 23:24:31 -07:00
parent 414b0647aa
commit 14d034e4c6
8 changed files with 66 additions and 44 deletions

View File

@@ -117,6 +117,21 @@ enum SLIDERMODE
SLIDER_SOUNDVOLUME
};
/* enums for swngame variable */
enum SWNMODE
{
SWN_GRAVITRON,
SWN_SUPERGRAVITRON,
SWN_START_GRAVITRON_STEP_3,
SWN_START_GRAVITRON_STEP_2,
SWN_START_GRAVITRON_STEP_1,
SWN_FINISH_GRAVITRON_STEP_1,
SWN_START_SUPERGRAVITRON_STEP_1,
SWN_START_SUPERGRAVITRON_STEP_2,
SWN_FINISH_GRAVITRON_STEP_2,
SWN_NONE
};
struct MenuStackFrame
{
int option;
@@ -334,7 +349,8 @@ public:
//Sine Wave Ninja Minigame
bool swnmode;
int swngame, swnstate, swnstate2, swnstate3, swnstate4, swndelay, swndeaths;
enum SWNMODE swngame;
int swnstate, swnstate2, swnstate3, swnstate4, swndelay, swndeaths;
int swntimer, swncolstate, swncoldelay;
int swnrecord, swnbestrank, swnrank, swnmessage;