diff options
Diffstat (limited to 'src/koopatlas/map.cpp')
-rw-r--r-- | src/koopatlas/map.cpp | 45 |
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); +} + |