From c1b82d4ff5631eb14ce5d86a06e3691a37076862 Mon Sep 17 00:00:00 2001 From: cristian64 Date: Fri, 21 Aug 2026 22:03:32 +0100 Subject: [PATCH 1/2] PauseManager: Add class implementation. --- configure.py | 2 +- include/Kameda/Pause2D.h | 3 + include/Kameda/PauseManager.h | 93 +++-- include/Kameda/Result2D.h | 16 +- include/Kameda/SequenceInfo.h | 2 + include/Kameda/WipeManager.h | 2 + include/Osako/PadRecorder.h | 4 +- src/Kameda/PauseManager.cpp | 632 +++++++++++++++++++++++++++++++++- src/Kameda/Result2D.cpp | 7 +- 9 files changed, 706 insertions(+), 55 deletions(-) diff --git a/configure.py b/configure.py index 61d65144..7adc17fd 100755 --- a/configure.py +++ b/configure.py @@ -1083,7 +1083,7 @@ def MatchingFor(*versions): Object(Matching, "Kameda/J2DManager.cpp"), Object(Matching, "Kameda/Task.cpp"), Object(NonMatching, "Kameda/Goal2D.cpp"), - Object(NonMatching, "Kameda/PauseManager.cpp"), + Object(Matching, "Kameda/PauseManager.cpp"), Object(NonMatching, "Kameda/Pause2D.cpp"), Object(Matching, "Kameda/WipeManager.cpp"), Object(Matching, "Kameda/Fade.cpp"), diff --git a/include/Kameda/Pause2D.h b/include/Kameda/Pause2D.h index a2e355a1..bc6b0bd8 100644 --- a/include/Kameda/Pause2D.h +++ b/include/Kameda/Pause2D.h @@ -54,5 +54,8 @@ class Pause2D { // Autogenerated static void *mPrintMessageTag; static void *mStarTag; static void *mStarDrawTag; + +private: + u8 _0[0x174]; }; // class Pause2D #endif // PAUSE2D_H diff --git a/include/Kameda/PauseManager.h b/include/Kameda/PauseManager.h index 56ffb50d..b6f33a63 100644 --- a/include/Kameda/PauseManager.h +++ b/include/Kameda/PauseManager.h @@ -1,53 +1,82 @@ #ifndef PAUSEMANAGER_H #define PAUSEMANAGER_H +#include "JSystem/J2D/J2DGrafContext.h" +#include "JSystem/JKernel/JKRArchive.h" #include "JSystem/JKernel/JKRHeap.h" +#include "Kameda/Pause2D.h" +#include "Kameda/PrintMemoryCard.h" +#include "Kameda/Result2D.h" #include "Osako/kartPad.h" #include "types.h" -class PauseManager { +class PauseManager +{ public: - PauseManager(JKRHeap *); // 0x801343d0 - void reset(); // 0x801345fc - void draw(); // 0x801346d0 - void exec(); // 0x801348f8 - static bool tstPause(); // 0x80135288 - void wipeOut(int); // 0x80135290 - static int getPauseChoice(); // 0x801352d0 - void setTA(); // 0x8013541c - - void setResultStartFlag(bool flag) {mResultStart = flag; } + PauseManager(JKRHeap *heap); // 0x801343d0 + ~PauseManager(); + void reset(); // 0x801345fc + void setPause(); + void clrPause(); + void draw(); // 0x801346d0 + void exec(); // 0x801348f8 + static bool tstPause(); // 0x80135288 + void wipeIn(); + void wipeOut(int); // 0x80135290 + static int getPauseChoice(); // 0x801352d0 + void getCharRankPos(int); + void setTA(); // 0x8013541c + + void setResultStartFlag(bool flag) { mResultStart = flag; } void setGameOverFlag(bool flag) { mGameOver = flag; } void setExecFlag(bool flag) { mExec = flag; } void setPauseEndFlag(bool flag) { mPauseEnd = flag; } - + void enablePause() { _14 = 0; } - static PauseManager *getManager() { - return mThis; - } + static PauseManager *getManager() { return mThis; } bool isResultStart() const { return mResultStart; } private: - static PauseManager *mThis; // 0x80416298 - static bool mIsPause; // 0x8041629c - static int mPauseSelector; // 0x804162a0 - static int mPauseChoice; // 0x804162a4 - static int mPauseNextChoice; // 0x804162a8 - static KartGamePad *mPausePad; // 0x804162ac - - u8 _0[0xe]; - bool mResultStart; - bool _f; - bool mGameOver; - u8 _11[0x13 - 0x11]; - bool mExec; - u32 _14; - bool mPauseEnd; - u8 _19[0x3c - 0x19]; + static PauseManager *mThis; // 0x80416298 + static bool mIsPause; // 0x8041629c + static int mPauseSelector; // 0x804162a0 + static int mPauseChoice; // 0x804162a4 + static int mPauseNextChoice; // 0x804162a8 + static KartGamePad *mPausePad; // 0x804162ac + + bool mNetFlag; // 0x00 + u8 _1[3]; // 0x01 + JKRArchive *mArchive; // 0x04 + PrintMemoryCard *mPrintMemoryCard; // 0x08 + u8 _c; // 0x0c + u8 _d; // 0x0d + bool mResultStart; // 0x0e + bool _f; // 0x0f + bool mGameOver; // 0x10 + u8 _11; // 0x11 + u8 _12; // 0x12 + bool mExec; // 0x13 + s32 _14; // 0x14 + bool mPauseEnd; // 0x18 + u8 _19; // 0x19 + u8 _1a; // 0x1a + u8 _1b; // 0x1b + Pause2D *mPause2D; // 0x1c + Result2D *mResult2D; // 0x20 + J2DOrthoGraph *mOrthoGraph; // 0x24 + s32 _28; // 0x28 + s32 mWipeOutFrame; // 0x2c + s32 mWipeOutDuration; // 0x30 + u32 _34; // 0x30 + bool _38; // 0x38 + u8 _39[3]; // 0x39 }; -inline PauseManager *GETPauseManager() { return PauseManager::getManager(); } +inline PauseManager *GETPauseManager() +{ + return PauseManager::getManager(); +} #endif diff --git a/include/Kameda/Result2D.h b/include/Kameda/Result2D.h index 5a111778..0eb8d13c 100644 --- a/include/Kameda/Result2D.h +++ b/include/Kameda/Result2D.h @@ -57,7 +57,7 @@ class Result2D { // Autogenerated void setDrawVS(); // 0x8014cb58 void setDrawTA(); // 0x8014cc10 void setDrawMG(); // 0x8014cd94 - void getResultSelector(); // 0x8014ce48 + static int getResultSelector(); // 0x8014ce48 void setRaceRank(); // 0x8014ce50 void setGPRank(); // 0x8014d924 void setVS(); // 0x8014df84 @@ -81,9 +81,12 @@ class Result2D { // Autogenerated void getFrameColor(JUTColor &); // 0x80150500 void getScale(int); // 0x8015057c void setScale(int); // 0x801505c4 - void setGPClr(); // 0x80150804 - void getAnmEnd(); // 0x80150830 - + static void setGPClr(); // 0x80150804 + bool getAnmEnd(); // 0x80150830 + + static inline bool getDrawFlag(); + static inline void setDrawFlag(bool drawFlag); + static const u64 mSetWordLineTag[9]; // 0x8036ec18 static const u64 mResultLayoutTag[11]; // 0x8036ec60 static const u64 mResultLineTag[20]; // 0x8036ecb8 @@ -101,6 +104,11 @@ class Result2D { // Autogenerated // Inline/Unused ~Result2D(); void getCharPos(int); + +public: + u8 _0[0x1980]; // 0x0 + u32 _1980; // 0x1980 + u8 _1984[0x1c24 - 0x1984]; // 0x1984 }; // class Result2D #endif // RESULT2D_H diff --git a/include/Kameda/SequenceInfo.h b/include/Kameda/SequenceInfo.h index 7bca7fbf..d19c317b 100644 --- a/include/Kameda/SequenceInfo.h +++ b/include/Kameda/SequenceInfo.h @@ -127,8 +127,10 @@ class SequenceInfo JMARandFast mRnd; // 00 int mStartNo[8]; // 004 KartGamePad *mDecidePad; // 024 +public: u8 _28; // 028 int _2c; // 02C +private: int _30; // 030 u8 mGhostFlags; // 034 u8 _35[0x3C - 0x35]; // 035 diff --git a/include/Kameda/WipeManager.h b/include/Kameda/WipeManager.h index 07833c4c..8511ec6a 100644 --- a/include/Kameda/WipeManager.h +++ b/include/Kameda/WipeManager.h @@ -71,6 +71,8 @@ class WipeManager void startWipe(int idx) { mMoveFlag[idx] = true; } void stopWipe(int idx) { mMoveFlag[idx] = false; } int getScreenCount() const { return mScrnCount; } + TWipeCurtain *getWipeCurtain() const { return mWipeCurtain; } + Mario *getMario() const { return mMario; } static WipeManager *getManager() { return mThis; } diff --git a/include/Osako/PadRecorder.h b/include/Osako/PadRecorder.h index bdcc8b22..934a6940 100644 --- a/include/Osako/PadRecorder.h +++ b/include/Osako/PadRecorder.h @@ -40,12 +40,12 @@ class PadRecorder KartPadRecord *getGhostRecord(u8 no); void playGhost(); // Inline - u32 getFrame() { return mFrame; }; + s32 getFrame() { return mFrame; }; void setFrame(u32 frame) { mFrame = frame; } static PadRecorder *mspRecorder; private: - u32 mFrame; + s32 mFrame; PadState mState; KartPadData mPadData[NUM_PLAYERPADS]; JUTGamePad::CButton mButton[NUM_PLAYERPADS]; diff --git a/src/Kameda/PauseManager.cpp b/src/Kameda/PauseManager.cpp index f84c724b..76e7350b 100644 --- a/src/Kameda/PauseManager.cpp +++ b/src/Kameda/PauseManager.cpp @@ -1,34 +1,638 @@ #include "Kameda/PauseManager.h" -#include "mathHelper.h" -PauseManager *PauseManager::mThis; // 0x80416298 +#include "Inagaki/GameAudioMain.h" +#include "JSystem/JKernel/JKRHeap.h" +#include "JSystem/JUtility/JUTAssert.h" +#include "Kameda/Goal2D.h" +#include "Kameda/J2DManager.h" +#include "Kameda/Pause2D.h" +#include "Kameda/PrintMemoryCard.h" +#include "Kameda/Result2D.h" +#include "Kameda/SequenceInfo.h" +#include "Kameda/WipeManager.h" +#include "Kaneshige/RaceInfo.h" +#include "Kaneshige/RaceMgr.h" +#include "Osako/NetGameMgr.h" +#include "Osako/RaceApp.h" +#include "Osako/ResMgr.h" +#include "Osako/kartPad.h" +#include "Osako/system.h" +#include "mathHelper.h" // For unused data + +PauseManager *PauseManager::mThis; bool PauseManager::mIsPause; int PauseManager::mPauseSelector; int PauseManager::mPauseChoice; int PauseManager::mPauseNextChoice; KartGamePad *PauseManager::mPausePad; -PauseManager::PauseManager(JKRHeap *) {} +static int button; + +PauseManager::PauseManager(JKRHeap *heap) +{ + if (!heap) + { + heap = JKRHeap::getCurrentHeap(); + } + + mArchive = ResMgr::getArchive(ResMgr::mcArcMRAMLoc); + mOrthoGraph = System::getJ2DOrtho(); + mPrintMemoryCard = new (heap, 0) PrintMemoryCard(heap); + + mThis = this; + + mNetFlag = NetGameMgr::ptr()->getState() != 0; + _12 = 0; + mExec = false; + + mPause2D = new (heap, 0) Pause2D(heap); + mResult2D = new (heap, 0) Result2D(heap); + + _11 = 1; + for (int i = 0; i < RaceMgr::getManager()->getKartNumber(); ++i) + { + for (int j = 0; j < 2; ++j) + { + if (gSequenceInfo.getPad2Player(gRaceInfo.getKartInfo(i)->getPad(j)) != -1) + { + _11 = 0; + } + } + } + + reset(); +} + +PauseManager::~PauseManager() +{ + // Unknown implementation +} + +void PauseManager::reset() +{ + _12 = 1; + mExec = true; + GameAudio::Main::getAudio()->setPause((GameAudio::Main::PAUSE_STATUS)2); -void PauseManager::reset() {} + mIsPause = false; + mPauseSelector = 0; + mPauseChoice = 13; + mPauseNextChoice = 13; + mPausePad = 0; -void PauseManager::draw() {} + _c = 0; + _d = 0; + mResultStart = false; + _f = 0; + mGameOver = false; + _14 = -1; + mPauseEnd = false; + mPause2D->init(); + mResult2D->init(); + _28 = 0; + mWipeOutFrame = 0; + mWipeOutDuration = 0; + _34 = 0; + _38 = 0; -void PauseManager::exec() { - //void Result2D::getDrawFlag() {} - //void Result2D::setDrawFlag(bool) {} + if (RaceMgr::getManager()->isReplayMode() && RaceMgr::getManager()->getRaceMode() == GRAND_PRIX) + { + Result2D::setGPClr(); + } + + mPrintMemoryCard->init(PrintMemoryCard::mcMsg40); } -bool PauseManager::tstPause() { +void PauseManager::setPause() +{ + // Unknown implementation +} + +void PauseManager::clrPause() +{ + // Unknown implementation +} + +void PauseManager::draw() +{ + if (!_12) + return; + + if (!mNetFlag) + { + mResult2D->draw(); + } + + if (_11 || (!mResultStart && !RaceMgr::getManager()->isReplayMode())) + { + mPause2D->draw(); + } + + if (_28) + { + switch (mPauseNextChoice) + { + case 1: + case 7: + WipeManager::getManager()->getMario()->draw((f32)(_28 + 1) / 40.0f, + JUTColor(0x00, 0x00, 0x00, 0xFF)); + break; + default: + _28 = 1; + } + } + + if (mWipeOutFrame > 0 && mWipeOutDuration > 0) + { + f32 f = (f32)mWipeOutFrame / (f32)mWipeOutDuration; + if (f > 1.0f) + { + f = 1.0f; + } + + WipeManager::getManager()->getWipeCurtain()->calc( + J2DManager::getManager()->getStatus2Kart(0x0), + f, + JUTColor(0x00, 0x00, 0x00, 0xFF)); + + WipeManager::getManager()->getWipeCurtain()->draw( + J2DManager::getManager()->getStatus2Kart(0x0), + f, + JUTColor(0x00, 0x00, 0x00, 0xFF)); + } + + if (_c) + { + mPrintMemoryCard->draw(); + } +} + +void PauseManager::exec() +{ + if (!mExec) + return; + + if (_14 >= 0) + { + _14 += 1; + } + + if (_c) + { + mPrintMemoryCard->calc(); + + switch (mPrintMemoryCard->get_14Thing()) + { + case 0: + _c = 0; + if (_d) + { + goto labelA; + } + goto labelB; + case 1: + _c = 0; + mPrintMemoryCard->init(PrintMemoryCard::mcMsg40); + mPrintMemoryCard->setStuff(0, 0, 0); + break; + } + return; + } + + if (mWipeOutFrame > 0 && mWipeOutDuration > 0) + { + if (mWipeOutFrame == mWipeOutDuration) + { + JUTFader *fader = System::mspDisplay->getFader(); + if (fader) + { + fader->startFadeOut(1); + } + } + mWipeOutFrame += 1; + } + + int var_28 = _28; + if (var_28) + { + if (var_28 < 40) + { + _28 = var_28 + 1; + return; + } + + mPauseChoice = mPauseNextChoice; + mPausePad = 0; + + J2DManager::getManager()->startPreRace(); + + _28 = 0; + Result2D::setDrawFlag(_38); + return; + } + + int var_34 = _34; + if (var_34) + { + if (var_34 < 11) + { + _34 = var_34 + 1; + } + else + { + mPauseChoice = mPauseNextChoice; + mPausePad = 0; + _34 = 0; + Result2D::setDrawFlag(_38); + + switch (mPauseNextChoice) + { + case 1: + case 7: + mPauseChoice = 13; + _28 = 1; + GameAudio::Main::getAudio()->fadeOutAll(40); + break; + default: + { + switch (mPauseNextChoice) + { + case 13: + if (!_38) + { + mIsPause = 0; + } + break; + default: + _34 = 1; + break; + } + break; + } + } + } + + mResult2D->calc(gSequenceInfo.getDecidePad()); + return; + } + + if (_14 < 120) + return; + + if (!tstPause() && !RaceMgr::getManager()->isReplayMode()) + { + if (_11) + { + mPausePad = &gGamePad1P; + mPauseSelector = 0; + mPauseChoice = 13; + } + else + { + KartGamePad *kartgamePad = gpaGamePad[0]; + if (kartgamePad && kartgamePad->testTrigger(JUTGamePad::START)) + { + mPausePad = kartgamePad; + mPauseSelector = 0; + mPauseChoice = 13; + } + } + } + + if (!mNetFlag && + ((mResultStart && Goal2D::mDrawEndFlag) || RaceMgr::getManager()->isReplayMode())) + { + mResult2D->calc(gSequenceInfo.getDecidePad()); + + if (RaceMgr::getManager()->isReplayMode() && + RaceApp::ptr()->getPadRecorder()->getFrame() >= MAX_INPUT_FRAME_COUNT) + { + mIsPause = 1; + mPause2D->init(); + Pause2D::setPauseStatus((Pause2D::PauseStatus)1); + GameAudio::Main::getAudio()->fadeOutAll(40); + mPauseNextChoice = 7; + _34 = 1; + _38 = 0; + } + else + { + KartGamePad *decidePad = gSequenceInfo.getDecidePad(); + if (decidePad->testTrigger(JUTGamePad::A) && Result2D::mResultState == 2 && + mResult2D->getAnmEnd()) + { + if (Result2D::getDrawFlag()) + { + switch (Result2D::getResultSelector()) + { + case 1: + case 7: + GameAudio::Main::getAudio()->startSystemSe(0x20002); + GameAudio::Main::getAudio()->setPause((GameAudio::Main::PAUSE_STATUS)2); + GameAudio::Main::getAudio()->fadeOutAll(40); + + mPauseNextChoice = Result2D::getResultSelector(); + _34 = 1; + _38 = 0; + mResult2D->_1980 = 1; + break; + case 8: + mPauseNextChoice = Result2D::getResultSelector(); + if (RaceMgr::getManager()->isRaceModeGp()) + { + _c = 1; + _d = 0; + mPrintMemoryCard->init(PrintMemoryCard::mcMsg39); + mPrintMemoryCard->calc(); + break; + } + GameAudio::Main::getAudio()->startSystemSe(0x20023); + labelB: + _34 = 1; + _38 = 0; + mResult2D->_1980 = 1; + break; + default: + GameAudio::Main::getAudio()->startSystemSe(0x20002); + GameAudio::Main::getAudio()->setPause((GameAudio::Main::PAUSE_STATUS)2); + mPauseNextChoice = Result2D::getResultSelector(); + _34 = 1; + _38 = 0; + mResult2D->_1980 = 1; + } + } + } + else + { + if (gSequenceInfo.getDecidePad()->testTrigger(JUTGamePad::START)) + { + if (RaceMgr::getManager()->isReplayMode()) + { + if (!Result2D::getDrawFlag()) + { + + mIsPause = 1; + mPause2D->init(); + Pause2D::setPauseStatus((Pause2D::PauseStatus)1); + GameAudio::Main::getAudio()->startSystemSe(0x20008); + GameAudio::Main::getAudio()->setPause((GameAudio::Main::PAUSE_STATUS)1); + mPauseNextChoice = 13; + _34 = 1; + _38 = 1; + Result2D::setDrawFlag(true); + mResult2D->init(); + } + else if (mResult2D->getAnmEnd()) + { + GameAudio::Main::getAudio()->startSystemSe(0x20009); + GameAudio::Main::getAudio()->setPause((GameAudio::Main::PAUSE_STATUS)0); + mPauseNextChoice = 13; + _34 = 1; + _38 = 0; + mResult2D->_1980 = 1; + } + } + } + else + { + if (gSequenceInfo.getDecidePad()->testTrigger(JUTGamePad::A)) + { + if (RaceMgr::getManager()->isReplayMode() && !Result2D::getDrawFlag()) + { + mIsPause = 1; + mPause2D->init(); + Pause2D::setPauseStatus((Pause2D::PauseStatus)1); + GameAudio::Main::getAudio()->startSystemSe(0x20008); + GameAudio::Main::getAudio()->setPause((GameAudio::Main::PAUSE_STATUS)1); + mPauseNextChoice = 13; + _34 = 1; + _38 = 1; + Result2D::setDrawFlag(true); + mResult2D->init(); + } + } + else if (gSequenceInfo.getDecidePad()->testTrigger(JUTGamePad::B) && + RaceMgr::getManager()->isReplayMode() && Result2D::getDrawFlag()) + { + GameAudio::Main::getAudio()->startSystemSe(0x20009); + GameAudio::Main::getAudio()->setPause((GameAudio::Main::PAUSE_STATUS)0); + mPauseNextChoice = 13; + _34 = 1; + _38 = 0; + mResult2D->_1980 = 1; + } + } + } + } + } + + if (!mPausePad) + return; + if (mNetFlag) + return; + if (mPauseEnd && _11 == 0x0) + return; + if (RaceMgr::getManager()->isReplayMode()) + return; + + mPause2D->calc(mPausePad); + if (tstPause()) + { + if (Pause2D::getPauseStatus() == (Pause2D::PauseStatus)3) + { + mPauseChoice = 13; + if (mPausePad->testTrigger(JUTGamePad::A)) + { + switch (Pause2D::getPauseSelector()) + { + case 1: + GameAudio::Main::getAudio()->startSystemSe(0x20023); + _28 = 1; + GameAudio::Main::getAudio()->fadeOutAll(40); + GameAudio::Main::getAudio()->setPause((GameAudio::Main::PAUSE_STATUS)2); + mPauseNextChoice = Pause2D::getPauseSelector(); + return; + case 8: + if (RaceMgr::getManager()->isRaceModeGp()) + { + _c = 1; + _d = 1; + mPrintMemoryCard->init(PrintMemoryCard::mcMsg39); + mPrintMemoryCard->calc(); + return; + } + GameAudio::Main::getAudio()->startSystemSe(0x20023); + labelA: + button = 0; + Pause2D::setPauseStatus((Pause2D::PauseStatus)4); + return; + case 0: + GameAudio::Main::getAudio()->startSystemSe(0x20009); + button = 0; + Pause2D::setPauseStatus((Pause2D::PauseStatus)4); + return; + default: + GameAudio::Main::getAudio()->startSystemSe(0x20023); + button = 0; + Pause2D::setPauseStatus((Pause2D::PauseStatus)4); + } + } + else + { + if (!mPausePad->testTrigger(JUTGamePad::START)) + return; + + button = 1; + Pause2D::setPauseStatus((Pause2D::PauseStatus)4); + GameAudio::Main::getAudio()->startSystemSe(0x20009); + GameAudio::Main::getAudio()->setPause((GameAudio::Main::PAUSE_STATUS)0); + return; + } + } + else + { + if (Pause2D::getPauseStatus() != (Pause2D::PauseStatus)0) + return; + + mPauseChoice = 13; + switch (button) + { + case 0: + switch (Pause2D::getPauseSelector()) + { + case 0: + mIsPause = 0; + GameAudio::Main::getAudio()->setPause((GameAudio::Main::PAUSE_STATUS)0); + default: + mPauseChoice = Pause2D::getPauseSelector(); + mPausePad = nullptr; + GameAudio::Main::getAudio()->setPause((GameAudio::Main::PAUSE_STATUS)2); + break; + } + break; + case 1: + mIsPause = 0; + mPauseSelector = 0; + mPauseChoice = 0; + mPausePad = nullptr; + break; + default: +#line 553 + JUT_ASSERT(0); + } + + return; + } + } + else + { + if (!mPausePad->testTrigger(JUTGamePad::START)) + return; + + mIsPause = 1; + mPause2D->init(); + Pause2D::setPauseStatus((Pause2D::PauseStatus)1); + GameAudio::Main::getAudio()->startSystemSe(0x20008); + GameAudio::Main::getAudio()->setPause((GameAudio::Main::PAUSE_STATUS)1); + return; + } +} + +bool Result2D::getDrawFlag() +{ + return mDrawFlag; +} + +void Result2D::setDrawFlag(bool drawFlag) +{ + mDrawFlag = drawFlag; +} + +bool PauseManager::tstPause() +{ return mIsPause; } -void PauseManager::wipeOut(int) {} +void PauseManager::wipeIn() +{ + // Unknown implementation +} + +void PauseManager::wipeOut(int duration) +{ + mWipeOutFrame = 1; + mWipeOutDuration = duration; + + WipeManager::getManager()->getWipeCurtain()->reset(); +} + +int PauseManager::getPauseChoice() +{ + if (mPauseChoice == 8) + { + GameAudio::Main::getAudio()->setPause((GameAudio::Main::PAUSE_STATUS)2); + } + + if (mThis->_f) + { + mPauseChoice = 5; + GameAudio::Main::getAudio()->setPause((GameAudio::Main::PAUSE_STATUS)2); + } -int PauseManager::getPauseChoice() {} + if (mThis->mGameOver) + { + mPauseChoice = 9; + GameAudio::Main::getAudio()->setPause((GameAudio::Main::PAUSE_STATUS)2); + } + + switch (mPauseChoice) + { + case 2: + case 3: + case 4: + case 6: + gSequenceInfo._28 = 1; + break; + } + + switch (mPauseChoice) + { + case 4: + gSequenceInfo._2c = 0; + break; + case 6: + gSequenceInfo._2c = 1; + break; + } + + if (mPauseChoice == 5) + { + GameAudio::Main::getAudio()->setPause((GameAudio::Main::PAUSE_STATUS)2); + + if (gSequenceInfo.isEndGP()) + { + if (gSequenceInfo.isGameClr()) + { + mPauseChoice = 11; + } + else + { + mPauseChoice = 12; + } + } + } + + return mPauseChoice; +} + +void PauseManager::getCharRankPos(int) +{ + // Unknown implementation +} -void PauseManager::setTA() { - +void PauseManager::setTA() +{ + mResult2D->setTA(); } -#include "JSystem/JAudio/JASFakeMatch2.h" +#include "JSystem/JAudio/JASFakeMatch2.h" // For static initializer diff --git a/src/Kameda/Result2D.cpp b/src/Kameda/Result2D.cpp index 535a4c9a..e71c72ef 100644 --- a/src/Kameda/Result2D.cpp +++ b/src/Kameda/Result2D.cpp @@ -165,7 +165,10 @@ void Result2D::setDrawTA() {} void Result2D::setDrawMG() {} -void Result2D::getResultSelector() {} +int Result2D::getResultSelector() +{ + return mResultSelector; +} void Result2D::setRaceRank() {} @@ -215,6 +218,6 @@ void Result2D::setScale(int) {} void Result2D::setGPClr() {} -void Result2D::getAnmEnd() {} +bool Result2D::getAnmEnd() {} #include "JSystem/JAudio/JASFakeMatch2.h" From a068e33a97cbeaf9ddf38bc24190a064e8b79529 Mon Sep 17 00:00:00 2001 From: cristian64 Date: Fri, 9 Oct 2026 23:09:31 +0100 Subject: [PATCH 2/2] Goal2D: Add class implementation. --- configure.py | 2 +- include/Kameda/Goal2D.h | 124 +++++++-- include/Kameda/SequenceInfo.h | 36 +++ src/Kameda/Goal2D.cpp | 490 +++++++++++++++++++++++++++++++++- 4 files changed, 614 insertions(+), 38 deletions(-) diff --git a/configure.py b/configure.py index 7adc17fd..7fd3ea6e 100755 --- a/configure.py +++ b/configure.py @@ -1082,7 +1082,7 @@ def MatchingFor(*versions): Object(Matching, "Kameda/MotorManager.cpp"), Object(Matching, "Kameda/J2DManager.cpp"), Object(Matching, "Kameda/Task.cpp"), - Object(NonMatching, "Kameda/Goal2D.cpp"), + Object(Matching, "Kameda/Goal2D.cpp"), Object(Matching, "Kameda/PauseManager.cpp"), Object(NonMatching, "Kameda/Pause2D.cpp"), Object(Matching, "Kameda/WipeManager.cpp"), diff --git a/include/Kameda/Goal2D.h b/include/Kameda/Goal2D.h index 1156678f..6d6e36dc 100644 --- a/include/Kameda/Goal2D.h +++ b/include/Kameda/Goal2D.h @@ -1,48 +1,122 @@ #ifndef GOAL2D_H #define GOAL2D_H +#include "JSystem/J2D/J2DGrafContext.h" +#include "JSystem/J2D/J2DPicture.h" +#include "JSystem/J2D/J2DScreen.h" #include "JSystem/JKernel/JKRHeap.h" - #include "JSystem/JORReflexible.h" +#include "Kameda/J2DManager.h" #include "Kaneshige/HioMgr.h" +#include "Kaneshige/RaceMgr.h" - -class Goal2DParam : public JORReflexible { +class Goal2DParam : public JORReflexible +{ public: - // Inline/Unused Goal2DParam(); virtual ~Goal2DParam() {} + + u16 mUnknown; + bool mFlag; }; -class Goal2DHioNode : public HioNode { +class Goal2DHioNode : public HioNode +{ public: - Goal2DHioNode(); + Goal2DHioNode() : HioNode("ゴール", &mParam, 0, 0) {} virtual ~Goal2DHioNode() {} Goal2DParam mParam; }; -class Goal2D { // Autogenerated +class Goal2D +{ public: - Goal2D(JKRHeap *); // 0x80132758 - void init(); // 0x801330ec - void drawGoal(); // 0x80133224 - void drawRetire(); // 0x801333a0 - void calc(); // 0x80133514 - void sequenceGP(); // 0x80133cc8 - void sequenceVS(); // 0x80133cf4 - void sequenceTA(); // 0x80133f58 - void sequenceMG(); // 0x80133f7c - void setVSMGRank(); // 0x80134128 - static bool mDrawEndFlag; // 0x80416290 - // Inline/Unused + Goal2D(JKRHeap *heap); // 0x80132758 ~Goal2D(); + void init(); // 0x801330ec + void drawGoal(); // 0x80133224 + void drawRetire(); // 0x801333a0 + void calc(); // 0x80133514 + void sequenceGP(); // 0x80133cc8 + void sequenceVS(); // 0x80133cf4 + void sequenceTA(); // 0x80133f58 + void sequenceMG(); // 0x80133f7c + void setVSMGRank(); // 0x80134128 + void reset() { init(); } - int getAnmFrame(int status) const { return mAnmFrame[status*4]; } + int getAnmFrame(int status) const { return mViewport[status].mAnmFrame; } + + static bool mDrawEndFlag; // 0x80416290 + + void setRetireAlpha(int i) + { + u8 alpha = 255; + + if (RCMGetManager()->isRaceModeMiniGame()) + { + s32 remainder = mViewport[i].mAnmFrame - 300; + if (remainder < 0) + { + alpha = 255; + } + else if (remainder < 20) + { + alpha = 255 - remainder * 255 / 20; + } + else + { + alpha = 0; + } + } + + u8 hideAlpha; + + int hideFrame = J2DManager::getManager()->getHideFrameRace2D(); + if (hideFrame < 20) + { + hideAlpha = 255 - hideFrame * 255 / 20; + } + else + { + hideAlpha = 0; + } + + if (alpha < hideAlpha) + { + mRetirePicture[i]->setAlpha(alpha); + } + else + { + mRetirePicture[i]->setAlpha(hideAlpha); + } + } + private: - PLACEHOLDER_BYTES(0, 0xb0); - int mAnmFrame[4]; // b0 TODO: check size/is this part of a sub struct - PLACEHOLDER_BYTES(0xc0, 0xec); -}; // class Goal2D -#endif // GOAL2D_H + struct TViewportData + { + f32 mX; // 0x0 + f32 mY; // 0x4 + bool mGoalAnm; // 0x8 + bool mRetireAnm; // 0x9 + s32 mAnmFrame; // 0xc + }; + + Goal2DHioNode *mHioNode; // 0x0 + J2DOrthoGraph *mOrthoGraph[4]; // 0x4 + J2DScreen *mScreen[4]; // 0x14 + J2DAnmTransform *mTransform[4]; // 0x24 + J2DAnmTevRegKey *mTevRegKey[4]; // 0x34 + J2DPicture *mGoalPicture[4][2]; // 0x44 + J2DScreen *mRetireScreen[4]; // 0x64 + J2DAnmTransform *mRetireTransform[4]; // 0x74 + J2DAnmTevRegKey *mRetireTevRegKey[4]; // 0x84 + J2DPicture *mRetirePicture[4]; // 0x94 + TViewportData mViewport[4]; // 0xa4 + u32 _e4; // 0xe4 + bool mVisible; // 0xe8 + u8 _e9; // 0xe9 +}; + +#endif // GOAL2D_H diff --git a/include/Kameda/SequenceInfo.h b/include/Kameda/SequenceInfo.h index d19c317b..2f67624f 100644 --- a/include/Kameda/SequenceInfo.h +++ b/include/Kameda/SequenceInfo.h @@ -91,6 +91,42 @@ class SequenceInfo kartID = mDemoKart[no].kart; } + void set_80_kart(int kart) + { +#line 188 + JUT_MINMAX_ASSERT(0, kart, 4); + int count = _80[kart]; +#line 192 + JUT_MINMAX_ASSERT(0, kart, 4); + if (count + 1 > 99) + { + _80[kart] = 99; + } + else + { + _80[kart] = count + 1; + } + } + + void set_40_kart_rank(int kart, int rank) + { +#line 200 + JUT_MINMAX_ASSERT(0, kart, 4); + JUT_MINMAX_ASSERT(0, rank, 4); + int count = _40[kart][rank]; +#line 205 + JUT_MINMAX_ASSERT(0, kart, 4); + JUT_MINMAX_ASSERT(0, rank, 4); + if (count + 1 > 99) + { + _40[kart][rank] = 99; + } + else + { + _40[kart][rank] = count + 1; + } + } + void set_354(int val) { _354 = val; } void setRaceLevel(ERaceLevel level) { mLevel = level; } void setGhostFlag(u8 flags) { mGhostFlags = flags; } diff --git a/src/Kameda/Goal2D.cpp b/src/Kameda/Goal2D.cpp index 3ddd1760..0520b3f7 100644 --- a/src/Kameda/Goal2D.cpp +++ b/src/Kameda/Goal2D.cpp @@ -1,26 +1,492 @@ #include "Kameda/Goal2D.h" -#include "mathHelper.h" + +#include "JSystem/J2D/J2DAnmLoader.h" +#include "JSystem/JAudio/JASFakeMatch2.h" // For static initializer +#include "JSystem/JGeometry/Vec.h" +#include "JSystem/JKernel/JKRArchive.h" +#include "JSystem/JKernel/JKRFileLoader.h" +#include "JSystem/JUtility/JUTAssert.h" +#include "Kameda/J2DManager.h" +#include "Kameda/PauseManager.h" +#include "Kameda/Result2D.h" +#include "Kameda/SequenceInfo.h" +#include "Kaneshige/KartChecker.h" +#include "Kaneshige/RaceMgr.h" +#include "Osako/system.h" +#include "Sato/JPEffectMgr.h" +#include "kartLocale.h" +#include "mathHelper.h" // For unused data bool Goal2D::mDrawEndFlag = false; -Goal2D::Goal2D(JKRHeap *) {} +Goal2DParam::Goal2DParam() : mUnknown(0), mFlag(true) {} + +Goal2D::Goal2D(JKRHeap *heap) +{ + mHioNode = new (heap, 0) Goal2DHioNode(); + + for (int i = 0; i < 4; ++i) + { + mOrthoGraph[i] = nullptr; + } + + switch (RCMGetManager()->getConsoleNumber()) + { + case 1: + mOrthoGraph[0] = new (heap, 0) J2DOrthoGraph(System::get3DVpX(), + System::get3DVpY(), + System::get3DVpW(), + System::get3DVpH(), + -1.0f, + 1.0f); + mOrthoGraph[0]->scissor(System::get3DScisX(), + System::get3DScisY(), + System::get3DScisW(), + System::get3DScisH()); + mViewport[0].mX = System::get3DVpX(); + mViewport[0].mY = System::get3DVpY(); + break; + case 2: + for (u8 i = 0; i < 2; ++i) + { + mOrthoGraph[i] = new (heap, 0) J2DOrthoGraph(System::get3DVpDiv2X(i), + System::get3DVpDiv2Y(i), + System::get3DVpDiv2W(i), + System::get3DVpDiv2H(i), + -1.0f, + 1.0f); + + mOrthoGraph[i]->setOrtho(System::get3DVpDiv2X(i), + System::get3DVpDiv2Y(i), + 2.0f * System::get3DVpDiv2W(i), + 2.0f * System::get3DVpDiv2H(i), + -1.0f, + 1.0f); + mOrthoGraph[i]->scissor(System::get3DScisDiv2X(i), + System::get3DScisDiv2Y(i), + System::get3DScisDiv2W(i), + System::get3DScisDiv2H(i)); + mViewport[i].mX = System::get3DVpDiv2X(i) + System::get3DVpDiv2W(i) / 2.0f; + mViewport[i].mY = System::get3DVpDiv2Y(i); + } + break; + case 3: + case 4: + for (u8 i = 0; i < 4; ++i) + { + mOrthoGraph[i] = new (heap, 0) J2DOrthoGraph(System::get3DVpDiv4X(i), + System::get3DVpDiv4Y(i), + System::get3DVpDiv4W(i), + System::get3DVpDiv4H(i), + -1.0f, + 1.0f); + mOrthoGraph[i]->setOrtho(System::get3DVpDiv4X(i), + System::get3DVpDiv4Y(i), + 2.0f * System::get3DVpDiv4W(i), + 2.0f * System::get3DVpDiv4H(i), + -1.0f, + 1.0f); + mOrthoGraph[i]->scissor(System::get3DScisDiv4X(i), + System::get3DScisDiv4Y(i), + System::get3DScisDiv4W(i), + System::get3DScisDiv4H(i)); + mViewport[i].mX = System::get3DVpDiv4X(i); + mViewport[i].mY = System::get3DVpDiv4Y(i); + } + break; + default: +#line 121 + JUT_ASSERT(0); + break; + } + + for (int i = 0; i < RCMGetManager()->getConsoleNumber(); ++i) + { + mScreen[i] = new (heap, 0) J2DScreen(); + mScreen[i]->set("goal.blo", 0x40000, J2DManager::getManager()->getArchive()); + + mTransform[i] = (J2DAnmTransform *)J2DAnmLoaderDataBase::load( + JKRFileLoader::getGlbResource("goal.bck", J2DManager::getManager()->getArchive())); + mScreen[i]->setAnimation(mTransform[i]); + + mTevRegKey[i] = (J2DAnmTevRegKey *)J2DAnmLoaderDataBase::load( + JKRFileLoader::getGlbResource("goal.brk", J2DManager::getManager()->getArchive())); + mScreen[i]->setAnimation(mTevRegKey[i]); + } + + for (int i = 0; i < RCMGetManager()->getConsoleNumber(); ++i) + { + mRetireScreen[i] = new (heap, 0) J2DScreen(); + mRetireScreen[i]->set("retire.blo", 0x40000, J2DManager::getManager()->getArchive()); + + mRetireTransform[i] = (J2DAnmTransform *)J2DAnmLoaderDataBase::load( + JKRFileLoader::getGlbResource("retire.bck", J2DManager::getManager()->getArchive())); + mRetireScreen[i]->setAnimation(mRetireTransform[i]); + + mRetireTevRegKey[i] = (J2DAnmTevRegKey *)J2DAnmLoaderDataBase::load( + JKRFileLoader::getGlbResource("retire.brk", J2DManager::getManager()->getArchive())); + mRetireScreen[i]->setAnimation(mRetireTevRegKey[i]); + } + + for (int i = 0; i < RCMGetManager()->getConsoleNumber(); ++i) + { + for (int j = 0; j < 2; ++j) + { + J2DPane *pane = mScreen[i]->search('PICT_001' + j); +#line 158 + JUT_ASSERT(pane->getTypeID() == J2DPane_Picture); + + mGoalPicture[i][j] = (J2DPicture *)pane; + + if (RCMGetManager()->isRaceModeMiniGame()) + { + mGoalPicture[i][j]->changeTexture("MiniGame2DWin00.bti", 0); + } + } + } + + for (int i = 0; i < RCMGetManager()->getConsoleNumber(); ++i) + { + J2DPane *pane = mRetireScreen[i]->search('Retire00'); +#line 170 + JUT_ASSERT(pane->getTypeID() == J2DPane_Picture); + + mRetirePicture[i] = (J2DPicture *)pane; + + if (RCMGetManager()->isRaceModeMiniGame()) + { + mRetirePicture[i]->changeTexture("MiniGame2DLose00.bti", 0); + mRetireScreen[i]->search('RetireB')->hide(); + } + } + + init(); +} + +void Goal2D::init() +{ + for (int i = 0; i < RCMGetManager()->getStatusNumber(); ++i) + { + mViewport[i].mGoalAnm = false; + mViewport[i].mRetireAnm = false; + mViewport[i].mAnmFrame = 0; + + mTransform[i]->setFrame(0.0f); + mTevRegKey[i]->setFrame(0.0f); + mScreen[i]->animation(); + + mRetireTransform[i]->setFrame(0.0f); + mRetireTevRegKey[i]->setFrame(0.0f); + mRetireScreen[i]->animation(); + } + + _e4 = 0; + mVisible = false; + mDrawEndFlag = false; + _e9 = 0; +} + +Goal2D::~Goal2D() +{ + delete mHioNode; + // Symbol not available; implementation incomplete. +} + +void Goal2D::drawGoal() +{ + if (mHioNode->mParam.mFlag & 1 && RCMGetManager()->getRacePhase() != PHASE_CRS_DEMO && + !RCMGetManager()->isReplayMode() && !RCMGetManager()->mRaceInfo->isWaitDemo() && mVisible) + { + for (int i = 0; i < RCMGetManager()->getStatusNumber(); ++i) + { + int kart = J2DManager::getManager()->getStatus2Kart(i); + KartChecker *kartChecker = RCMGetManager()->getKartChecker(kart); + + if (!kartChecker->isGoal() && !J2DManager::getManager()->mWinnerAnmFlag[kart]) + { + continue; + } + + if (mViewport[i].mRetireAnm) + { + mOrthoGraph[i]->setPort(); + mScreen[i]->draw(mViewport[i].mX, mViewport[i].mY, mOrthoGraph[i]); + } + } + } +} + +void Goal2D::drawRetire() +{ + if (!mDrawEndFlag && mHioNode->mParam.mFlag & 1 && + RCMGetManager()->getRacePhase() != PHASE_CRS_DEMO && !RCMGetManager()->isReplayMode() && + !RCMGetManager()->mRaceInfo->isWaitDemo() && mVisible) + { + for (int i = 0; i < RCMGetManager()->getStatusNumber(); ++i) + { + KartChecker *kartChecker = + RCMGetManager()->getKartChecker(J2DManager::getManager()->getStatus2Kart(i)); + + if (!kartChecker->isGoal() && mViewport[i].mRetireAnm) + { + mOrthoGraph[i]->setPort(); + mRetireScreen[i]->draw(mViewport[i].mX, mViewport[i].mY, mOrthoGraph[i]); + } + } + } +} + +void Goal2D::calc() +{ + if (mDrawEndFlag) + return; + + int finishedViewportCount = 0; + int activeViewportCount = 0; + + for (int i = 0; i < RCMGetManager()->getStatusNumber(); ++i) + { + int kart = J2DManager::getManager()->getStatus2Kart(i); + KartChecker *kartChecker = RCMGetManager()->getKartChecker(kart); + + if (!kartChecker->isGoal() && !J2DManager::getManager()->mWinnerAnmFlag[kart] && + !J2DManager::getManager()->mLoserAnmFlag[kart]) + { + continue; + } + + mVisible = true; + + if (mViewport[i].mAnmFrame < 128) + { + mViewport[i].mGoalAnm = true; + mViewport[i].mRetireAnm = true; + } + + if (mViewport[i].mAnmFrame == 0 && J2DManager::getManager()->mAnmFrame > 1 && + RCMGetManager()->getRaceMode() == VERSUS_RACE) + { + mViewport[i].mAnmFrame = 128; + break; + } + + ++mViewport[i].mAnmFrame; + + if (J2DManager::getManager()->mAnmFrame < 70 && !RCMGetManager()->isRaceModeMiniGame() && + mViewport[i].mAnmFrame == 70) + { + mViewport[i].mAnmFrame = 69; + } + + if (kartChecker->isGoal() || J2DManager::getManager()->mWinnerAnmFlag[kart]) + { + mTransform[i]->setFrame((f32)mViewport[i].mAnmFrame); + mTevRegKey[i]->setFrame((f32)mViewport[i].mAnmFrame); + mScreen[i]->animation(); + + if (RCMGetManager()->getConsoleNumber() == 2) + { + for (int j = 0; j < 2; ++j) + { + J2DPane *pane = mGoalPicture[i][j]; + pane->updateScale(pane->mScale.x * 1.8f, pane->mScale.y * 1.8f); + } + } + } + else + { + mRetireTransform[i]->setFrame((f32)mViewport[i].mAnmFrame); + mRetireTevRegKey[i]->setFrame((f32)mViewport[i].mAnmFrame); + mRetireScreen[i]->animation(); + + if (RCMGetManager()->getConsoleNumber() == 2) + { + J2DPane *pane = mRetirePicture[i]; + pane->updateScale(pane->mScale.x * 1.4f, pane->mScale.y * 1.4f); + } + + setRetireAlpha(i); + + if (mViewport[i].mAnmFrame == 1) + { + JGeometry::TVec3f pos(0.0f, 0.0f, 0.0f); + + f32 scaleX, scaleY, scaleZ; + scaleX = scaleY = scaleZ = 1.0f; + + switch (RCMGetManager()->getConsoleNumber()) + { + case 1: + pos.set(304.0f, 260.0f, 0.0f); + break; + case 2: + scaleX = scaleY = scaleZ = 0.7f; + if (i == 0) + { + pos.set(304.0f, 130.0f, 0.0f); + } + else + { + pos.set(304.0f, 355.0f, 0.0f); + } + break; + case 3: + case 4: + scaleX = scaleY = scaleZ = 0.5f; + switch (i) + { + case 0: + pos.set(152.0f, 130.0f, 0.0f); + break; + case 1: + pos.set(456.0f, 130.0f, 0.0f); + break; + case 2: + pos.set(152.0f, 355.0f, 0.0f); + break; + case 3: + pos.set(456.0f, 355.0f, 0.0f); + break; + default: +#line 415 + JUT_ASSERT(0); + break; + } + break; + default: +#line 419 + JUT_ASSERT(0); + break; + } + + JPABaseEmitter *emitter = nullptr; + + switch (KartLocale::getLanguage()) + { + case ENGLISH: + case FRENCH: + if (!J2DManager::getManager()->isLANDemo()) + { + emitter = GetJPAMgr()->createEmt2D("mk_2D_retire_b", pos); + } + break; + case GERMAN: + case ITALIAN: + case SPANISH: + if (!J2DManager::getManager()->isLANDemo()) + { + emitter = GetJPAMgr()->createEmt2D("mk_2D_retire_c", pos); + } + break; + case JAPANESE: + if (!J2DManager::getManager()->isLANDemo()) + { + emitter = GetJPAMgr()->createEmt2D("mk_2D_retire_a", pos); + } + break; + default: +#line 443 + JUT_ASSERT(0); + break; + } + + if (emitter != nullptr) + { + emitter->mGlobalScl.set(scaleY, scaleX, scaleY); + emitter->mGlobalPScl.set(scaleZ, scaleX); + } + } + } + + ++activeViewportCount; + if (mViewport[i].mAnmFrame >= 128) + { + ++finishedViewportCount; + } + } + + if (!RCMGetManager()->isLANMode() && RCMGetManager()->isRaceEnd() && + finishedViewportCount == activeViewportCount && + PauseManager::getManager()->isResultStart() && J2DManager::getManager()->isRaceEnd()) + { + mDrawEndFlag = true; + + if (!RCMGetManager()->isReplayMode()) + { + switch (RCMGetManager()->getRaceMode()) + { + case TIME_ATTACK: + sequenceTA(); + break; + case GRAND_PRIX: + sequenceGP(); + break; + case VERSUS_RACE: + sequenceVS(); + break; + case BALLOON_BATTLE: + case BOMB_BATTLE: + case ESCAPE_BATTLE: + sequenceMG(); + break; + default: +#line 485 + JUT_ASSERT(0); + break; + } + } + } +} -void Goal2D::init() {} +void Goal2D::sequenceGP() +{ + Result2D::setGPClr(); + gSequenceInfo.setClrGPCourse(); +} -void Goal2D::drawGoal() {} +void Goal2D::sequenceVS() +{ + setVSMGRank(); -void Goal2D::drawRetire() {} + for (int i = 0; i < RCMGetManager()->getStatusNumber(); ++i) + { + int kart = J2DManager::getManager()->getStatus2Kart(i); + int rank = RaceMgr::sRaceManager->getKartChecker(kart)->getRank() - 1; -void Goal2D::calc() {} + gSequenceInfo.set_40_kart_rank(kart, rank); + } +} -void Goal2D::sequenceGP() {} +void Goal2D::sequenceTA() +{ + PauseManager::getManager()->setTA(); +} -void Goal2D::sequenceVS() {} +void Goal2D::sequenceMG() +{ + setVSMGRank(); -void Goal2D::sequenceTA() {} + for (int i = 0; i < RCMGetManager()->getStatusNumber(); ++i) + { + int kart = J2DManager::getManager()->getStatus2Kart(i); -void Goal2D::sequenceMG() {} + if (RCMGetManager()->getKartChecker(kart)->getRank() - 1 == 0) + { + gSequenceInfo.set_80_kart(kart); + } + } +} -void Goal2D::setVSMGRank() {} +void Goal2D::setVSMGRank() +{ + for (int i = 0; i < RCMGetManager()->getStatusNumber(); ++i) + { + int kart = J2DManager::getManager()->getStatus2Kart(i); + int rank = RCMGetManager()->getKartChecker(kart)->getRank() - 1; -#include "JSystem/JAudio/JASFakeMatch2.h" + if (rank >= 0 && rank < RCMGetManager()->getStatusNumber()) + { + gSequenceInfo.setStartNo(kart, rank); + } + } +}