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

@@ -1762,7 +1762,7 @@ void entityclass::createentity(int xp, int yp, int t, int meta1, int meta2, int
entity.colour = 21;
entity.tile = 78; //default case
entity.animate = 1;
if (game.swngame == 1)
if (game.swngame == SWN_SUPERGRAVITRON)
{
//set colour based on current state
entity.colour = swncolour(game.swncolstate);