summaryrefslogtreecommitdiff
path: root/src/koopatlas/map.cpp
diff options
context:
space:
mode:
authorTreeki <treeki@gmail.com>2013-03-03 02:55:19 +0100
committerTreeki <treeki@gmail.com>2013-03-03 02:55:19 +0100
commit314c9015a11d18fa34fc4f91c9830e03a245ce86 (patch)
tree78e63ca9b35bdf1756c6cbbe094d21b9a9e5949f /src/koopatlas/map.cpp
parent1821ee168a7df344e236cf0af1c55569b1e75976 (diff)
downloadkamek-314c9015a11d18fa34fc4f91c9830e03a245ce86.tar.gz
kamek-314c9015a11d18fa34fc4f91c9830e03a245ce86.zip
add launch stars
Diffstat (limited to '')
-rw-r--r--src/koopatlas/map.cpp45
1 files changed, 45 insertions, 0 deletions
diff --git a/src/koopatlas/map.cpp b/src/koopatlas/map.cpp
index da038c1..e12767e 100644
--- a/src/koopatlas/map.cpp
+++ b/src/koopatlas/map.cpp
@@ -68,6 +68,32 @@ int dWMMap_c::onCreate() {
effectRenderers[i].setupEffectRenderer(&allocator, -1, EffectPrios[i], EffectGroups[i]);
}
+ bool lsRotate = false;
+ switch (dScKoopatlas_c::instance->currentMapID) {
+ case 5: // Starry Sky
+ launchStarX = 5424.0f; launchStarY = -4416.0f; showLaunchStar = true; break;
+ case 11: // Sky City
+ launchStarX = 3216.0f; launchStarY = -3120.0f; showLaunchStar = true; break;
+ case 6: // Planet Koopa
+ lsRotate = true;
+ launchStarX = 2268.0f; launchStarY = -3420.0f; showLaunchStar = true; break;
+ }
+ if (showLaunchStar) {
+ nw4r::g3d::ResFile lsRes(getResource("StarRing", "g3d/StarRing.brres"));
+ nw4r::g3d::ResMdl lsMdl = lsRes.GetResMdl("StarRing");
+ launchStarModel.setup(lsMdl, &allocator, 0x32C, 1, 0);
+
+ nw4r::g3d::ResAnmChr lsAnm = lsRes.GetResAnmChr("StarRing_wait");
+ launchStarAnm.setup(lsMdl, lsAnm, &allocator, 0);
+
+ launchStarAnm.bind(&launchStarModel, lsAnm, false);
+ launchStarModel.bindAnim(&launchStarAnm);
+
+ launchStarMatrix.translation(launchStarX, launchStarY, 1000.0f);
+ S16Vec lsRot = {0x2000, lsRotate ? 0x6200 : -0x5C00, 0};
+ launchStarMatrix.applyRotationYXZ(&lsRot.x, &lsRot.y, &lsRot.z);
+ }
+
allocator.unlink();
return true;
@@ -83,6 +109,14 @@ int dWMMap_c::onExecute() {
doEffects();
+ if (showLaunchStar) {
+ launchStarAnm.process();
+ launchStarModel._vf1C();
+ launchStarModel.setDrawMatrix(launchStarMatrix);
+ launchStarModel.setScale(0.035f, 0.035f, 0.035f);
+ launchStarModel.calcWorld(false);
+ }
+
return true;
}
@@ -91,6 +125,9 @@ int dWMMap_c::onDraw() {
renderer.scheduleForDrawing();
bgModel.scheduleForDrawing();
+ if (showLaunchStar)
+ launchStarModel.scheduleForDrawing();
+
for (int i = 0; i < EFFECT_RENDERER_COUNT; i++) {
effectRenderers[i].scheduleForDrawing();
}
@@ -574,3 +611,11 @@ void dWMMap_c::doEffects() {
}
+
+void dWMMap_c::spinLaunchStar() {
+ nw4r::g3d::ResFile lsRes(getResource("StarRing", "g3d/StarRing.brres"));
+ nw4r::g3d::ResAnmChr lsAnm = lsRes.GetResAnmChr("StarRing_shot");
+ launchStarAnm.bind(&launchStarModel, lsAnm, false);
+ launchStarModel.bindAnim(&launchStarAnm);
+}
+