1#include <game/bases/d_next.hpp>
2#include <game/bases/d_actor.hpp>
3#include <game/bases/d_a_player_manager.hpp>
5#include <game/bases/d_cd.hpp>
6#include <game/bases/d_s_stage.hpp>
7#include <game/bases/d_s_world_map_static.hpp>
8#include <game/bases/d_snd_scene_mgr.hpp>
9#include <game/mLib/m_heap.hpp>
49 dCdFile_c *file = dCd_c::m_instance->getFileP(fileIdx);
53 if (destFile == 255) {
59 mNextGotoData.mDestID = dCd_c::m_instance->getFileP(fileIdx)->mpOptions->mInitialNextGotoID;
65 dCdFile_c *file = dCd_c::m_instance->getFileP(fileIdx);
72 if (destFile == 255) {
83 dCdFile_c *file = dCd_c::m_instance->getFileP(fileIdx);
87 for (
int i = 0; i < file->mNextGotoCount; i++) {
88 if (!(curr->
mFlags & NEXT_GOTO_FLAG_ONLY_EXIT)) {
90 switch (curr->
mType) {
91 case NEXT_GOTO_TYPE_14:
92 case NEXT_GOTO_TYPE_MINI_PIPE_U:
93 case NEXT_GOTO_TYPE_MINI_PIPE_D:
94 case NEXT_GOTO_TYPE_MINI_PIPE_L:
95 case NEXT_GOTO_TYPE_MINI_PIPE_R:
96 nextGotoSize.set(16.0f, 16.0f);
98 case NEXT_GOTO_TYPE_15:
99 nextGotoSize.set(48.0f, 16.0f);
101 case NEXT_GOTO_TYPE_PIPE_L:
102 case NEXT_GOTO_TYPE_PIPE_R:
103 nextGotoSize.set(16.0f, 32.0f);
105 case NEXT_GOTO_TYPE_WATER_TANK:
106 nextGotoSize.set(32.0f, 32.0f);
109 nextGotoSize.set(32.0f, 16.0f);
113 float gdX = curr->mX;
114 float gdY = curr->mY;
116 gdX <= pos.x && pos.x < gdX + nextGotoSize.x &&
117 gdY <= pos.y && pos.y < gdY + nextGotoSize.y
138 dCdFile_c *file = dCd_c::m_instance->getFileP(destFile);
156 u8 world = stage->getCurrWorld();
158 if (dScStage_c::m_gameMode == dInfo_c::GAME_MODE_HINT_MOVIE) {
159 dFader_c::setFader(dFader_c::CIRCLE_MIDDLE);
165 dScStage_c::m_exitMode = dScStage_c::EXIT_0;
166 dScWMap_c::setNextWorldScene(world, dScWMap_c::m_SceneNo, 0);
174 }
else if (data->mArea != stage->mCurrArea) {
180 u8 bgm = file->getAreaBgm(data->mArea);
181 dAudio::setMainBgmNo(bgm);
182 u8 mode = file->getAreaBgmMode(data->mArea);
183 dAudio::setBgmMode(mode & 0x0F);
184 SndSceneMgr::sInstance->FUN_8019d5b0(mode >> 4);
190 dScStage_c::m_exitMode = dScStage_c::EXIT_3;
static u8 mExecStopReq
The actors for which the execute operation is requested to be disabled.
@ STAGE_ACTOR_GENERIC
A generic stage actor (default).
@ STAGE_ACTOR_ENEMY
An enemy actor.
@ STAGE_ACTOR_YOSHI
The Yoshi actor.
@ STAGE_ACTOR_PLAYER
The player actor.
Course data file holder. A course data file contains the actual course elements - areas,...
Manager for scene changes triggered by entrances.
bool isNextDifferent(u8 fileIdx, u8 nextGoto)
Returns whether the currently saved entrance is different from the given one.
void changeScene()
Go to the next scene using the data in mNextGotoData.
static dNext_c * m_instance
The singleton instance of this class.
bool mStartSceneChange
Whether a scene change should be performed next time execute() is called.
void simpleChangeScene(u8 destNextGoto, dFader_c::fader_type_e faderType)
Move to a new entrance in the same file.
@ NEXT_DIFFERENT_FILE
The next entrance is in a different file.
@ NEXT_DIFFERENT_AREA
The next entrance is in a different area of the same file.
@ NEXT_SAME_AREA
The next entrance is in the same area.
void setOwnNextData(u8 fileIdx, u8 nextGoto)
Sets the entrance data for the next scene change.
static void deleteInstance()
Deletes the class instance.
SceneChangeType_e mSceneChangeType
The type of scene change to do when going to the next entrance.
bool searchNextNum(u8 fileIdx, float x, float y, int *foundNum)
Search for a next entrance at the given coordinates in the given file.
sNextGotoData mNextGotoData
The data for the entrance the player activated.
void setChangeSceneNextDat(u8 fileIdx, u8 nextGoto, dFader_c::fader_type_e faderType)
Updates the saved entrance data for the next scene change if not already set.
void execute()
Checks for scene changes and executes them when necessary.
u16 mMultiplayerDelay
Number of frames to delay the scene change in multiplayer mode.
bool mNextDataSet
Whether the entrance data for the next scene change has been set.
bool mSceneChangeDone
Whether the scene change has been performed.
dFader_c::fader_type_e mFaderType
The type of fader to use for the scene change.
static const int smc_MULTIPLAYER_SCENE_CHANGE_DELAY
The number of frames to delay scene changes in multiplayer mode.
void initialize()
Resets the class to its initial state.
static void createInstance(EGG::Heap *heap)
Creates a class instance on the given heap.
dNext_c()
Constructs a new dNext_c.
static bool m_isCourseOut
Whether the game is transitioning from a stage scene to a non-stage scene.
static void setNextScene(ProfileName nextScene, unsigned long param, bool forceChange)
Attempts to prepare the transition to a new scene.
A two-dimensional floating point vector.
EGG::Heap * setCurrentHeap(EGG::Heap *heap)
Sets the specified heap as the current heap.
u8 mType
See NextGotoType_e.
u16 mFlags
See NextGotoFlags_e.
u8 mDestFile
0 = same file, others are 1-indexed.