1
0
Fork 0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-12-23 01:59:43 +01:00

Use enums for sound effects

This adds an anonymous enum for sound effects and replaces all calls to
music.playef that use integer literals.

This is not a named enum (that can be used for strict typechecking)
because sound effect IDs are essentially part of the API of the game -
many custom levels use these numbers. This is just to make the source
code more readable without needing a comment to denote what number is
what sound.
This commit is contained in:
Misa 2023-06-03 15:29:02 -07:00
parent cdeca65be7
commit 4058975ce9
8 changed files with 367 additions and 335 deletions

View file

@ -2402,20 +2402,20 @@ static void editormenuactionpress(void)
map.nexttowercolour(); map.nexttowercolour();
break; break;
} }
music.playef(11); music.playef(Sound_VIRIDIAN);
break; break;
case Menu::ed_settings: case Menu::ed_settings:
switch (game.currentmenuoption) switch (game.currentmenuoption)
{ {
case 0: case 0:
//Change level description stuff //Change level description stuff
music.playef(11); music.playef(Sound_VIRIDIAN);
game.createmenu(Menu::ed_desc); game.createmenu(Menu::ed_desc);
map.nexttowercolour(); map.nexttowercolour();
break; break;
case 1: case 1:
//Enter script editormode //Enter script editormode
music.playef(11); music.playef(Sound_VIRIDIAN);
ed.state = EditorState_SCRIPTS; ed.state = EditorState_SCRIPTS;
ed.substate = EditorSubState_MAIN; ed.substate = EditorSubState_MAIN;
@ -2431,13 +2431,13 @@ static void editormenuactionpress(void)
ed.lines_visible = 200 / font::height(PR_FONT_LEVEL); ed.lines_visible = 200 / font::height(PR_FONT_LEVEL);
break; break;
case 2: case 2:
music.playef(11); music.playef(Sound_VIRIDIAN);
game.createmenu(Menu::ed_music); game.createmenu(Menu::ed_music);
map.nexttowercolour(); map.nexttowercolour();
if(cl.levmusic>0) music.play(cl.levmusic); if(cl.levmusic>0) music.play(cl.levmusic);
break; break;
case 3: case 3:
music.playef(11); music.playef(Sound_VIRIDIAN);
game.ghostsenabled = !game.ghostsenabled; game.ghostsenabled = !game.ghostsenabled;
break; break;
case 4: case 4:
@ -2460,7 +2460,7 @@ static void editormenuactionpress(void)
break; break;
case 6: case 6:
/* Game options */ /* Game options */
music.playef(11); music.playef(Sound_VIRIDIAN);
game.gamestate = TITLEMODE; game.gamestate = TITLEMODE;
game.ingame_titlemode = true; game.ingame_titlemode = true;
game.ingame_editormode = true; game.ingame_editormode = true;
@ -2469,7 +2469,7 @@ static void editormenuactionpress(void)
DEFER_CALLBACK(nextbgcolor); DEFER_CALLBACK(nextbgcolor);
break; break;
default: default:
music.playef(11); music.playef(Sound_VIRIDIAN);
game.createmenu(Menu::ed_quit); game.createmenu(Menu::ed_quit);
map.nexttowercolour(); map.nexttowercolour();
break; break;
@ -2501,10 +2501,10 @@ static void editormenuactionpress(void)
music.haltdasmusik(); music.haltdasmusik();
} }
music.playef(11); music.playef(Sound_VIRIDIAN);
break; break;
case 2: case 2:
music.playef(11); music.playef(Sound_VIRIDIAN);
music.fadeout(); music.fadeout();
game.returnmenu(); game.returnmenu();
map.nexttowercolour(); map.nexttowercolour();
@ -2527,14 +2527,14 @@ static void editormenuactionpress(void)
break; break;
case 1: case 1:
//Quit without saving //Quit without saving
music.playef(11); music.playef(Sound_VIRIDIAN);
music.fadeout(); music.fadeout();
graphics.fademode = FADE_START_FADEOUT; graphics.fademode = FADE_START_FADEOUT;
graphics.backgrounddrawn = false; graphics.backgrounddrawn = false;
break; break;
case 2: case 2:
//Go back to editor //Go back to editor
music.playef(11); music.playef(Sound_VIRIDIAN);
game.returnmenu(); game.returnmenu();
map.nexttowercolour(); map.nexttowercolour();
break; break;
@ -2553,7 +2553,7 @@ static void editormenuactionpress(void)
loc::new_level_font = cl.level_font_name; loc::new_level_font = cl.level_font_name;
} }
font::set_level_font(cl.level_font_name.c_str()); font::set_level_font(cl.level_font_name.c_str());
music.playef(11); music.playef(Sound_VIRIDIAN);
game.returnmenu(); game.returnmenu();
map.nexttowercolour(); map.nexttowercolour();
game.savestatsandsettings_menu(); game.savestatsandsettings_menu();
@ -2931,7 +2931,7 @@ void editorinput(void)
if (escape_pressed) if (escape_pressed)
{ {
// We're just in draw mode, so go to the settings menu // We're just in draw mode, so go to the settings menu
music.playef(11); music.playef(Sound_VIRIDIAN);
ed.state = EditorState_MENU; ed.state = EditorState_MENU;
ed.substate = EditorSubState_MAIN; ed.substate = EditorSubState_MAIN;
game.createmenu(Menu::ed_settings); game.createmenu(Menu::ed_settings);
@ -3238,7 +3238,7 @@ void editorinput(void)
if (escape_pressed) if (escape_pressed)
{ {
bool esc_from_font = false; bool esc_from_font = false;
music.playef(11); music.playef(Sound_VIRIDIAN);
if (game.currentmenuname == Menu::ed_settings) if (game.currentmenuname == Menu::ed_settings)
{ {
@ -3288,7 +3288,7 @@ void editorinput(void)
key.disabletextentry(); key.disabletextentry();
ed.current_text_mode = TEXT_NONE; ed.current_text_mode = TEXT_NONE;
music.playef(11); music.playef(Sound_VIRIDIAN);
} }
if (enter_pressed) if (enter_pressed)
@ -3309,7 +3309,7 @@ void editorinput(void)
{ {
if (escape_pressed) if (escape_pressed)
{ {
music.playef(11); music.playef(Sound_VIRIDIAN);
ed.state = EditorState_MENU; ed.state = EditorState_MENU;
ed.substate = EditorSubState_MAIN; ed.substate = EditorSubState_MAIN;
} }
@ -3348,7 +3348,7 @@ void editorinput(void)
if (key.keymap[SDLK_BACKSPACE] && !ed.backspace_held && !script.customscripts.empty()) if (key.keymap[SDLK_BACKSPACE] && !ed.backspace_held && !script.customscripts.empty())
{ {
ed.backspace_held = true; ed.backspace_held = true;
music.playef(2); music.playef(Sound_CRY);
ed.remove_script(script.customscripts[(script.customscripts.size() - 1) - ed.selected_script].name); ed.remove_script(script.customscripts[(script.customscripts.size() - 1) - ed.selected_script].name);
} }
@ -3380,7 +3380,7 @@ void editorinput(void)
key.keybuffer = ed.script_buffer[ed.script_cursor_y]; key.keybuffer = ed.script_buffer[ed.script_cursor_y];
ed.script_cursor_x = UTF8_total_codepoints(ed.script_buffer[ed.script_cursor_y].c_str()); ed.script_cursor_x = UTF8_total_codepoints(ed.script_buffer[ed.script_cursor_y].c_str());
music.playef(11); music.playef(Sound_VIRIDIAN);
} }
} }
break; break;
@ -3390,7 +3390,7 @@ void editorinput(void)
// Script editor! // Script editor!
if (escape_pressed) if (escape_pressed)
{ {
music.playef(11); music.playef(Sound_VIRIDIAN);
ed.substate = EditorSubState_MAIN; ed.substate = EditorSubState_MAIN;
// Alright, now re-add the script. // Alright, now re-add the script.

View file

@ -2575,7 +2575,7 @@ bool entityclass::updateentities( int i )
entities[i].state = 2; entities[i].state = 2;
entities[i].onentity = 0; entities[i].onentity = 0;
music.playef(7); music.playef(Sound_DISAPPEAR);
} }
else if (entities[i].state == 2) else if (entities[i].state == 2)
{ {
@ -2621,7 +2621,7 @@ bool entityclass::updateentities( int i )
entities[i].life = 4; entities[i].life = 4;
entities[i].state = 2; entities[i].state = 2;
entities[i].onentity = 0; entities[i].onentity = 0;
music.playef(6); music.playef(Sound_CRUMBLE);
} }
else if (entities[i].state == 2) else if (entities[i].state == 2)
{ {
@ -2658,7 +2658,7 @@ bool entityclass::updateentities( int i )
//wait for collision //wait for collision
if (entities[i].state == 1) if (entities[i].state == 1)
{ {
music.playef(4); music.playef(Sound_COIN);
if (INBOUNDS_ARR(entities[i].para, collect)) if (INBOUNDS_ARR(entities[i].para, collect))
{ {
collect[(int) entities[i].para] = true; collect[(int) entities[i].para] = true;
@ -2678,13 +2678,13 @@ bool entityclass::updateentities( int i )
if (game.intimetrial) if (game.intimetrial)
{ {
music.playef(25); music.playef(Sound_NEWRECORD);
} }
else else
{ {
game.setstate(1000); game.setstate(1000);
if(music.currentsong!=-1) music.silencedasmusik(); if(music.currentsong!=-1) music.silencedasmusik();
music.playef(3); music.playef(Sound_TRINKET);
if (game.trinkets() > game.stat_trinkets && !map.custommode) if (game.trinkets() > game.stat_trinkets && !map.custommode)
{ {
game.stat_trinkets = game.trinkets(); game.stat_trinkets = game.trinkets();
@ -2711,7 +2711,7 @@ bool entityclass::updateentities( int i )
entities[i].colour = 5; entities[i].colour = 5;
entities[i].onentity = 0; entities[i].onentity = 0;
game.savepoint = entities[i].para; game.savepoint = entities[i].para;
music.playef(5); music.playef(Sound_CHECKPOINT);
game.savex = entities[i].xp - 4; game.savex = entities[i].xp - 4;
@ -2756,7 +2756,7 @@ bool entityclass::updateentities( int i )
entities[i].state = 2; entities[i].state = 2;
music.playef(8); music.playef(Sound_GRAVITYLINE);
game.gravitycontrol = (game.gravitycontrol + 1) % 2; game.gravitycontrol = (game.gravitycontrol + 1) % 2;
game.totalflips++; game.totalflips++;
int temp = getplayer(); int temp = getplayer();
@ -2798,7 +2798,7 @@ bool entityclass::updateentities( int i )
//Depending on the room the warp point is in, teleport to a new location! //Depending on the room the warp point is in, teleport to a new location!
entities[i].onentity = 0; entities[i].onentity = 0;
//play a sound or somefink //play a sound or somefink
music.playef(10); music.playef(Sound_TELEPORT);
game.teleport = true; game.teleport = true;
game.edteleportent = i; game.edteleportent = i;
@ -3150,7 +3150,7 @@ bool entityclass::updateentities( int i )
{ {
entities[i].colour = 5; entities[i].colour = 5;
entities[i].onentity = 0; entities[i].onentity = 0;
music.playef(17); music.playef(Sound_TERMINALTOUCH);
entities[i].state = 0; entities[i].state = 0;
} }
@ -3327,14 +3327,14 @@ bool entityclass::updateentities( int i )
if (game.intimetrial) if (game.intimetrial)
{ {
music.playef(27); music.playef(Sound_RESCUE);
} }
else else
{ {
game.setstate(1010); game.setstate(1010);
//music.haltdasmusik(); //music.haltdasmusik();
if(music.currentsong!=-1) music.silencedasmusik(); if(music.currentsong!=-1) music.silencedasmusik();
music.playef(27); music.playef(Sound_RESCUE);
} }
return disableentity(i); return disableentity(i);
@ -3346,7 +3346,7 @@ bool entityclass::updateentities( int i )
//if inactive, activate! //if inactive, activate!
if (entities[i].tile == 1) if (entities[i].tile == 1)
{ {
music.playef(18); music.playef(Sound_GAMESAVED);
entities[i].tile = 2; entities[i].tile = 2;
entities[i].colour = 101; entities[i].colour = 101;
if(!game.intimetrial && !game.nodeathmode) if(!game.intimetrial && !game.nodeathmode)
@ -4841,7 +4841,7 @@ void entityclass::collisioncheck(int i, int j, bool scm /*= false*/)
{ {
if (entityhlinecollide(i, j)) if (entityhlinecollide(i, j))
{ {
music.playef(8); music.playef(Sound_GRAVITYLINE);
game.gravitycontrol = (game.gravitycontrol + 1) % 2; game.gravitycontrol = (game.gravitycontrol + 1) % 2;
game.totalflips++; game.totalflips++;
if (game.gravitycontrol == 0) if (game.gravitycontrol == 0)

View file

@ -1110,7 +1110,7 @@ void Game::updatestate(void)
if(INBOUNDS_VEC(i, obj.entities) && obj.entities[i].tile == 0) if(INBOUNDS_VEC(i, obj.entities) && obj.entities[i].tile == 0)
{ {
obj.entities[i].tile = 144; obj.entities[i].tile = 144;
music.playef(2); music.playef(Sound_CRY);
} }
setstate(0); setstate(0);
break; break;
@ -1509,7 +1509,7 @@ void Game::updatestate(void)
break; break;
case 50: case 50:
music.playef(15); music.playef(Sound_VIOLET);
graphics.createtextbox(loc::gettext("Help! Can anyone hear this message?"), 5, 8, TEXT_COLOUR("purple")); graphics.createtextbox(loc::gettext("Help! Can anyone hear this message?"), 5, 8, TEXT_COLOUR("purple"));
graphics.textboxcommsrelay(); graphics.textboxcommsrelay();
graphics.textboxtimer(60); graphics.textboxtimer(60);
@ -1517,7 +1517,7 @@ void Game::updatestate(void)
setstatedelay(100); setstatedelay(100);
break; break;
case 51: case 51:
music.playef(15); music.playef(Sound_VIOLET);
graphics.createtextbox(loc::gettext("Verdigris? Are you out there? Are you ok?"), 5, 8, TEXT_COLOUR("purple")); graphics.createtextbox(loc::gettext("Verdigris? Are you out there? Are you ok?"), 5, 8, TEXT_COLOUR("purple"));
graphics.textboxcommsrelay(); graphics.textboxcommsrelay();
graphics.textboxtimer(60); graphics.textboxtimer(60);
@ -1525,7 +1525,7 @@ void Game::updatestate(void)
setstatedelay(100); setstatedelay(100);
break; break;
case 52: case 52:
music.playef(15); music.playef(Sound_VIOLET);
graphics.createtextbox(loc::gettext("Please help us! We've crashed and need assistance!"), 5, 8, TEXT_COLOUR("purple")); graphics.createtextbox(loc::gettext("Please help us! We've crashed and need assistance!"), 5, 8, TEXT_COLOUR("purple"));
graphics.textboxcommsrelay(); graphics.textboxcommsrelay();
graphics.textboxtimer(60); graphics.textboxtimer(60);
@ -1533,7 +1533,7 @@ void Game::updatestate(void)
setstatedelay(100); setstatedelay(100);
break; break;
case 53: case 53:
music.playef(15); music.playef(Sound_VIOLET);
graphics.createtextbox(loc::gettext("Hello? Anyone out there?"), 5, 8, TEXT_COLOUR("purple")); graphics.createtextbox(loc::gettext("Hello? Anyone out there?"), 5, 8, TEXT_COLOUR("purple"));
graphics.textboxcommsrelay(); graphics.textboxcommsrelay();
graphics.textboxtimer(60); graphics.textboxtimer(60);
@ -1541,7 +1541,7 @@ void Game::updatestate(void)
setstatedelay(100); setstatedelay(100);
break; break;
case 54: case 54:
music.playef(15); music.playef(Sound_VIOLET);
graphics.createtextbox(loc::gettext("This is Doctor Violet from the D.S.S. Souleye! Please respond!"), 5, 8, TEXT_COLOUR("purple")); graphics.createtextbox(loc::gettext("This is Doctor Violet from the D.S.S. Souleye! Please respond!"), 5, 8, TEXT_COLOUR("purple"));
graphics.textboxcommsrelay(); graphics.textboxcommsrelay();
graphics.textboxtimer(60); graphics.textboxtimer(60);
@ -1549,7 +1549,7 @@ void Game::updatestate(void)
setstatedelay(100); setstatedelay(100);
break; break;
case 55: case 55:
music.playef(15); music.playef(Sound_VIOLET);
graphics.createtextbox(loc::gettext("Please... Anyone..."), 5, 8, TEXT_COLOUR("purple")); graphics.createtextbox(loc::gettext("Please... Anyone..."), 5, 8, TEXT_COLOUR("purple"));
graphics.textboxcommsrelay(); graphics.textboxcommsrelay();
graphics.textboxtimer(60); graphics.textboxtimer(60);
@ -1557,7 +1557,7 @@ void Game::updatestate(void)
setstatedelay(100); setstatedelay(100);
break; break;
case 56: case 56:
music.playef(15); music.playef(Sound_VIOLET);
graphics.createtextbox(loc::gettext("Please be alright, everyone..."), 5, 8, TEXT_COLOUR("purple")); graphics.createtextbox(loc::gettext("Please be alright, everyone..."), 5, 8, TEXT_COLOUR("purple"));
graphics.textboxcommsrelay(); graphics.textboxcommsrelay();
graphics.textboxtimer(60); graphics.textboxtimer(60);
@ -1668,7 +1668,7 @@ void Game::updatestate(void)
obj.removetrigger(85); obj.removetrigger(85);
//Init final stretch //Init final stretch
incstate(); incstate();
music.playef(9); music.playef(Sound_FLASH);
music.play(Music_POSITIVEFORCE); music.play(Music_POSITIVEFORCE);
obj.flags[72] = true; obj.flags[72] = true;
@ -1761,7 +1761,7 @@ void Game::updatestate(void)
if (INBOUNDS_VEC(i, obj.entities) && obj.entities[i].onroof > 0 && gravitycontrol == 1) if (INBOUNDS_VEC(i, obj.entities) && obj.entities[i].onroof > 0 && gravitycontrol == 1)
{ {
gravitycontrol = 0; gravitycontrol = 0;
music.playef(1); music.playef(Sound_UNFLIP);
} }
if (INBOUNDS_VEC(i, obj.entities) && obj.entities[i].onground > 0) if (INBOUNDS_VEC(i, obj.entities) && obj.entities[i].onground > 0)
{ {
@ -1787,14 +1787,14 @@ void Game::updatestate(void)
graphics.createtextbox("Captain! I've been so worried!", 60, 90, 164, 255, 164); graphics.createtextbox("Captain! I've been so worried!", 60, 90, 164, 255, 164);
graphics.textboxprintflags(PR_FONT_8X8); graphics.textboxprintflags(PR_FONT_8X8);
incstate(); incstate();
music.playef(12); music.playef(Sound_VERDIGRIS);
} }
break; break;
case 104: case 104:
graphics.createtextbox("I'm glad you're ok!", 135, 152, TEXT_COLOUR("cyan")); graphics.createtextbox("I'm glad you're ok!", 135, 152, TEXT_COLOUR("cyan"));
graphics.textboxprintflags(PR_FONT_8X8); graphics.textboxprintflags(PR_FONT_8X8);
incstate(); incstate();
music.playef(11); music.playef(Sound_VIRIDIAN);
graphics.textboxactive(); graphics.textboxactive();
break; break;
case 106: case 106:
@ -1804,7 +1804,7 @@ void Game::updatestate(void)
graphics.addline("around in circles..."); graphics.addline("around in circles...");
graphics.textboxprintflags(PR_FONT_8X8); graphics.textboxprintflags(PR_FONT_8X8);
incstate(); incstate();
music.playef(2); music.playef(Sound_CRY);
graphics.textboxactive(); graphics.textboxactive();
int i = obj.getcompanion(); int i = obj.getcompanion();
if (INBOUNDS_VEC(i, obj.entities)) if (INBOUNDS_VEC(i, obj.entities))
@ -1819,7 +1819,7 @@ void Game::updatestate(void)
graphics.addline("teleporter key!"); graphics.addline("teleporter key!");
graphics.textboxprintflags(PR_FONT_8X8); graphics.textboxprintflags(PR_FONT_8X8);
incstate(); incstate();
music.playef(11); music.playef(Sound_VIRIDIAN);
graphics.textboxactive(); graphics.textboxactive();
break; break;
case 110: case 110:
@ -1834,7 +1834,7 @@ void Game::updatestate(void)
graphics.createtextbox("Follow me!", 185, 154, TEXT_COLOUR("cyan")); graphics.createtextbox("Follow me!", 185, 154, TEXT_COLOUR("cyan"));
graphics.textboxprintflags(PR_FONT_8X8); graphics.textboxprintflags(PR_FONT_8X8);
incstate(); incstate();
music.playef(11); music.playef(Sound_VIRIDIAN);
graphics.textboxactive(); graphics.textboxactive();
} }
@ -1891,7 +1891,7 @@ void Game::updatestate(void)
if (INBOUNDS_VEC(i, obj.entities) && obj.entities[i].onground > 0 && gravitycontrol == 0) if (INBOUNDS_VEC(i, obj.entities) && obj.entities[i].onground > 0 && gravitycontrol == 0)
{ {
gravitycontrol = 1; gravitycontrol = 1;
music.playef(1); music.playef(Sound_UNFLIP);
} }
if (INBOUNDS_VEC(i, obj.entities) && obj.entities[i].onroof > 0) if (INBOUNDS_VEC(i, obj.entities) && obj.entities[i].onroof > 0)
{ {
@ -1916,7 +1916,7 @@ void Game::updatestate(void)
graphics.createtextbox("Captain! You're ok!", 60-10, 90-40, TEXT_COLOUR("yellow")); graphics.createtextbox("Captain! You're ok!", 60-10, 90-40, TEXT_COLOUR("yellow"));
graphics.textboxprintflags(PR_FONT_8X8); graphics.textboxprintflags(PR_FONT_8X8);
incstate(); incstate();
music.playef(14); music.playef(Sound_VITELLARY);
break; break;
} }
case 124: case 124:
@ -1925,7 +1925,7 @@ void Game::updatestate(void)
graphics.addline("I can't get it to go anywhere..."); graphics.addline("I can't get it to go anywhere...");
graphics.textboxprintflags(PR_FONT_8X8); graphics.textboxprintflags(PR_FONT_8X8);
incstate(); incstate();
music.playef(2); music.playef(Sound_CRY);
graphics.textboxactive(); graphics.textboxactive();
break; break;
} }
@ -1933,7 +1933,7 @@ void Game::updatestate(void)
graphics.createtextbox("I can help with that!", 125, 152-40, TEXT_COLOUR("cyan")); graphics.createtextbox("I can help with that!", 125, 152-40, TEXT_COLOUR("cyan"));
graphics.textboxprintflags(PR_FONT_8X8); graphics.textboxprintflags(PR_FONT_8X8);
incstate(); incstate();
music.playef(11); music.playef(Sound_VIRIDIAN);
graphics.textboxactive(); graphics.textboxactive();
break; break;
case 128: case 128:
@ -1941,7 +1941,7 @@ void Game::updatestate(void)
graphics.addline("codex for our ship!"); graphics.addline("codex for our ship!");
graphics.textboxprintflags(PR_FONT_8X8); graphics.textboxprintflags(PR_FONT_8X8);
incstate(); incstate();
music.playef(11); music.playef(Sound_VIRIDIAN);
graphics.textboxactive(); graphics.textboxactive();
break; break;
@ -1950,7 +1950,7 @@ void Game::updatestate(void)
graphics.createtextbox("Yey! Let's go home!", 60-30, 90-35, TEXT_COLOUR("yellow")); graphics.createtextbox("Yey! Let's go home!", 60-30, 90-35, TEXT_COLOUR("yellow"));
graphics.textboxprintflags(PR_FONT_8X8); graphics.textboxprintflags(PR_FONT_8X8);
incstate(); incstate();
music.playef(14); music.playef(Sound_VITELLARY);
graphics.textboxactive(); graphics.textboxactive();
int i = obj.getcompanion(); int i = obj.getcompanion();
if (INBOUNDS_VEC(i, obj.entities)) if (INBOUNDS_VEC(i, obj.entities))
@ -1971,7 +1971,7 @@ void Game::updatestate(void)
case 200: case 200:
//Init final stretch //Init final stretch
incstate(); incstate();
music.playef(9); music.playef(Sound_FLASH);
obj.flags[72] = true; obj.flags[72] = true;
screenshake = 10; screenshake = 10;
@ -2229,7 +2229,7 @@ void Game::updatestate(void)
setstatedelay(15); setstatedelay(15);
flashlight = 5; flashlight = 5;
screenshake = 90; screenshake = 90;
music.playef(9); music.playef(Sound_FLASH);
break; break;
case 2501: case 2501:
//Activating a teleporter 2 //Activating a teleporter 2
@ -2238,7 +2238,7 @@ void Game::updatestate(void)
flashlight = 5; flashlight = 5;
screenshake = 0; screenshake = 0;
//we're done here! //we're done here!
music.playef(10); music.playef(Sound_TELEPORT);
break; break;
case 2502: case 2502:
{ {
@ -2346,7 +2346,7 @@ void Game::updatestate(void)
graphics.createtextbox("Hello?", 125+24, 152-20, TEXT_COLOUR("cyan")); graphics.createtextbox("Hello?", 125+24, 152-20, TEXT_COLOUR("cyan"));
graphics.textboxprintflags(PR_FONT_8X8); graphics.textboxprintflags(PR_FONT_8X8);
incstate(); incstate();
music.playef(11); music.playef(Sound_VIRIDIAN);
graphics.textboxactive(); graphics.textboxactive();
break; break;
case 2512: case 2512:
@ -2355,7 +2355,7 @@ void Game::updatestate(void)
graphics.createtextbox("Is anyone there?", 125+8, 152-24, TEXT_COLOUR("cyan")); graphics.createtextbox("Is anyone there?", 125+8, 152-24, TEXT_COLOUR("cyan"));
graphics.textboxprintflags(PR_FONT_8X8); graphics.textboxprintflags(PR_FONT_8X8);
incstate(); incstate();
music.playef(11); music.playef(Sound_VIRIDIAN);
graphics.textboxactive(); graphics.textboxactive();
break; break;
case 2514: case 2514:
@ -2374,28 +2374,28 @@ void Game::updatestate(void)
setstatedelay(30); setstatedelay(30);
flashlight = 5; flashlight = 5;
screenshake = 90; screenshake = 90;
music.playef(9); music.playef(Sound_FLASH);
break; break;
case 3001: case 3001:
//Activating a teleporter 2 //Activating a teleporter 2
incstate(); incstate();
setstatedelay(15); setstatedelay(15);
flashlight = 5; flashlight = 5;
music.playef(9); music.playef(Sound_FLASH);
break; break;
case 3002: case 3002:
//Activating a teleporter 2 //Activating a teleporter 2
incstate(); incstate();
setstatedelay(15); setstatedelay(15);
flashlight = 5; flashlight = 5;
music.playef(9); music.playef(Sound_FLASH);
break; break;
case 3003: case 3003:
//Activating a teleporter 2 //Activating a teleporter 2
incstate(); incstate();
setstatedelay(15); setstatedelay(15);
flashlight = 5; flashlight = 5;
music.playef(9); music.playef(Sound_FLASH);
break; break;
case 3004: case 3004:
//Activating a teleporter 2 //Activating a teleporter 2
@ -2404,7 +2404,7 @@ void Game::updatestate(void)
flashlight = 5; flashlight = 5;
screenshake = 0; screenshake = 0;
//we're done here! //we're done here!
music.playef(10); music.playef(Sound_TELEPORT);
break; break;
case 3005: case 3005:
{ {
@ -3058,7 +3058,7 @@ void Game::updatestate(void)
setstatedelay(30); setstatedelay(30);
flashlight = 5; flashlight = 5;
screenshake = 90; screenshake = 90;
music.playef(9); music.playef(Sound_FLASH);
break; break;
} }
case 3512: case 3512:
@ -3066,21 +3066,21 @@ void Game::updatestate(void)
incstate(); incstate();
setstatedelay(15); setstatedelay(15);
flashlight = 5; flashlight = 5;
music.playef(9); music.playef(Sound_FLASH);
break; break;
case 3513: case 3513:
//Activating a teleporter 2 //Activating a teleporter 2
incstate(); incstate();
setstatedelay(15); setstatedelay(15);
flashlight = 5; flashlight = 5;
music.playef(9); music.playef(Sound_FLASH);
break; break;
case 3514: case 3514:
//Activating a teleporter 2 //Activating a teleporter 2
incstate(); incstate();
setstatedelay(15); setstatedelay(15);
flashlight = 5; flashlight = 5;
music.playef(9); music.playef(Sound_FLASH);
break; break;
case 3515: case 3515:
{ {
@ -3098,7 +3098,7 @@ void Game::updatestate(void)
} }
//we're done here! //we're done here!
music.playef(10); music.playef(Sound_TELEPORT);
setstatedelay(60); setstatedelay(60);
break; break;
} }
@ -3158,7 +3158,7 @@ void Game::updatestate(void)
statedelay = 10; statedelay = 10;
flashlight = 5; flashlight = 5;
screenshake = 10; screenshake = 10;
music.playef(9); music.playef(Sound_FLASH);
break; break;
case 4001: case 4001:
//Activating a teleporter 2 //Activating a teleporter 2
@ -3167,7 +3167,7 @@ void Game::updatestate(void)
flashlight = 5; flashlight = 5;
screenshake = 0; screenshake = 0;
//we're done here! //we're done here!
music.playef(10); music.playef(Sound_TELEPORT);
break; break;
case 4002: case 4002:
{ {
@ -3203,7 +3203,7 @@ void Game::updatestate(void)
setstatedelay(15); setstatedelay(15);
flashlight = 5; flashlight = 5;
screenshake = 90; screenshake = 90;
music.playef(9); music.playef(Sound_FLASH);
break; break;
case 4011: case 4011:
//Activating a teleporter 2 //Activating a teleporter 2
@ -3211,7 +3211,7 @@ void Game::updatestate(void)
setstatedelay(0); setstatedelay(0);
flashlight = 5; flashlight = 5;
screenshake = 0; screenshake = 0;
music.playef(10); music.playef(Sound_TELEPORT);
break; break;
case 4012: case 4012:
{ {
@ -3334,7 +3334,7 @@ void Game::updatestate(void)
setstatedelay(15); setstatedelay(15);
flashlight = 5; flashlight = 5;
screenshake = 90; screenshake = 90;
music.playef(9); music.playef(Sound_FLASH);
break; break;
case 4021: case 4021:
//Activating a teleporter 2 //Activating a teleporter 2
@ -3342,7 +3342,7 @@ void Game::updatestate(void)
setstatedelay(0); setstatedelay(0);
flashlight = 5; flashlight = 5;
screenshake = 0; screenshake = 0;
music.playef(10); music.playef(Sound_TELEPORT);
break; break;
case 4022: case 4022:
{ {
@ -3447,7 +3447,7 @@ void Game::updatestate(void)
setstatedelay(15); setstatedelay(15);
flashlight = 5; flashlight = 5;
screenshake = 90; screenshake = 90;
music.playef(9); music.playef(Sound_FLASH);
break; break;
case 4031: case 4031:
//Activating a teleporter 2 //Activating a teleporter 2
@ -3455,7 +3455,7 @@ void Game::updatestate(void)
setstatedelay(0); setstatedelay(0);
flashlight = 5; flashlight = 5;
screenshake = 0; screenshake = 0;
music.playef(10); music.playef(Sound_TELEPORT);
break; break;
case 4032: case 4032:
{ {
@ -3560,7 +3560,7 @@ void Game::updatestate(void)
setstatedelay(15); setstatedelay(15);
flashlight = 5; flashlight = 5;
screenshake = 90; screenshake = 90;
music.playef(9); music.playef(Sound_FLASH);
break; break;
case 4041: case 4041:
//Activating a teleporter 2 //Activating a teleporter 2
@ -3568,7 +3568,7 @@ void Game::updatestate(void)
setstatedelay(0); setstatedelay(0);
flashlight = 5; flashlight = 5;
screenshake = 0; screenshake = 0;
music.playef(10); music.playef(Sound_TELEPORT);
break; break;
case 4042: case 4042:
{ {
@ -3678,7 +3678,7 @@ void Game::updatestate(void)
setstatedelay(15); setstatedelay(15);
flashlight = 5; flashlight = 5;
screenshake = 90; screenshake = 90;
music.playef(9); music.playef(Sound_FLASH);
break; break;
case 4051: case 4051:
//Activating a teleporter 2 //Activating a teleporter 2
@ -3686,7 +3686,7 @@ void Game::updatestate(void)
setstatedelay(0); setstatedelay(0);
flashlight = 5; flashlight = 5;
screenshake = 0; screenshake = 0;
music.playef(10); music.playef(Sound_TELEPORT);
break; break;
case 4052: case 4052:
{ {
@ -3796,7 +3796,7 @@ void Game::updatestate(void)
setstatedelay(15); setstatedelay(15);
flashlight = 5; flashlight = 5;
screenshake = 90; screenshake = 90;
music.playef(9); music.playef(Sound_FLASH);
break; break;
case 4061: case 4061:
//Activating a teleporter 2 //Activating a teleporter 2
@ -3804,7 +3804,7 @@ void Game::updatestate(void)
setstatedelay(0); setstatedelay(0);
flashlight = 5; flashlight = 5;
screenshake = 0; screenshake = 0;
music.playef(10); music.playef(Sound_TELEPORT);
break; break;
case 4062: case 4062:
{ {
@ -3912,7 +3912,7 @@ void Game::updatestate(void)
setstatedelay(15); setstatedelay(15);
flashlight = 5; flashlight = 5;
screenshake = 90; screenshake = 90;
music.playef(9); music.playef(Sound_FLASH);
break; break;
case 4071: case 4071:
//Activating a teleporter 2 //Activating a teleporter 2
@ -3920,7 +3920,7 @@ void Game::updatestate(void)
setstatedelay(0); setstatedelay(0);
flashlight = 5; flashlight = 5;
screenshake = 0; screenshake = 0;
music.playef(10); music.playef(Sound_TELEPORT);
break; break;
case 4072: case 4072:
{ {
@ -4025,7 +4025,7 @@ void Game::updatestate(void)
setstatedelay(15); setstatedelay(15);
flashlight = 5; flashlight = 5;
screenshake = 90; screenshake = 90;
music.playef(9); music.playef(Sound_FLASH);
break; break;
case 4081: case 4081:
//Activating a teleporter 2 //Activating a teleporter 2
@ -4033,7 +4033,7 @@ void Game::updatestate(void)
setstatedelay(0); setstatedelay(0);
flashlight = 5; flashlight = 5;
screenshake = 0; screenshake = 0;
music.playef(10); music.playef(Sound_TELEPORT);
break; break;
case 4082: case 4082:
{ {
@ -4138,7 +4138,7 @@ void Game::updatestate(void)
setstatedelay(15); setstatedelay(15);
flashlight = 5; flashlight = 5;
screenshake = 90; screenshake = 90;
music.playef(9); music.playef(Sound_FLASH);
break; break;
case 4091: case 4091:
//Activating a teleporter 2 //Activating a teleporter 2
@ -4146,7 +4146,7 @@ void Game::updatestate(void)
setstatedelay(0); setstatedelay(0);
flashlight = 5; flashlight = 5;
screenshake = 0; screenshake = 0;
music.playef(10); music.playef(Sound_TELEPORT);
break; break;
case 4092: case 4092:
{ {
@ -5040,7 +5040,7 @@ void Game::deathsequence(void)
music.nicefade = false; music.nicefade = false;
} }
deathcounts++; deathcounts++;
music.playef(2); music.playef(Sound_CRY);
if (INBOUNDS_VEC(i, obj.entities) && !noflashingmode) if (INBOUNDS_VEC(i, obj.entities) && !noflashingmode)
{ {
obj.entities[i].invis = true; obj.entities[i].invis = true;

File diff suppressed because it is too large Load diff

View file

@ -172,7 +172,7 @@ void KeyPoll::Poll(void)
{ {
/* Reload language files */ /* Reload language files */
loc::loadtext(false); loc::loadtext(false);
music.playef(4); music.playef(Sound_COIN);
} }
BUTTONGLYPHS_keyboard_set_active(true); BUTTONGLYPHS_keyboard_set_active(true);

View file

@ -31,11 +31,11 @@ void titlelogic(void)
} }
else if (game.menudest == Menu::gameover2) else if (game.menudest == Menu::gameover2)
{ {
music.playef(11); music.playef(Sound_VIRIDIAN);
} }
else if (game.menudest == Menu::timetrialcomplete3) else if (game.menudest == Menu::timetrialcomplete3)
{ {
music.playef(3); music.playef(Sound_TRINKET);
} }
game.createmenu(game.menudest, true); game.createmenu(game.menudest, true);
} }
@ -187,7 +187,7 @@ void gamelogic(void)
game.alarmdelay--; game.alarmdelay--;
if (game.alarmdelay <= 0) if (game.alarmdelay <= 0)
{ {
music.playef(19); music.playef(Sound_ALARM);
game.alarmdelay = 20; game.alarmdelay = 20;
} }
} }
@ -204,7 +204,7 @@ void gamelogic(void)
{ {
obj.entities[i].tile = 144; obj.entities[i].tile = 144;
} }
music.playef(2); music.playef(Sound_CRY);
} }
if (obj.upset > 301) obj.upset = 301; if (obj.upset > 301) obj.upset = 301;
} }
@ -446,7 +446,7 @@ void gamelogic(void)
game.swnrecord = game.swntimer; game.swnrecord = game.swntimer;
if (game.swnmessage == 0) if (game.swnmessage == 0)
{ {
music.playef(25); music.playef(Sound_NEWRECORD);
game.savestatsandsettings(); game.savestatsandsettings();
} }
game.swnmessage = 1; game.swnmessage = 1;
@ -589,7 +589,7 @@ void gamelogic(void)
game.unlockAchievement("vvvvvvsupgrav5"); game.unlockAchievement("vvvvvvsupgrav5");
game.swnbestrank = 1; game.swnbestrank = 1;
game.swnmessage = 2+30; game.swnmessage = 2+30;
music.playef(26); music.playef(Sound_TROPHY);
} }
} }
else if (game.swntimer >= 300 && game.swnrank == 1) else if (game.swntimer >= 300 && game.swnrank == 1)
@ -600,7 +600,7 @@ void gamelogic(void)
game.unlockAchievement("vvvvvvsupgrav10"); game.unlockAchievement("vvvvvvsupgrav10");
game.swnbestrank = 2; game.swnbestrank = 2;
game.swnmessage = 2+30; game.swnmessage = 2+30;
music.playef(26); music.playef(Sound_TROPHY);
} }
} }
else if (game.swntimer >= 450 && game.swnrank == 2) else if (game.swntimer >= 450 && game.swnrank == 2)
@ -611,7 +611,7 @@ void gamelogic(void)
game.unlockAchievement("vvvvvvsupgrav15"); game.unlockAchievement("vvvvvvsupgrav15");
game.swnbestrank = 3; game.swnbestrank = 3;
game.swnmessage = 2+30; game.swnmessage = 2+30;
music.playef(26); music.playef(Sound_TROPHY);
} }
} }
else if (game.swntimer >= 600 && game.swnrank == 3) else if (game.swntimer >= 600 && game.swnrank == 3)
@ -622,7 +622,7 @@ void gamelogic(void)
game.unlockAchievement("vvvvvvsupgrav20"); game.unlockAchievement("vvvvvvsupgrav20");
game.swnbestrank = 4; game.swnbestrank = 4;
game.swnmessage = 2+30; game.swnmessage = 2+30;
music.playef(26); music.playef(Sound_TROPHY);
} }
} }
else if (game.swntimer >= 900 && game.swnrank == 4) else if (game.swntimer >= 900 && game.swnrank == 4)
@ -633,7 +633,7 @@ void gamelogic(void)
game.unlockAchievement("vvvvvvsupgrav30"); game.unlockAchievement("vvvvvvsupgrav30");
game.swnbestrank = 5; game.swnbestrank = 5;
game.swnmessage = 2+30; game.swnmessage = 2+30;
music.playef(26); music.playef(Sound_TROPHY);
} }
} }
else if (game.swntimer >= 1800 && game.swnrank == 5) else if (game.swntimer >= 1800 && game.swnrank == 5)
@ -644,7 +644,7 @@ void gamelogic(void)
game.unlockAchievement("vvvvvvsupgrav60"); game.unlockAchievement("vvvvvvsupgrav60");
game.swnbestrank = 6; game.swnbestrank = 6;
game.swnmessage = 2+30; game.swnmessage = 2+30;
music.playef(26); music.playef(Sound_TROPHY);
} }
} }
} }
@ -753,9 +753,9 @@ void gamelogic(void)
{ {
game.hascontrol = false; game.hascontrol = false;
} }
if(game.timetrialcountdown == 120) music.playef(21); if(game.timetrialcountdown == 120) music.playef(Sound_COUNTDOWN);
if(game.timetrialcountdown == 90) music.playef(21); if(game.timetrialcountdown == 90) music.playef(Sound_COUNTDOWN);
if(game.timetrialcountdown == 60) music.playef(21); if(game.timetrialcountdown == 60) music.playef(Sound_COUNTDOWN);
if (game.timetrialcountdown == 30) if (game.timetrialcountdown == 30)
{ {
switch(game.timetriallevel) switch(game.timetriallevel)
@ -779,7 +779,7 @@ void gamelogic(void)
music.play(Music_PREDESTINEDFATEREMIX); music.play(Music_PREDESTINEDFATEREMIX);
break; break;
} }
music.playef(22); music.playef(Sound_GO);
} }
} }
@ -794,7 +794,7 @@ void gamelogic(void)
{ {
obj.entities[i].tile = 144; obj.entities[i].tile = 144;
} }
music.playef(2); music.playef(Sound_CRY);
} }
} }
} }

View file

@ -31,6 +31,38 @@ enum
Music_PREDESTINEDFATEREMIX = 15 Music_PREDESTINEDFATEREMIX = 15
}; };
enum
{
Sound_FLIP = 0,
Sound_UNFLIP = 1,
Sound_CRY = 2,
Sound_TRINKET = 3,
Sound_COIN = 4,
Sound_CHECKPOINT = 5,
Sound_CRUMBLE = 6,
Sound_DISAPPEAR = 7,
Sound_GRAVITYLINE = 8,
Sound_FLASH = 9,
Sound_TELEPORT = 10,
Sound_VIRIDIAN = 11,
Sound_VERDIGRIS = 12,
Sound_VICTORIA = 13,
Sound_VITELLARY = 14,
Sound_VIOLET = 15,
Sound_VERMILION = 16,
Sound_TERMINALTOUCH = 17,
Sound_GAMESAVED = 18,
Sound_ALARM = 19,
Sound_TERMINALTEXT = 20,
Sound_COUNTDOWN = 21,
Sound_GO = 22,
Sound_DESTROY = 23,
Sound_COMBINE = 24,
Sound_NEWRECORD = 25,
Sound_TROPHY = 26,
Sound_RESCUE = 27
};
class musicclass class musicclass
{ {
public: public:

View file

@ -1095,39 +1095,39 @@ void scriptclass::run(void)
{ {
if (words[1] == "player") if (words[1] == "player")
{ {
music.playef(11); music.playef(Sound_VIRIDIAN);
} }
else if (words[1] == "cyan") else if (words[1] == "cyan")
{ {
music.playef(11); music.playef(Sound_VIRIDIAN);
} }
else if (words[1] == "red") else if (words[1] == "red")
{ {
music.playef(16); music.playef(Sound_VERMILION);
} }
else if (words[1] == "green") else if (words[1] == "green")
{ {
music.playef(12); music.playef(Sound_VERDIGRIS);
} }
else if (words[1] == "yellow") else if (words[1] == "yellow")
{ {
music.playef(14); music.playef(Sound_VITELLARY);
} }
else if (words[1] == "blue") else if (words[1] == "blue")
{ {
music.playef(13); music.playef(Sound_VICTORIA);
} }
else if (words[1] == "purple") else if (words[1] == "purple")
{ {
music.playef(15); music.playef(Sound_VIOLET);
} }
else if (words[1] == "cry") else if (words[1] == "cry")
{ {
music.playef(2); music.playef(Sound_CRY);
} }
else if (words[1] == "terminal") else if (words[1] == "terminal")
{ {
music.playef(20); music.playef(Sound_TERMINALTEXT);
} }
} }
else if (words[0] == "blackout") else if (words[0] == "blackout")
@ -1749,7 +1749,7 @@ void scriptclass::run(void)
else if (words[0] == "foundtrinket") else if (words[0] == "foundtrinket")
{ {
music.silencedasmusik(); music.silencedasmusik();
music.playef(3); music.playef(Sound_TRINKET);
size_t trinket = ss_toi(words[1]); size_t trinket = ss_toi(words[1]);
if (trinket < SDL_arraysize(obj.collect)) if (trinket < SDL_arraysize(obj.collect))
@ -1805,7 +1805,7 @@ void scriptclass::run(void)
} }
else if (words[0] == "foundlab") else if (words[0] == "foundlab")
{ {
music.playef(3); music.playef(Sound_TRINKET);
graphics.textboxremovefast(); graphics.textboxremovefast();