Use enums for music tracks

This adds an anonymous enum for music tracks and replaces all calls to
music.play and music.niceplay that use integer literals. Additionally,
this is also done for integer literals for cl.levmusic (except 0) and
music.currentsong where appropriate, but _not_ the music areamap because
that would not make it look very aesthetically pleasing in the code.

This is not a named enum (that can be used for strict typechecking)
because music track IDs are essentially part of the API of the game -
almost every custom level uses these numbers. This is just to make the
source code more readable without needing a comment to denote what
number is what track.
This commit is contained in:
Misa
2023-05-23 18:37:32 -07:00
parent e9eeaa4186
commit cdeca65be7
8 changed files with 83 additions and 57 deletions

View File

@@ -953,9 +953,9 @@ void mapclass::gotoroom(int rx, int ry)
}
//Final level for time trial
if (game.intimetrial)
if (game.intimetrial && game.roomx == 46 && game.roomy == 54)
{
if (game.roomx == 46 && game.roomy == 54) music.niceplay(15); //Final level remix
music.niceplay(Music_PREDESTINEDFATEREMIX);
}
}
#if !defined(NO_CUSTOM_LEVELS)