mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-01-30 18:04:09 +03:00
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:
@@ -954,11 +954,11 @@ static void menuactionpress(void)
|
||||
{
|
||||
if (graphics.setflipmode)
|
||||
{
|
||||
music.play(9); // ecroF evitisoP
|
||||
music.play(Music_POSITIVEFORCEREVERSED);
|
||||
}
|
||||
else
|
||||
{
|
||||
music.play(2); // Positive Force
|
||||
music.play(Music_POSITIVEFORCE);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2045,7 +2045,7 @@ static void menuactionpress(void)
|
||||
case Menu::gameover2:
|
||||
//back
|
||||
music.playef(11);
|
||||
music.play(6);
|
||||
music.play(Music_PRESENTINGVVVVVV);
|
||||
game.returntomenu(Menu::playmodes);
|
||||
map.nexttowercolour();
|
||||
break;
|
||||
@@ -2109,7 +2109,7 @@ static void menuactionpress(void)
|
||||
case 0:
|
||||
//back
|
||||
music.playef(11);
|
||||
music.play(6);
|
||||
music.play(Music_PRESENTINGVVVVVV);
|
||||
game.returntomenu(Menu::timetrials);
|
||||
map.nexttowercolour();
|
||||
break;
|
||||
@@ -2122,7 +2122,7 @@ static void menuactionpress(void)
|
||||
break;
|
||||
case Menu::gamecompletecontinue:
|
||||
case Menu::nodeathmodecomplete2:
|
||||
music.play(6);
|
||||
music.play(Music_PRESENTINGVVVVVV);
|
||||
music.playef(11);
|
||||
game.returnmenu();
|
||||
map.nexttowercolour();
|
||||
@@ -2363,7 +2363,7 @@ void titleinput(void)
|
||||
if (!game.menustart)
|
||||
{
|
||||
game.menustart = true;
|
||||
music.play(6);
|
||||
music.play(Music_PRESENTINGVVVVVV);
|
||||
music.playef(18);
|
||||
game.screenshake = 10;
|
||||
game.flashlight = 5;
|
||||
@@ -2886,7 +2886,7 @@ void mapinput(void)
|
||||
else
|
||||
{
|
||||
game.quittomenu();
|
||||
music.play(6); //should be after game.quittomenu()
|
||||
music.play(Music_PRESENTINGVVVVVV); // should be after game.quittomenu()
|
||||
game.fadetomenu = false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user