1
0
Fork 0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-11-16 16:09:42 +01:00

Statically allocate built-in scripts as well

Although it's not an issue, this should minimize the stack footprint of
calling scriptclass::load(), especially if it goes down to calling
scriptclass::loadcustom() or scriptclass::loadother().
This commit is contained in:
Misa 2020-05-29 09:42:12 -07:00 committed by Ethan Lee
parent d27ffa51b6
commit 726a79c568
2 changed files with 196 additions and 196 deletions

File diff suppressed because it is too large Load diff

View file

@ -8,7 +8,7 @@ void scriptclass::loadother(std::string t)
//loads script name t into the array //loads script name t into the array
if (t == "terminal_station_1") if (t == "terminal_station_1")
{ {
const char* lines[] = { static const char* lines[] = {
"cutscene()", "cutscene()",
"untilbars()", "untilbars()",
@ -39,7 +39,7 @@ void scriptclass::loadother(std::string t)
} }
else if (t == "alreadyvisited") else if (t == "alreadyvisited")
{ {
const char* lines[] = { static const char* lines[] = {
"squeak(player)", "squeak(player)",
"text(cyan,0,0,1)", "text(cyan,0,0,1)",
"...oh, I've already found this.", "...oh, I've already found this.",
@ -54,7 +54,7 @@ void scriptclass::loadother(std::string t)
} }
else if (t == "terminal_outside_1") else if (t == "terminal_outside_1")
{ {
const char* lines[] = { static const char* lines[] = {
"cutscene()", "cutscene()",
"untilbars()", "untilbars()",
@ -105,7 +105,7 @@ void scriptclass::loadother(std::string t)
} }
else if (t == "terminal_outside_2") else if (t == "terminal_outside_2")
{ {
const char* lines[] = { static const char* lines[] = {
"cutscene()", "cutscene()",
"untilbars()", "untilbars()",
@ -154,7 +154,7 @@ void scriptclass::loadother(std::string t)
} }
else if (t == "terminal_outside_3") else if (t == "terminal_outside_3")
{ {
const char* lines[] = { static const char* lines[] = {
"cutscene()", "cutscene()",
"untilbars()", "untilbars()",
@ -203,7 +203,7 @@ void scriptclass::loadother(std::string t)
} }
else if (t == "terminal_outside_4") else if (t == "terminal_outside_4")
{ {
const char* lines[] = { static const char* lines[] = {
"cutscene()", "cutscene()",
"untilbars()", "untilbars()",
@ -241,7 +241,7 @@ void scriptclass::loadother(std::string t)
} }
else if (t == "terminal_outside_5") else if (t == "terminal_outside_5")
{ {
const char* lines[] = { static const char* lines[] = {
"cutscene()", "cutscene()",
"untilbars()", "untilbars()",
@ -290,7 +290,7 @@ void scriptclass::loadother(std::string t)
} }
else if (t == "terminal_outside_6") else if (t == "terminal_outside_6")
{ {
const char* lines[] = { static const char* lines[] = {
"cutscene()", "cutscene()",
"untilbars()", "untilbars()",
@ -339,7 +339,7 @@ void scriptclass::loadother(std::string t)
} }
else if (t == "terminal_finallevel") else if (t == "terminal_finallevel")
{ {
const char* lines[] = { static const char* lines[] = {
"cutscene()", "cutscene()",
"untilbars()", "untilbars()",
@ -416,7 +416,7 @@ void scriptclass::loadother(std::string t)
{ {
const char* lines[] = { static const char* lines[] = {
//"delay(15)", "flash(5)", "shake(20)", "playef(9)", //"delay(15)", "flash(5)", "shake(20)", "playef(9)",
"text(gray,0,114,3)", "text(gray,0,114,3)",
@ -445,7 +445,7 @@ void scriptclass::loadother(std::string t)
} }
else if (t == "terminal_station_2") else if (t == "terminal_station_2")
{ {
const char* lines[] = { static const char* lines[] = {
"cutscene()", "cutscene()",
"untilbars()", "untilbars()",
@ -473,7 +473,7 @@ void scriptclass::loadother(std::string t)
} }
else if (t == "terminal_station_3") else if (t == "terminal_station_3")
{ {
const char* lines[] = { static const char* lines[] = {
"cutscene()", "cutscene()",
"untilbars()", "untilbars()",
@ -500,7 +500,7 @@ void scriptclass::loadother(std::string t)
} }
else if (t == "terminal_station_4") else if (t == "terminal_station_4")
{ {
const char* lines[] = { static const char* lines[] = {
"cutscene()", "cutscene()",
"untilbars()", "untilbars()",
@ -527,7 +527,7 @@ void scriptclass::loadother(std::string t)
} }
else if (t == "terminal_warp_1") else if (t == "terminal_warp_1")
{ {
const char* lines[] = { static const char* lines[] = {
"cutscene()", "cutscene()",
"untilbars()", "untilbars()",
@ -554,7 +554,7 @@ void scriptclass::loadother(std::string t)
} }
else if (t == "terminal_warp_2") else if (t == "terminal_warp_2")
{ {
const char* lines[] = { static const char* lines[] = {
"cutscene()", "cutscene()",
"untilbars()", "untilbars()",
@ -582,7 +582,7 @@ void scriptclass::loadother(std::string t)
} }
else if (t == "terminal_lab_1") else if (t == "terminal_lab_1")
{ {
const char* lines[] = { static const char* lines[] = {
"cutscene()", "cutscene()",
"untilbars()", "untilbars()",
@ -620,7 +620,7 @@ void scriptclass::loadother(std::string t)
} }
else if (t == "terminal_lab_2") else if (t == "terminal_lab_2")
{ {
const char* lines[] = { static const char* lines[] = {
"cutscene()", "cutscene()",
"untilbars()", "untilbars()",
@ -639,7 +639,7 @@ void scriptclass::loadother(std::string t)
} }
else if (t == "terminal_secretlab") else if (t == "terminal_secretlab")
{ {
const char* lines[] = { static const char* lines[] = {
"cutscene()", "cutscene()",
"untilbars()", "untilbars()",
@ -670,7 +670,7 @@ void scriptclass::loadother(std::string t)
} }
else if (t == "terminal_shipcomputer") else if (t == "terminal_shipcomputer")
{ {
const char* lines[] = { static const char* lines[] = {
"cutscene()", "cutscene()",
"untilbars()", "untilbars()",
@ -700,7 +700,7 @@ void scriptclass::loadother(std::string t)
} }
else if (t == "terminal_letsgo") else if (t == "terminal_letsgo")
{ {
const char* lines[] = { static const char* lines[] = {
"squeak(player)", "squeak(player)",
"text(player,0,0,2)", "text(player,0,0,2)",
"Now that the ship is fixed,", "Now that the ship is fixed,",
@ -730,7 +730,7 @@ void scriptclass::loadother(std::string t)
} }
else if (t == "terminal_radio") else if (t == "terminal_radio")
{ {
const char* lines[] = { static const char* lines[] = {
"cutscene()", "cutscene()",
"untilbars()", "untilbars()",
@ -752,7 +752,7 @@ void scriptclass::loadother(std::string t)
} }
else if (t == "terminal_jukebox") else if (t == "terminal_jukebox")
{ {
const char* lines[] = { static const char* lines[] = {
"cutscene()", "cutscene()",
"untilbars()", "untilbars()",
@ -786,7 +786,7 @@ void scriptclass::loadother(std::string t)
} }
else if (t == "terminal_jukeunlock1") else if (t == "terminal_jukeunlock1")
{ {
const char* lines[] = { static const char* lines[] = {
"squeak(terminal)", "squeak(terminal)",
"text(gray,0,114,4)", "text(gray,0,114,4)",
" NEXT UNLOCK: ", " NEXT UNLOCK: ",
@ -804,7 +804,7 @@ void scriptclass::loadother(std::string t)
} }
else if (t == "terminal_jukeunlock2") else if (t == "terminal_jukeunlock2")
{ {
const char* lines[] = { static const char* lines[] = {
"squeak(terminal)", "squeak(terminal)",
"text(gray,0,114,4)", "text(gray,0,114,4)",
" NEXT UNLOCK: ", " NEXT UNLOCK: ",
@ -822,7 +822,7 @@ void scriptclass::loadother(std::string t)
} }
else if (t == "terminal_jukeunlock3") else if (t == "terminal_jukeunlock3")
{ {
const char* lines[] = { static const char* lines[] = {
"squeak(terminal)", "squeak(terminal)",
"text(gray,0,114,4)", "text(gray,0,114,4)",
" NEXT UNLOCK: ", " NEXT UNLOCK: ",
@ -840,7 +840,7 @@ void scriptclass::loadother(std::string t)
} }
else if (t == "terminal_jukeunlock4") else if (t == "terminal_jukeunlock4")
{ {
const char* lines[] = { static const char* lines[] = {
"squeak(terminal)", "squeak(terminal)",
"text(gray,0,114,4)", "text(gray,0,114,4)",
" NEXT UNLOCK: ", " NEXT UNLOCK: ",
@ -858,7 +858,7 @@ void scriptclass::loadother(std::string t)
} }
else if (t == "terminal_jukeunlock41") else if (t == "terminal_jukeunlock41")
{ {
const char* lines[] = { static const char* lines[] = {
"squeak(terminal)", "squeak(terminal)",
"text(gray,0,114,4)", "text(gray,0,114,4)",
" NEXT UNLOCK: ", " NEXT UNLOCK: ",
@ -876,7 +876,7 @@ void scriptclass::loadother(std::string t)
} }
else if (t == "terminal_jukeunlock5") else if (t == "terminal_jukeunlock5")
{ {
const char* lines[] = { static const char* lines[] = {
"squeak(terminal)", "squeak(terminal)",
"text(gray,0,114,4)", "text(gray,0,114,4)",
" NEXT UNLOCK: ", " NEXT UNLOCK: ",
@ -894,7 +894,7 @@ void scriptclass::loadother(std::string t)
} }
else if (t == "terminal_jukeunlock6") else if (t == "terminal_jukeunlock6")
{ {
const char* lines[] = { static const char* lines[] = {
"squeak(terminal)", "squeak(terminal)",
"text(gray,0,114,4)", "text(gray,0,114,4)",
" NEXT UNLOCK: ", " NEXT UNLOCK: ",
@ -912,7 +912,7 @@ void scriptclass::loadother(std::string t)
} }
else if (t == "terminal_jukeunlock7") else if (t == "terminal_jukeunlock7")
{ {
const char* lines[] = { static const char* lines[] = {
"squeak(terminal)", "squeak(terminal)",
"text(gray,0,114,4)", "text(gray,0,114,4)",
" NEXT UNLOCK: ", " NEXT UNLOCK: ",
@ -930,7 +930,7 @@ void scriptclass::loadother(std::string t)
} }
else if (t == "terminal_juke1") else if (t == "terminal_juke1")
{ {
const char* lines[] = { static const char* lines[] = {
"play(4)", "play(4)",
"squeak(terminal)", "squeak(terminal)",
"jukebox(1)", "jukebox(1)",
@ -939,7 +939,7 @@ void scriptclass::loadother(std::string t)
} }
else if (t == "terminal_juke2") else if (t == "terminal_juke2")
{ {
const char* lines[] = { static const char* lines[] = {
"play(1)", "play(1)",
"squeak(terminal)", "squeak(terminal)",
"jukebox(2)", "jukebox(2)",
@ -948,7 +948,7 @@ void scriptclass::loadother(std::string t)
} }
else if (t == "terminal_juke3") else if (t == "terminal_juke3")
{ {
const char* lines[] = { static const char* lines[] = {
"play(2)", "play(2)",
"squeak(terminal)", "squeak(terminal)",
"jukebox(3)", "jukebox(3)",
@ -957,7 +957,7 @@ void scriptclass::loadother(std::string t)
} }
else if (t == "terminal_juke4") else if (t == "terminal_juke4")
{ {
const char* lines[] = { static const char* lines[] = {
"play(6)", "play(6)",
"squeak(terminal)", "squeak(terminal)",
"jukebox(4)", "jukebox(4)",
@ -966,7 +966,7 @@ void scriptclass::loadother(std::string t)
} }
else if (t == "terminal_juke5") else if (t == "terminal_juke5")
{ {
const char* lines[] = { static const char* lines[] = {
"play(3)", "play(3)",
"squeak(terminal)", "squeak(terminal)",
"jukebox(5)", "jukebox(5)",
@ -975,7 +975,7 @@ void scriptclass::loadother(std::string t)
} }
else if (t == "terminal_juke6") else if (t == "terminal_juke6")
{ {
const char* lines[] = { static const char* lines[] = {
"play(8)", "play(8)",
"squeak(terminal)", "squeak(terminal)",
"jukebox(6)", "jukebox(6)",
@ -984,7 +984,7 @@ void scriptclass::loadother(std::string t)
} }
else if (t == "terminal_juke7") else if (t == "terminal_juke7")
{ {
const char* lines[] = { static const char* lines[] = {
"play(11)", "play(11)",
"squeak(terminal)", "squeak(terminal)",
"jukebox(7)", "jukebox(7)",
@ -993,7 +993,7 @@ void scriptclass::loadother(std::string t)
} }
else if (t == "terminal_juke8") else if (t == "terminal_juke8")
{ {
const char* lines[] = { static const char* lines[] = {
"play(10)", "play(10)",
"squeak(terminal)", "squeak(terminal)",
"jukebox(8)", "jukebox(8)",
@ -1002,7 +1002,7 @@ void scriptclass::loadother(std::string t)
} }
else if (t == "terminal_juke9") else if (t == "terminal_juke9")
{ {
const char* lines[] = { static const char* lines[] = {
"play(12)", "play(12)",
"squeak(terminal)", "squeak(terminal)",
"jukebox(9)", "jukebox(9)",
@ -1011,7 +1011,7 @@ void scriptclass::loadother(std::string t)
} }
else if (t == "terminal_juke10") else if (t == "terminal_juke10")
{ {
const char* lines[] = { static const char* lines[] = {
"play(9)", "play(9)",
"squeak(terminal)", "squeak(terminal)",
"jukebox(10)", "jukebox(10)",