diff options
author | Colin Noga <Tempus@chronometry.ca> | 2013-04-18 20:38:29 -0500 |
---|---|---|
committer | Colin Noga <Tempus@chronometry.ca> | 2013-04-18 20:38:29 -0500 |
commit | 3abe5505fc51f1b397d4659c9e82faf19bc01629 (patch) | |
tree | 207c24cd5525c101149762bdf782976bf2f51142 | |
parent | 93faabab3cebc0bca795c0d8c1ad832b0c619134 (diff) | |
parent | 3c7beae513ce1d9ff226415e14f834645b1afeb4 (diff) | |
download | kamek-3abe5505fc51f1b397d4659c9e82faf19bc01629.tar.gz kamek-3abe5505fc51f1b397d4659c9e82faf19bc01629.zip |
Merge branch 'level-select' of ssh://treeki.rustedlogic.net:30000/Kamek into level-select
-rw-r--r-- | src/creditsMgr.cpp | 9 | ||||
-rw-r--r-- | src/endingMgr.cpp | 6 | ||||
-rw-r--r-- | src/fileselect.S | 5 | ||||
-rw-r--r-- | src/koopatlas/pathmanager.cpp | 17 |
4 files changed, 33 insertions, 4 deletions
diff --git a/src/creditsMgr.cpp b/src/creditsMgr.cpp index d66083d..c13d906 100644 --- a/src/creditsMgr.cpp +++ b/src/creditsMgr.cpp @@ -106,6 +106,7 @@ class dCreditsMgr_c : public dActorState_c { bool fireworks; int fireworksCountdown; + int endFWAfter; int fauxScrollFrame; float fauxScrollMinX, fauxScrollMaxX, fauxScrollY; @@ -245,6 +246,10 @@ int dCreditsMgr_c::onExecute() { nw4r::snd::SoundHandle handle; PlaySoundWithFunctionB4(SoundRelatedClass, &handle, SE_OBJ_GOAL_FIREWORKS, 1); + + endFWAfter--; + if (endFWAfter <= 0) + fireworks = false; } } @@ -361,6 +366,10 @@ int dCreditsMgr_c::onExecute() { case 19: fireworks = true; fireworksCountdown = 25; + endFWAfter = 480; + break; + case 20: + fireworks = false; break; } } diff --git a/src/endingMgr.cpp b/src/endingMgr.cpp index ef40613..09dfc3c 100644 --- a/src/endingMgr.cpp +++ b/src/endingMgr.cpp @@ -47,6 +47,11 @@ int dEndingMgr_c::onCreate() { } int dEndingMgr_c::onDelete() { + nw4r::snd::SoundHandle *fanfare = (nw4r::snd::SoundHandle*) + (((u32)SoundRelatedClass) + 0x900); + if (fanfare->Exists()) + fanfare->Stop(60); + daBossDemo_c::onDelete(); WLClass::instance->disableDemoControl(true); return true; @@ -216,6 +221,7 @@ void dEndingMgr_c::executeState_ThanksPeach() { if (peach->stage == 1 && peachSt == &peach->StateID_Turn) { timer++; if (timer == 1) { + // This plays the Peach harp fanfare sub_8019C390(_8042A788, 6); } if (timer > 20) { diff --git a/src/fileselect.S b/src/fileselect.S index 5847201..25b1805 100644 --- a/src/fileselect.S +++ b/src/fileselect.S @@ -160,6 +160,11 @@ chosenWName: li r5, 0 bl InsertIntIntoTextBox1 +.extern ResetAllCompletionCandidates__Fv +.extern ClearOldPathAvailabilityData__Fv + bl ResetAllCompletionCandidates__Fv + bl ClearOldPathAvailabilityData__Fv + lwz r22, 0x24(r1) lwz r21, 0x28(r1) lwz r20, 0x2C(r1) diff --git a/src/koopatlas/pathmanager.cpp b/src/koopatlas/pathmanager.cpp index ad39c69..697b9fb 100644 --- a/src/koopatlas/pathmanager.cpp +++ b/src/koopatlas/pathmanager.cpp @@ -18,6 +18,7 @@ bool CanFinishAllCoins = false; bool CanFinishAllExits = false; bool CanFinishEverything = false; void ResetAllCompletionCandidates() { + // This is called by File Select, btw MaybeFinishingLevel[0] = 0xFF; LastLevelPlayed[0] = 0xFF; CanFinishCoins = false; @@ -273,15 +274,23 @@ void dWMPathManager_c::setup() { static u8 *PathAvailabilityData = 0; static u8 *NodeAvailabilityData = 0; -dWMPathManager_c::~dWMPathManager_c() { - bool entering8_25 = (MaybeFinishingLevel[0] == 7) && (MaybeFinishingLevel[1] == 24); - if (PathAvailabilityData && !isEnteringLevel && !entering8_25) { +void ClearOldPathAvailabilityData() { + // This is called by File Select + if (PathAvailabilityData) { delete[] PathAvailabilityData; PathAvailabilityData = 0; - + } + if (NodeAvailabilityData) { delete[] NodeAvailabilityData; NodeAvailabilityData = 0; } +} + +dWMPathManager_c::~dWMPathManager_c() { + bool entering8_25 = (MaybeFinishingLevel[0] == 7) && (MaybeFinishingLevel[1] == 24); + if (!isEnteringLevel && !entering8_25) { + ClearOldPathAvailabilityData(); + } if (isEnteringLevel) { ResetAllCompletionCandidates(); |