summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTreeki <treeki@gmail.com>2013-04-26 18:32:56 +0200
committerTreeki <treeki@gmail.com>2013-04-26 18:32:56 +0200
commit3b9d80ede136ee309d67fe4f40fad7cc06781a6a (patch)
tree8d3e2ecff48523f65496098f90b4d9f4e91307f4
parent4db8f732fcf8c41bc2844b2c73f9dbadcbf4c442 (diff)
downloadkamek-3b9d80ede136ee309d67fe4f40fad7cc06781a6a.tar.gz
kamek-3b9d80ede136ee309d67fe4f40fad7cc06781a6a.zip
add pre-programmed fireworks sequence
-rw-r--r--src/creditsMgr.cpp52
1 files changed, 33 insertions, 19 deletions
diff --git a/src/creditsMgr.cpp b/src/creditsMgr.cpp
index c13d906..058db4c 100644
--- a/src/creditsMgr.cpp
+++ b/src/creditsMgr.cpp
@@ -42,6 +42,12 @@ extern "C" void GXPixModeSync();
extern "C" void *MakeMarioEnterDemoMode();
extern "C" void *MakeMarioExitDemoMode();
+struct FireworkInfo {
+ const char *name;
+ float xOffset, yOffset;
+ int delay;
+};
+
extern void *SoundRelatedClass;
extern u16 DanceValues_AnimSpeed; // 80427C2E
@@ -106,7 +112,7 @@ class dCreditsMgr_c : public dActorState_c {
bool fireworks;
int fireworksCountdown;
- int endFWAfter;
+ int fwID;
int fauxScrollFrame;
float fauxScrollMinX, fauxScrollMaxX, fauxScrollY;
@@ -224,31 +230,40 @@ int dCreditsMgr_c::onExecute() {
if (fireworks) {
fireworksCountdown--;
if (fireworksCountdown <= 0) {
- fireworksCountdown = MakeRandomNumber(40);
-
- static const char *fw[7] = {
- "Wm_ob_fireworks_y",
- "Wm_ob_fireworks_b",
- "Wm_ob_fireworks_g",
- "Wm_ob_fireworks_p",
- "Wm_ob_fireworks_k",
- "Wm_ob_fireworks_1up",
- "Wm_ob_fireworks_star",
+ static const FireworkInfo fwInfo[] = {
+ {"Wm_ob_fireworks_g", 20.000000f, 49.000000f, 8}, // ends @ 8
+ {"Wm_ob_fireworks_1up", 154.000000f, 80.000000f, 14}, // ends @ 22
+ {"Wm_ob_fireworks_b", 168.000000f, 27.000000f, 33}, // ends @ 55
+ {"Wm_ob_fireworks_1up", 416.000000f, 22.000000f, 33}, // ends @ 88
+ {"Wm_ob_fireworks_y", 179.000000f, 11.000000f, 8}, // ends @ 96
+ {"Wm_ob_fireworks_star", 9.000000f, 35.000000f, 25}, // ends @ 121
+ {"Wm_ob_fireworks_y", 398.000000f, 29.000000f, 11}, // ends @ 132
+ {"Wm_ob_fireworks_g", 127.000000f, 64.000000f, 21}, // ends @ 153
+ {"Wm_ob_fireworks_star", 439.000000f, 66.000000f, 3}, // ends @ 156
+ {"Wm_ob_fireworks_k", 320.000000f, 18.000000f, 31}, // ends @ 187
+ {"Wm_ob_fireworks_p", 158.000000f, 47.000000f, 42}, // ends @ 229
+ {"Wm_ob_fireworks_star", 127.000000f, 1.000000f, 29}, // ends @ 258
+ {"Wm_ob_fireworks_k", 164.000000f, 50.000000f, 18}, // ends @ 276
+ {"Wm_ob_fireworks_g", 365.000000f, 25.000000f, 39}, // ends @ 315
+ {"Wm_ob_fireworks_k", 2.000000f, 78.000000f, 44}, // ends @ 359
+ {"Wm_ob_fireworks_g", 309.000000f, 25.000000f, 42}, // ends @ 401
+ {"Wm_ob_fireworks_star", 222.000000f, 78.000000f, 44}, // ends @ 445
+ {"Wm_ob_fireworks_y", 269.000000f, 23.000000f, 38}, // ends @ 483
+ {0, 0.0f, 0.0f, 0},
};
- int fwID = MakeRandomNumber(7);
- int xOffs = MakeRandomNumber(464);
- int yOffs = MakeRandomNumber(80);
-
+ fireworksCountdown = fwInfo[fwID].delay;
+ float xOffs = fwInfo[fwID].xOffset;
+ float yOffs = fwInfo[fwID].yOffset;
VEC3 efPos = {10208.0f + xOffs, -304.0f - yOffs, pos.z + 200.0f};
- SpawnEffect(fw[fwID], 0, &efPos, 0, 0);
+ SpawnEffect(fwInfo[fwID].name, 0, &efPos, 0, 0);
nw4r::snd::SoundHandle handle;
PlaySoundWithFunctionB4(SoundRelatedClass, &handle, SE_OBJ_GOAL_FIREWORKS, 1);
- endFWAfter--;
- if (endFWAfter <= 0)
+ fwID++;
+ if (!fwInfo[fwID].name)
fireworks = false;
}
}
@@ -366,7 +381,6 @@ int dCreditsMgr_c::onExecute() {
case 19:
fireworks = true;
fireworksCountdown = 25;
- endFWAfter = 480;
break;
case 20:
fireworks = false;