diff --git a/desktop_version/src/Input.cpp b/desktop_version/src/Input.cpp index 1a1de624..ea43d744 100644 --- a/desktop_version/src/Input.cpp +++ b/desktop_version/src/Input.cpp @@ -128,9 +128,10 @@ void menuactionpress() #define OFFSET (MPOFFSET+NOCUSTOMSOFFSET) -#if !defined(MAKEANDPLAY) - if (game.currentmenuoption == 0) + switch (game.currentmenuoption) { +#if !defined(MAKEANDPLAY) + case 0: //Play if (game.telesummary == "" && game.quicksummary == "") { @@ -145,55 +146,49 @@ void menuactionpress() game.createmenu("play"); map.nexttowercolour(); } - } - else + break; #endif #if !defined(NO_CUSTOM_LEVELS) - if (game.currentmenuoption == OFFSET+1) - { + case OFFSET+1: //Bring you to the normal playmenu music.playef(11); game.createmenu("playerworlds"); map.nexttowercolour(); - } - else + break; #endif - if (game.currentmenuoption == OFFSET+2) - { + case OFFSET+2: //Options music.playef(11); game.createmenu("graphicoptions"); map.nexttowercolour(); - } - else if (game.currentmenuoption == OFFSET+3) - { + break; + case OFFSET+3: //Options music.playef(11); game.createmenu("options"); map.nexttowercolour(); - } + break; #if !defined(MAKEANDPLAY) - else if (game.currentmenuoption == OFFSET+4) - { + case OFFSET+4: //Credits music.playef(11); game.createmenu("credits"); map.nexttowercolour(); - } + break; #else #undef MPOFFSET #define MPOFFSET -2 #endif - else if (game.currentmenuoption == OFFSET+5) - { + case OFFSET+5: //bye! music.playef(2); game.mainmenu = 100; graphics.fademode = 2; - } + break; #undef OFFSET #undef NOCUSTOMSOFFSET #undef MPOFFSET + } } #if !defined(NO_CUSTOM_LEVELS) else if(game.currentmenuname=="levellist") @@ -236,17 +231,22 @@ void menuactionpress() #endif else if(game.currentmenuname=="quickloadlevel") { - if(game.currentmenuoption==0){//continue save + switch (game.currentmenuoption) + { + case 0: //continue save game.mainmenu = 23; graphics.fademode = 2; - }else if(game.currentmenuoption==1){ + break; + case 1: game.mainmenu = 22; graphics.fademode = 2; - }else if(game.currentmenuoption==2){ + break; + case 2: music.playef(11); game.levelpage=0; game.createmenu("levellist"); map.nexttowercolour(); + break; } } #if !defined(NO_CUSTOM_LEVELS) @@ -257,7 +257,9 @@ void menuactionpress() #else #define OFFSET 0 #endif - if(game.currentmenuoption==0){ + switch (game.currentmenuoption) + { + case 0: music.playef(11); game.levelpage=0; @@ -265,17 +267,17 @@ void menuactionpress() game.loadcustomlevelstats(); //Should only load a file if it's needed game.createmenu("levellist"); map.nexttowercolour(); - } + break; #if !defined(NO_EDITOR) - if(game.currentmenuoption==1){ + case 1: //LEVEL EDITOR HOOK music.playef(11); game.mainmenu = 20; graphics.fademode = 2; ed.filename=""; - } + break; #endif - /*else if(game.currentmenuoption==offset+2){ + /*case OFFSET+2: music.playef(11); //"OPENFOLDERHOOK" //When the player selects the "open level folder" menu option, @@ -284,12 +286,13 @@ void menuactionpress() // - Minimise the game // - Open the levels folder for whatever operating system we're on SDL_assert(0 && "Remove open level dir"); - - }*/else if(game.currentmenuoption==OFFSET+2){ + break;*/ + case OFFSET+2: //back music.playef(11); game.createmenu("mainmenu"); map.nexttowercolour(); + break; } #undef OFFSET } @@ -301,28 +304,33 @@ void menuactionpress() } else if (game.currentmenuname == "graphicoptions") { - if (game.currentmenuoption == 0){ + switch (game.currentmenuoption) + { + case 0: music.playef(11); graphics.screenbuffer->toggleFullScreen(); game.fullscreen = !game.fullscreen; game.savestats(); game.createmenu("graphicoptions"); game.currentmenuoption = 0; - }else if (game.currentmenuoption == 1){ + break; + case 1: music.playef(11); graphics.screenbuffer->toggleStretchMode(); game.stretchMode = (game.stretchMode + 1) % 3; game.savestats(); game.createmenu("graphicoptions"); game.currentmenuoption = 1; - }else if (game.currentmenuoption == 2){ + break; + case 2: music.playef(11); graphics.screenbuffer->toggleLinearFilter(); game.useLinearFilter = !game.useLinearFilter; game.savestats(); game.createmenu("graphicoptions"); game.currentmenuoption = 2; - }else if (game.currentmenuoption == 3){ + break; + case 3: //change smoothing music.playef(11); game.fullScreenEffect_badSignal = !game.fullScreenEffect_badSignal; @@ -331,7 +339,8 @@ void menuactionpress() game.savestats(); game.createmenu("graphicoptions"); game.currentmenuoption = 3; - }else if (game.currentmenuoption == 4) { + break; + case 4: //toggle mouse cursor music.playef(11); if (graphics.showmousecursor == true) { @@ -342,26 +351,26 @@ void menuactionpress() SDL_ShowCursor(SDL_ENABLE); graphics.showmousecursor = true; } - } - else - { + break; + default: //back music.playef(11); game.createmenu("mainmenu"); map.nexttowercolour(); + break; } } else if (game.currentmenuname == "youwannaquit") { - if (game.currentmenuoption == 0) + switch (game.currentmenuoption) { + case 0: //bye! music.playef(2); game.mainmenu = 100; graphics.fademode = 2; - } - else - { + break; + default: music.playef(11); game.createmenu(game.previousmenuname); map.nexttowercolour(); @@ -369,48 +378,51 @@ void menuactionpress() } else if (game.currentmenuname == "setinvincibility") { - if (game.currentmenuoption == 0) + switch (game.currentmenuoption) { + case 0: //back music.playef(11); game.createmenu("accessibility"); game.currentmenuoption = 3; map.nexttowercolour(); - } - else - { + break; + default: map.invincibility = !map.invincibility; game.savestats(); music.playef(11); game.createmenu("accessibility"); game.currentmenuoption = 3; map.nexttowercolour(); + break; } } else if (game.currentmenuname == "setslowdown1") { - if (game.currentmenuoption == 0) + switch (game.currentmenuoption) { + case 0: //back music.playef(11); game.createmenu("accessibility"); game.currentmenuoption = 4; map.nexttowercolour(); - } - else - { + break; + case 1: //change game speed game.deletequick(); game.deletetele(); game.createmenu("setslowdown2"); map.nexttowercolour(); music.playef(11); + break; } } else if (game.currentmenuname == "setslowdown2") { - if (game.currentmenuoption == 0) + switch (game.currentmenuoption) { + case 0: //back game.gameframerate=34; game.slowdown = 30; @@ -419,9 +431,8 @@ void menuactionpress() game.createmenu("accessibility"); game.currentmenuoption = 4; map.nexttowercolour(); - } - else if (game.currentmenuoption == 1) - { + break; + case 1: game.gameframerate=41; game.slowdown = 24; game.savestats(); @@ -429,9 +440,8 @@ void menuactionpress() game.createmenu("accessibility"); game.currentmenuoption = 4; map.nexttowercolour(); - } - else if (game.currentmenuoption == 2) - { + break; + case 2: game.gameframerate=55; game.slowdown = 18; game.savestats(); @@ -439,9 +449,8 @@ void menuactionpress() game.createmenu("accessibility"); game.currentmenuoption = 4; map.nexttowercolour(); - } - else if (game.currentmenuoption == 3) - { + break; + case 3: game.gameframerate=83; game.slowdown = 12; game.savestats(); @@ -449,20 +458,21 @@ void menuactionpress() game.createmenu("accessibility"); game.currentmenuoption = 4; map.nexttowercolour(); + break; } } else if (game.currentmenuname == "accessibility") { - if (game.currentmenuoption == 0) + switch (game.currentmenuoption) { + case 0: //disable animated backgrounds game.colourblindmode = !game.colourblindmode; game.savestats(); map.tdrawback = true; music.playef(11); - } - else if (game.currentmenuoption == 1) - { + break; + case 1: //disable screeneffects game.noflashingmode = !game.noflashingmode; game.savestats(); @@ -474,16 +484,14 @@ void menuactionpress() }else{ music.playef(11); } - } - else if (game.currentmenuoption == 2) - { + break; + case 2: //disable text outline graphics.notextoutline = !graphics.notextoutline; game.savestats(); music.playef(11); - } - else if (game.currentmenuoption == 3) - { + break; + case 3: //invincibility if (!map.invincibility) { @@ -495,37 +503,33 @@ void menuactionpress() map.invincibility = !map.invincibility; } music.playef(11); - } - else if (game.currentmenuoption == 4) - { + break; + case 4: //change game speed game.createmenu("setslowdown2"); map.nexttowercolour(); music.playef(11); - } - else if (game.currentmenuoption == 5) - { + break; + case 5: // toggle fake load screen game.skipfakeload = !game.skipfakeload; music.playef(11); - } - else if (game.currentmenuoption == 6) - { + break; + case 6: // toggle translucent roomname BG graphics.translucentroomname = !graphics.translucentroomname; music.playef(11); - } - else if (game.currentmenuoption == 7) - { + break; + case 7: //back music.playef(11); game.createmenu("options"); map.nexttowercolour(); - } - else - { + break; + default: //Can't do yet! play sad sound music.playef(2); + break; } } else if (game.currentmenuname == "options") @@ -536,35 +540,34 @@ void menuactionpress() #define OFFSET 0 #endif - if (game.currentmenuoption == 0) + switch (game.currentmenuoption) { + case 0: //accessibility options music.playef(11); game.createmenu("accessibility"); map.nexttowercolour(); - } + break; #if !defined(MAKEANDPLAY) - else if (game.currentmenuoption == 1) - { + case 1: //unlock play options music.playef(11); game.createmenu("unlockmenu"); map.nexttowercolour(); - } + break; #endif - else if (game.currentmenuoption == OFFSET+2) - { + case OFFSET+2: //clear data menu music.playef(11); game.createmenu("controller"); map.nexttowercolour(); - } - else if (game.currentmenuoption == OFFSET+3) - { + break; + case OFFSET+3: //clear data menu music.playef(11); game.createmenu("cleardatamenu"); map.nexttowercolour(); + break; } int mmmmmm_offset = music.mmmmmm ? 0 : -1; @@ -592,79 +595,75 @@ void menuactionpress() } else if (game.currentmenuname == "unlockmenutrials") { - if (game.currentmenuoption == 0) //unlock 1 + switch (game.currentmenuoption) { + case 0: //unlock 1 game.unlock[9] = true; game.unlocknotify[9] = true; music.playef(11); game.savestats(); game.createmenu("unlockmenutrials"); game.currentmenuoption = 0; - } - else if (game.currentmenuoption == 1) //unlock 2 - { + break; + case 1: //unlock 2 game.unlock[10] = true; game.unlocknotify[10] = true; music.playef(11); game.savestats(); game.createmenu("unlockmenutrials"); game.currentmenuoption = 1; - } - else if (game.currentmenuoption == 2) //unlock 3 - { + break; + case 2: //unlock 3 game.unlock[11] = true; game.unlocknotify[11] = true; music.playef(11); game.savestats(); game.createmenu("unlockmenutrials"); game.currentmenuoption = 2; - } - else if (game.currentmenuoption == 3) //unlock 4 - { + break; + case 3: //unlock 4 game.unlock[12] = true; game.unlocknotify[12] = true; music.playef(11); game.savestats(); game.createmenu("unlockmenutrials"); game.currentmenuoption = 3; - } - else if (game.currentmenuoption == 4) //unlock 5 - { + break; + case 4: //unlock 5 game.unlock[13] = true; game.unlocknotify[13] = true; music.playef(11); game.savestats(); game.createmenu("unlockmenutrials"); game.currentmenuoption = 4; - } - else if (game.currentmenuoption == 5) //unlock 6 - { + break; + case 5: //unlock 6 game.unlock[14] = true; game.unlocknotify[14] = true; music.playef(11); game.savestats(); game.createmenu("unlockmenutrials"); game.currentmenuoption = 5; - } - else if (game.currentmenuoption == 6) //back - { + break; + case 6: //back //back music.playef(11); game.createmenu("unlockmenu"); map.nexttowercolour(); + break; } } else if (game.currentmenuname == "unlockmenu") { - if (game.currentmenuoption == 0) + switch (game.currentmenuoption) { + case 0: //unlock time trials separately... music.playef(11); game.createmenu("unlockmenutrials"); map.nexttowercolour(); - } - else if (game.currentmenuoption == 1) - { + break; + case 1: //unlock intermissions music.playef(11); game.unlock[16] = true; @@ -674,9 +673,8 @@ void menuactionpress() game.savestats(); game.createmenu("unlockmenu"); game.currentmenuoption = 1; - } - else if (game.currentmenuoption == 2) - { + break; + case 2: //unlock no death mode music.playef(11); game.unlock[17] = true; @@ -684,9 +682,8 @@ void menuactionpress() game.savestats(); game.createmenu("unlockmenu"); game.currentmenuoption = 2; - } - else if (game.currentmenuoption == 3) - { + break; + case 3: //unlock flip mode music.playef(11); game.unlock[18] = true; @@ -694,18 +691,16 @@ void menuactionpress() game.savestats(); game.createmenu("unlockmenu"); game.currentmenuoption = 3; - } - else if (game.currentmenuoption == 4) - { + break; + case 4: //unlock jukebox music.playef(11); game.stat_trinkets = 20; game.savestats(); game.createmenu("unlockmenu"); game.currentmenuoption = 4; - } - else if (game.currentmenuoption == 5) - { + break; + case 5: //unlock secret lab music.playef(11); game.unlock[8] = true; @@ -713,70 +708,74 @@ void menuactionpress() game.savestats(); game.createmenu("unlockmenu"); game.currentmenuoption = 5; - } - else - { + break; + default: //back music.playef(11); game.createmenu("options"); map.nexttowercolour(); + break; } } else if (game.currentmenuname == "credits") { - if (game.currentmenuoption == 0) + switch (game.currentmenuoption) { + case 0: //next page music.playef(11); game.createmenu("credits2"); map.nexttowercolour(); - } - else - { + break; + default: //back music.playef(11); game.createmenu("mainmenu"); map.nexttowercolour(); + break; } } else if (game.currentmenuname == "credits2") { - if (game.currentmenuoption == 0) + switch (game.currentmenuoption) { + case 0: //next page music.playef(11); game.createmenu("credits25"); map.nexttowercolour(); - } - else - { + break; + case 1: //back music.playef(11); game.createmenu("mainmenu"); map.nexttowercolour(); + break; } } else if (game.currentmenuname == "credits25") { - if (game.currentmenuoption == 0) + switch (game.currentmenuoption) { + case 0: //next page music.playef(11); game.createmenu("credits3"); map.nexttowercolour(); - } - else - { + break; + default: //back music.playef(11); game.createmenu("mainmenu"); map.nexttowercolour(); + break; } } else if (game.currentmenuname == "credits3") { - if (game.currentmenuoption == 0) + switch (game.currentmenuoption) { + case 0: //next page music.playef(11); game.current_credits_list_index += 9; @@ -794,20 +793,21 @@ void menuactionpress() } map.nexttowercolour(); - } - else - { + break; + default: //back music.playef(11); game.current_credits_list_index = 0; game.createmenu("mainmenu"); map.nexttowercolour(); + break; } } else if (game.currentmenuname == "credits4") { - if (game.currentmenuoption == 0) + switch (game.currentmenuoption) { + case 0: //next page music.playef(11); game.current_credits_list_index += 14; @@ -825,20 +825,21 @@ void menuactionpress() } map.nexttowercolour(); - } - else - { + break; + default: //back music.playef(11); game.current_credits_list_index = 0; game.createmenu("mainmenu"); map.nexttowercolour(); + break; } } else if (game.currentmenuname == "credits5") { - if (game.currentmenuoption == 0) + switch (game.currentmenuoption) { + case 0: //next page music.playef(11); game.current_credits_list_index += 9; @@ -856,32 +857,33 @@ void menuactionpress() } map.nexttowercolour(); - } - else - { + break; + default: //back music.playef(11); game.current_credits_list_index = 0; game.createmenu("mainmenu"); map.nexttowercolour(); + break; } } else if (game.currentmenuname == "credits6") { - if (game.currentmenuoption == 0) + switch (game.currentmenuoption) { + case 0: //first page music.playef(11); game.createmenu("credits"); map.nexttowercolour(); - } - else - { + break; + default: //back music.playef(11); game.createmenu("mainmenu"); map.nexttowercolour(); music.niceplay(6); + break; } } else if (game.currentmenuname == "play") @@ -947,52 +949,54 @@ void menuactionpress() } else if (game.currentmenuname == "newgamewarning") { - if (game.currentmenuoption == 0) + switch (game.currentmenuoption) { + case 0: //yep game.mainmenu = 0; graphics.fademode = 2; game.deletequick(); game.deletetele(); - } - else - { + break; + default: //back music.playef(11); game.createmenu("play"); map.nexttowercolour(); + break; } } else if (game.currentmenuname == "controller") { - if (game.currentmenuoption == 0) + switch (game.currentmenuoption) { + case 0: game.controllerSensitivity++; music.playef(11); if(game.controllerSensitivity > 4) { game.controllerSensitivity = 0; } - } + break; - if (game.currentmenuoption == 4) - { + case 4: music.playef(11); game.createmenu("options"); + break; } } else if (game.currentmenuname == "cleardatamenu") { - if (game.currentmenuoption == 0) + switch (game.currentmenuoption) { + case 0: //back music.playef(11); game.createmenu("options"); map.nexttowercolour(); - } - else - { + break; + default: //yep music.playef(23); game.deletequick(); @@ -1002,11 +1006,12 @@ void menuactionpress() game.screenshake = 15; game.createmenu("mainmenu"); map.nexttowercolour(); + break; } } else if (game.currentmenuname == "playmodes") { - if (game.currentmenuoption == 0 && game.slowdown == 30 && !map.invincibility) //go to the time trial menu + if (game.currentmenuoption == 0 && game.slowdown == 30 && !map.invincibility) //go to the time trial menu { music.playef(11); game.createmenu("timetrials"); @@ -1048,126 +1053,122 @@ void menuactionpress() } else if (game.currentmenuname == "startnodeathmode") { - if (game.currentmenuoption == 0) //start no death mode, disabling cutscenes + switch (game.currentmenuoption) { + case 0: //start no death mode, disabling cutscenes game.mainmenu = 10; graphics.fademode = 2; - } - else if (game.currentmenuoption == 1) - { + break; + case 1: game.mainmenu = 9; graphics.fademode = 2; - } - else if (game.currentmenuoption == 2) - { + break; + case 2: //back music.playef(11); game.createmenu("play"); map.nexttowercolour(); + break; } } else if (game.currentmenuname == "continue") { - if (game.currentmenuoption == 0) + switch (game.currentmenuoption) { + case 0: game.mainmenu = 1; graphics.fademode = 2; - } - else if (game.currentmenuoption == 1) - { + break; + case 1: game.mainmenu = 2; graphics.fademode = 2; - } - else if (game.currentmenuoption == 2) - { + break; + case 2: //back music.playef(11); game.createmenu("play"); map.nexttowercolour(); + break; } } else if (game.currentmenuname == "intermissionmenu") { - if (game.currentmenuoption == 0) + switch (game.currentmenuoption) { + case 0: music.playef(11); music.play(6); game.createmenu("playint1"); map.nexttowercolour(); - } - else if (game.currentmenuoption == 1) - { + break; + case 1: music.playef(11); music.play(6); game.createmenu("playint2"); map.nexttowercolour(); - } - else if (game.currentmenuoption == 2) - { + break; + case 2: //back music.playef(11); game.createmenu("play"); map.nexttowercolour(); + break; } } else if (game.currentmenuname == "playint1") { - if (game.currentmenuoption == 0) + switch (game.currentmenuoption) { + case 0: game.mainmenu = 12; graphics.fademode = 2; - } - else if (game.currentmenuoption == 1) - { + break; + case 1: game.mainmenu = 13; graphics.fademode = 2; - } - else if (game.currentmenuoption == 2) - { + break; + case 2: game.mainmenu = 14; graphics.fademode = 2; - } - else if (game.currentmenuoption == 3) - { + break; + case 3: game.mainmenu = 15; graphics.fademode = 2; - } - else if (game.currentmenuoption == 4) - { + break; + case 4: //back music.playef(11); game.createmenu("play"); map.nexttowercolour(); + break; } } else if (game.currentmenuname == "playint2") { - if (game.currentmenuoption == 0) + switch (game.currentmenuoption) { + case 0: game.mainmenu = 16; graphics.fademode = 2; - } - else if (game.currentmenuoption == 1) - { + break; + case 1: game.mainmenu = 17; graphics.fademode = 2; - } - else if (game.currentmenuoption == 2) - { + break; + case 2: game.mainmenu = 18; graphics.fademode = 2; - } - else if (game.currentmenuoption == 3) - { + break; + case 3: game.mainmenu = 19; graphics.fademode = 2; - } - else if (game.currentmenuoption == 4) - { + break; + case 4: //back music.playef(11); game.createmenu("play"); map.nexttowercolour(); + break; } } else if (game.currentmenuname == "gameover2") @@ -1236,16 +1237,16 @@ void menuactionpress() } else if (game.currentmenuname == "timetrialcomplete3") { - if (game.currentmenuoption == 0) + switch (game.currentmenuoption) { + case 0: //back music.playef(11); music.play(6); game.createmenu("play"); map.nexttowercolour(); - } - else if (game.currentmenuoption == 1) - { + break; + case 1: //duplicate the above based on given time trial level! if (game.timetriallevel == 0) //space station 1 { @@ -1277,17 +1278,15 @@ void menuactionpress() game.mainmenu = 8; graphics.fademode = 2; } + break; } } else if (game.currentmenuname == "gamecompletecontinue" || game.currentmenuname == "nodeathmodecomplete2") { - if (game.currentmenuoption == 0) - { - music.play(6); - music.playef(11); - game.createmenu("play"); - map.nexttowercolour(); - } + music.play(6); + music.playef(11); + game.createmenu("play"); + map.nexttowercolour(); } } diff --git a/desktop_version/src/Render.cpp b/desktop_version/src/Render.cpp index b109e2b6..17497f38 100644 --- a/desktop_version/src/Render.cpp +++ b/desktop_version/src/Render.cpp @@ -72,33 +72,31 @@ void menurender() #define OFFSET 0 #endif - if (game.currentmenuoption == 0) + switch (game.currentmenuoption) { + case 0: graphics.bigprint( -1, 30, "Accessibility", tr, tg, tb, true); graphics.Print( -1, 65, "Disable screen effects, enable", tr, tg, tb, true); graphics.Print( -1, 75, "slowdown modes or invincibility", tr, tg, tb, true); - } + break; #if !defined(MAKEANDPLAY) - else if (game.currentmenuoption == 1) - { + case 1: graphics.bigprint( -1, 30, "Unlock Play Modes", tr, tg, tb, true); graphics.Print( -1, 65, "Unlock parts of the game normally", tr, tg, tb, true); graphics.Print( -1, 75, "unlocked as you progress", tr, tg, tb, true); - } + break; #endif - else if (game.currentmenuoption == OFFSET+2) - { + case OFFSET+2: graphics.bigprint( -1, 30, "Game Pad Options", tr, tg, tb, true); graphics.Print( -1, 65, "Rebind your controller's buttons", tr, tg, tb, true); graphics.Print( -1, 75, "and adjust sensitivity", tr, tg, tb, true); - } - else if (game.currentmenuoption == OFFSET+3) - { + break; + case OFFSET+3: graphics.bigprint( -1, 30, "Clear Data", tr, tg, tb, true); graphics.Print( -1, 65, "Delete your save data", tr, tg, tb, true); graphics.Print( -1, 75, "and unlocked play modes", tr, tg, tb, true); - }else if (game.currentmenuoption == OFFSET+4) - { + break; + case OFFSET+4: if(music.mmmmmm){ graphics.bigprint( -1, 30, "Soundtrack", tr, tg, tb, true); graphics.Print( -1, 65, "Toggle between MMMMMM and PPPPPP", tr, tg, tb, true); @@ -108,13 +106,15 @@ void menurender() graphics.Print( -1, 85, "Current soundtrack: PPPPPP", tr, tg, tb, true); } } + break; } #undef OFFSET } else if (game.currentmenuname == "graphicoptions") { - if (game.currentmenuoption == 0) + switch (game.currentmenuoption) { + case 0: graphics.bigprint( -1, 30, "Toggle Fullscreen", tr, tg, tb, true); graphics.Print( -1, 65, "Change to fullscreen/windowed mode.", tr, tg, tb, true); @@ -123,9 +123,9 @@ void menurender() }else{ graphics.Print( -1, 85, "Current mode: WINDOWED", tr, tg, tb, true); } + break; - }else if (game.currentmenuoption == 1) - { + case 1: graphics.bigprint( -1, 30, "Toggle Letterbox", tr, tg, tb, true); graphics.Print( -1, 65, "Choose letterbox/stretch/integer mode.", tr, tg, tb, true); @@ -136,8 +136,8 @@ void menurender() }else{ graphics.Print( -1, 85, "Current mode: LETTERBOX", tr, tg, tb, true); } - }else if (game.currentmenuoption == 2) - { + break; + case 2: graphics.bigprint( -1, 30, "Toggle Filter", tr, tg, tb, true); graphics.Print( -1, 65, "Change to nearest/linear filter.", tr, tg, tb, true); @@ -146,16 +146,15 @@ void menurender() }else{ graphics.Print( -1, 85, "Current mode: NEAREST", tr, tg, tb, true); } + break; - } else if (game.currentmenuoption == 3) - { + case 3: graphics.bigprint( -1, 30, "Analogue Mode", tr, tg, tb, true); graphics.Print( -1, 65, "There is nothing wrong with your", tr, tg, tb, true); graphics.Print( -1, 75, "television set. Do not attempt to", tr, tg, tb, true); graphics.Print( -1, 85, "adjust the picture.", tr, tg, tb, true); - } - else if (game.currentmenuoption == 4) - { + break; + case 4: graphics.bigprint(-1, 30, "Toggle Mouse Cursor", tr, tg, tb, true); graphics.Print(-1, 65, "Show/hide the system mouse cursor.", tr, tg, tb, true); @@ -165,6 +164,7 @@ void menurender() else { graphics.Print(-1, 85, "Current mode: HIDE", tr/2, tg/2, tb/2, true); } + break; } } else if (game.currentmenuname == "credits") @@ -283,21 +283,20 @@ void menurender() { graphics.bigprint( -1, 40, "Game Speed", tr, tg, tb, true); graphics.Print( -1, 75, "Select a new game speed below.", tr, tg, tb, true); - if (game.gameframerate==34) + switch (game.gameframerate) { + case 34: graphics.Print( -1, 105, "Game speed is normal.", tr/2, tg/2, tb/2, true); - } - else if (game.gameframerate==41) - { + break; + case 41: graphics.Print( -1, 105, "Game speed is at 80%", tr, tg, tb, true); - } - else if (game.gameframerate==55) - { + break; + case 55: graphics.Print( -1, 105, "Game speed is at 60%", tr, tg, tb, true); - } - else if (game.gameframerate==83) - { + break; + case 83: graphics.Print( -1, 105, "Game speed is at 40%", tr, tg, tb, true); + break; } } else if (game.currentmenuname == "newgamewarning") @@ -321,8 +320,9 @@ void menurender() { graphics.bigprint( -1, 30, "Game Pad", tr, tg, tb, true); graphics.Print( -1, 55, "Change controller options.", tr, tg, tb, true); - if (game.currentmenuoption == 0) + switch (game.currentmenuoption) { + case 0: switch(game.controllerSensitivity) { case 0: @@ -346,22 +346,23 @@ void menurender() graphics.Print( -1, 95, "..................[]", tr, tg, tb, true); break; } - } - if ( game.currentmenuoption == 1 || - game.currentmenuoption == 2 || - game.currentmenuoption == 3 ) - { + break; + case 1: + case 2: + case 3: graphics.Print( -1, 85, "Flip is bound to: " + std::string(help.GCString(game.controllerButton_flip)) , tr, tg, tb, true); graphics.Print( -1, 95, "Enter is bound to: " + std::string(help.GCString(game.controllerButton_map)), tr, tg, tb, true); graphics.Print( -1, 105, "Menu is bound to: " + std::string(help.GCString(game.controllerButton_esc)) , tr, tg, tb, true); + break; } } else if (game.currentmenuname == "accessibility") { - if (game.currentmenuoption == 0) + switch (game.currentmenuoption) { + case 0: graphics.bigprint( -1, 40, "Backgrounds", tr, tg, tb, true); if (!game.colourblindmode) { @@ -371,9 +372,8 @@ void menurender() { graphics.Print( -1, 75, "Backgrounds are OFF.", tr/2, tg/2, tb/2, true); } - } - else if (game.currentmenuoption == 1) - { + break; + case 1: graphics.bigprint( -1, 40, "Screen Effects", tr, tg, tb, true); graphics.Print( -1, 75, "Disables screen shakes and flashes.", tr, tg, tb, true); if (!game.noflashingmode) @@ -384,9 +384,8 @@ void menurender() { graphics.Print( -1, 85, "Screen Effects are OFF.", tr/2, tg/2, tb/2, true); } - } - else if (game.currentmenuoption == 2) - { + break; + case 2: graphics.bigprint( -1, 40, "Text Outline", tr, tg, tb, true); graphics.Print( -1, 75, "Disables outline on game text", tr, tg, tb, true); // FIXME: Maybe do an outlined print instead? -flibit @@ -398,9 +397,8 @@ void menurender() { graphics.Print( -1, 85, "Text outlines are OFF.", tr/2, tg/2, tb/2, true); } - } - else if (game.currentmenuoption == 3) - { + break; + case 3: graphics.bigprint( -1, 40, "Invincibility", tr, tg, tb, true); graphics.Print( -1, 75, "Provided to help disabled gamers", tr, tg, tb, true); graphics.Print( -1, 85, "explore the game. Can cause glitches.", tr, tg, tb, true); @@ -412,9 +410,8 @@ void menurender() { graphics.Print( -1, 105, "Invincibility is off.", tr/2, tg/2, tb/2, true); } - } - else if (game.currentmenuoption == 4) - { + break; + case 4: graphics.bigprint( -1, 40, "Game Speed", tr, tg, tb, true); graphics.Print( -1, 75, "May be useful for disabled gamers", tr, tg, tb, true); graphics.Print( -1, 85, "using one switch devices.", tr, tg, tb, true); @@ -434,17 +431,15 @@ void menurender() { graphics.Print( -1, 105, "Game speed is at 40%", tr, tg, tb, true); } - } - else if (game.currentmenuoption == 5) - { + break; + case 5: graphics.bigprint(-1, 30, "Fake Load Screen", tr, tg, tb, true); if (game.skipfakeload) graphics.Print(-1, 75, "Fake loading screen is OFF", tr/2, tg/2, tb/2, true); else graphics.Print(-1, 75, "Fake loading screen is ON", tr, tg, tb, true); - } - else if (game.currentmenuoption == 6) - { + break; + case 6: graphics.bigprint(-1, 30, "Room Name BG", tr, tg, tb, true); graphics.Print( -1, 75, "Lets you see through what is behind", tr, tg, tb, true); graphics.Print( -1, 85, "the name at the bottom of the screen.", tr, tg, tb, true); @@ -452,6 +447,7 @@ void menurender() graphics.Print(-1, 105, "Room name background is TRANSLUCENT", tr/2, tg/2, tb/2, true); else graphics.Print(-1, 105, "Room name background is OPAQUE", tr, tg, tb, true); + break; } } else if (game.currentmenuname == "playint1" || game.currentmenuname == "playint2") @@ -461,8 +457,9 @@ void menurender() } else if (game.currentmenuname == "playmodes") { - if (game.currentmenuoption == 0) + switch (game.currentmenuoption) { + case 0: graphics.bigprint( -1, 30, "Time Trials", tr, tg, tb, true); graphics.Print( -1, 65, "Replay any level in the game in", tr, tg, tb, true); graphics.Print( -1, 75, "a competitive time trial mode.", tr, tg, tb, true); @@ -472,9 +469,8 @@ void menurender() graphics.Print( -1, 105, "Time Trials are not available", tr, tg, tb, true); graphics.Print( -1, 115, "with slowdown or invincibility.", tr, tg, tb, true); } - } - else if (game.currentmenuoption == 1) - { + break; + case 1: graphics.bigprint( -1, 30, "Intermissions", tr, tg, tb, true); graphics.Print( -1, 65, "Replay the intermission levels.", tr, tg, tb, true); @@ -483,9 +479,8 @@ void menurender() graphics.Print( -1, 95, "TO UNLOCK: Complete the", tr, tg, tb, true); graphics.Print( -1, 105, "intermission levels in-game.", tr, tg, tb, true); } - } - else if (game.currentmenuoption == 2) - { + break; + case 2: graphics.bigprint( -1, 30, "No Death Mode", tr, tg, tb, true); graphics.Print( -1, 65, "Play the entire game", tr, tg, tb, true); graphics.Print( -1, 75, "without dying once.", tr, tg, tb, true); @@ -500,9 +495,8 @@ void menurender() graphics.Print( -1, 105, "TO UNLOCK: Achieve an S-rank or", tr, tg, tb, true); graphics.Print( -1, 115, "above in at least 4 time trials.", tr, tg, tb, true); } - } - else if (game.currentmenuoption == 3) - { + break; + case 3: graphics.bigprint( -1, 30, "Flip Mode", tr, tg, tb, true); graphics.Print( -1, 65, "Flip the entire game vertically.", tr, tg, tb, true); graphics.Print( -1, 75, "Compatible with other game modes.", tr, tg, tb, true); @@ -522,6 +516,7 @@ void menurender() { graphics.Print( -1, 105, "TO UNLOCK: Complete the game.", tr, tg, tb, true); } + break; } } else if (game.currentmenuname == "youwannaquit") @@ -536,8 +531,9 @@ void menurender() graphics.crewframedelay = 8; graphics.crewframe = (graphics.crewframe + 1) % 2; } - if (game.currentmenuoption == 0) + switch (game.currentmenuoption) { + case 0: //Show teleporter save info graphics.drawpixeltextbox(25, 65-20, 270, 90, 34,12, 65, 185, 207,0,4); @@ -552,9 +548,8 @@ void menurender() graphics.drawspritesetcol(50, 126-20, 50, 18); graphics.drawspritesetcol(175, 126-20, 22, 18); - } - else if (game.currentmenuoption == 1) - { + break; + case 1: //Show quick save info graphics.drawpixeltextbox(25, 65-20, 270, 90, 34,12, 65, 185, 207,0,4); @@ -569,6 +564,7 @@ void menurender() graphics.drawspritesetcol(50, 126-20, 50, 18); graphics.drawspritesetcol(175, 126-20, 22, 18); + break; } } else if (game.currentmenuname == "gameover" || game.currentmenuname == "gameover2") @@ -596,29 +592,26 @@ void menurender() graphics.Print(0, 145, tempstring, tr, tg, tb, true); graphics.Print(0, 155, game.hardestroom, tr, tg, tb, true); - if (game.crewrescued() == 1) + switch (game.crewrescued()) { + case 1: tempstring = "Keep trying! You'll get there!"; - } - else if (game.crewrescued() == 2) - { + break; + case 2: tempstring = "Nice one!"; - } - else if (game.crewrescued() == 3) - { + break; + case 3: tempstring = "Wow! Congratulations!"; - } - else if (game.crewrescued() == 4) - { + break; + case 4: tempstring = "Incredible!"; - } - else if (game.crewrescued() == 5) - { + break; + case 5: tempstring = "Unbelievable! Well done!"; - } - else if (game.crewrescued() == 6) - { + break; + case 6: tempstring = "Er, how did you do that?"; + break; } graphics.Print(0, 190, tempstring, tr, tg, tb, true); @@ -712,8 +705,9 @@ void menurender() } else if (game.currentmenuname == "timetrials") { - if (game.currentmenuoption == 0) + switch (game.currentmenuoption) { + case 0: if(game.unlock[9]) { graphics.bigprint( -1, 30, "Space Station 1", tr, tg, tb, true); @@ -758,9 +752,8 @@ void menurender() graphics.Print( -1, 75, "Rescue Violet", tr, tg, tb, true); graphics.Print( -1, 85, "Find three trinkets", tr, tg, tb, true); } - } - else if (game.currentmenuoption == 1) - { + break; + case 1: if(game.unlock[10]) { graphics.bigprint( -1, 30, "The Laboratory", tr, tg, tb, true); @@ -805,9 +798,8 @@ void menurender() graphics.Print( -1, 75, "Rescue Victoria", tr, tg, tb, true); graphics.Print( -1, 85, "Find six trinkets", tr, tg, tb, true); } - } - else if (game.currentmenuoption == 2) - { + break; + case 2: if(game.unlock[11]) { graphics.bigprint( -1, 30, "The Tower", tr, tg, tb, true); @@ -852,9 +844,8 @@ void menurender() graphics.Print( -1, 75, "Rescue Vermilion", tr, tg, tb, true); graphics.Print( -1, 85, "Find nine trinkets", tr, tg, tb, true); } - } - else if (game.currentmenuoption == 3) - { + break; + case 3: if(game.unlock[12]) { graphics.bigprint( -1, 30, "Space Station 2", tr, tg, tb, true); @@ -899,9 +890,8 @@ void menurender() graphics.Print( -1, 75, "Rescue Vitellary", tr, tg, tb, true); graphics.Print( -1, 85, "Find twelve trinkets", tr, tg, tb, true); } - } - else if (game.currentmenuoption == 4) - { + break; + case 4: if(game.unlock[13]) { graphics.bigprint( -1, 30, "The Warp Zone", tr, tg, tb, true); @@ -946,9 +936,8 @@ void menurender() graphics.Print( -1, 75, "Rescue Verdigris", tr, tg, tb, true); graphics.Print( -1, 85, "Find fifteen trinkets", tr, tg, tb, true); } - } - else if (game.currentmenuoption == 5) - { + break; + case 5: if(game.unlock[14]) { graphics.bigprint( -1, 30, "The Final Level", tr, tg, tb, true); @@ -993,6 +982,7 @@ void menurender() graphics.Print( -1, 75, "Complete the game", tr, tg, tb, true); graphics.Print( -1, 85, "Find eighteen trinkets", tr, tg, tb, true); } + break; } } else if (game.currentmenuname == "gamecompletecontinue")