NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
Loading...
Searching...
No Matches

#include <game/bases/d_next.hpp>

Description

Manager for scene changes triggered by entrances.

Definition at line 8 of file d_next.hpp.

Public Types

enum  SceneChangeType_e {
  NEXT_DIFFERENT_FILE ,
  NEXT_DIFFERENT_AREA ,
  NEXT_SAME_AREA
}
 The different types of scene changes. More...

Public Member Functions

 dNext_c ()
 Constructs a new dNext_c.
void initialize ()
 Resets the class to its initial state.
void execute ()
 Checks for scene changes and executes them when necessary.
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 setOwnNextData (u8 fileIdx, u8 nextGoto)
 Sets the entrance data for the next scene change.
bool isNextDifferent (u8 fileIdx, u8 nextGoto)
 Returns whether the currently saved entrance is different from the given one.
bool searchNextNum (u8 fileIdx, float x, float y, int *foundNum)
 Search for a next entrance at the given coordinates in the given file.
void simpleChangeScene (u8 destNextGoto, dFader_c::fader_type_e faderType)
 Move to a new entrance in the same file.
void simpleChangeScene (u8 destFile, u8 destNextGoto, dFader_c::fader_type_e faderType)
 Move to a new entrance in any file.
void changeScene ()
 Go to the next scene using the data in mNextGotoData.

Static Public Member Functions

static void createInstance (EGG::Heap *heap)
 Creates a class instance on the given heap.
static void deleteInstance ()
 Deletes the class instance.

Public Attributes

sNextGotoData mNextGotoData
 The data for the entrance the player activated.
SceneChangeType_e mSceneChangeType
 The type of scene change to do when going to the next entrance.
bool mNextDataSet
 Whether the entrance data for the next scene change has been set.
bool mStartSceneChange
 Whether a scene change should be performed next time execute() is called.
bool mSceneChangeDone
 Whether the scene change has been performed.
u16 mMultiplayerDelay
 Number of frames to delay the scene change in multiplayer mode.
dFader_c::fader_type_e mFaderType
 The type of fader to use for the scene change.

Static Public Attributes

static dNext_cm_instance
 The singleton instance of this class.
static const int smc_MULTIPLAYER_SCENE_CHANGE_DELAY = 180
 The number of frames to delay scene changes in multiplayer mode.

Member Enumeration Documentation

◆ SceneChangeType_e

The different types of scene changes.

Enumerator
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.

Definition at line 12 of file d_next.hpp.

Constructor & Destructor Documentation

◆ dNext_c()

dNext_c::dNext_c ( )

Constructs a new dNext_c.

Definition at line 13 of file d_next.cpp.

Member Function Documentation

◆ initialize()

void dNext_c::initialize ( )

Resets the class to its initial state.

Definition at line 32 of file d_next.cpp.

◆ execute()

void dNext_c::execute ( )

Checks for scene changes and executes them when necessary.

Definition at line 194 of file d_next.cpp.

◆ setChangeSceneNextDat()

void dNext_c::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.

Parameters
fileIdxThe file index of the entrance to set.
nextGotoThe ID of the entrance to set.
faderTypeThe type of fader to use for the scene change.

Definition at line 39 of file d_next.cpp.

◆ setOwnNextData()

void dNext_c::setOwnNextData ( u8 fileIdx,
u8 nextGoto )

Sets the entrance data for the next scene change.

Parameters
fileIdxThe file index of the entrance to set.
nextGotoThe ID of the entrance to set.

Definition at line 48 of file d_next.cpp.

◆ isNextDifferent()

bool dNext_c::isNextDifferent ( u8 fileIdx,
u8 nextGoto )

Returns whether the currently saved entrance is different from the given one.

Parameters
fileIdxThe file index of the entrance to compare to.
nextGotoThe ID of the entrance to compare to.
Returns
Whether the currently saved entrance is different from the given one.

Definition at line 63 of file d_next.cpp.

◆ searchNextNum()

bool dNext_c::searchNextNum ( u8 fileIdx,
float x,
float y,
int * foundNum )

Search for a next entrance at the given coordinates in the given file.

Parameters
fileIdxThe file to search in.
xThe x coordinate to search at.
yThe y coordinate to search at.
foundNumPointer to write the found next entrance's ID to.
Returns
Whether a next entrance was found at the given coordinates.

Definition at line 82 of file d_next.cpp.

◆ simpleChangeScene() [1/2]

void dNext_c::simpleChangeScene ( u8 destNextGoto,
dFader_c::fader_type_e faderType )

Move to a new entrance in the same file.

Parameters
destNextGotoThe new entrance to go to.
faderTypeThe type of fader to use for the scene change.

Definition at line 129 of file d_next.cpp.

◆ simpleChangeScene() [2/2]

void dNext_c::simpleChangeScene ( u8 destFile,
u8 destNextGoto,
dFader_c::fader_type_e faderType )

Move to a new entrance in any file.

Parameters
destFileThe file to go to.
destNextGotoThe entrance in that file to go to.
faderTypeThe type of fader to use for the scene change.

Definition at line 133 of file d_next.cpp.

◆ changeScene()

void dNext_c::changeScene ( )

Go to the next scene using the data in mNextGotoData.

Definition at line 150 of file d_next.cpp.

◆ createInstance()

void dNext_c::createInstance ( EGG::Heap * heap)
static

Creates a class instance on the given heap.

Definition at line 17 of file d_next.cpp.

◆ deleteInstance()

void dNext_c::deleteInstance ( )
static

Deletes the class instance.

Definition at line 23 of file d_next.cpp.

Member Data Documentation

◆ mNextGotoData

sNextGotoData dNext_c::mNextGotoData

The data for the entrance the player activated.

Definition at line 66 of file d_next.hpp.

◆ mSceneChangeType

SceneChangeType_e dNext_c::mSceneChangeType

The type of scene change to do when going to the next entrance.

Definition at line 67 of file d_next.hpp.

◆ mNextDataSet

bool dNext_c::mNextDataSet

Whether the entrance data for the next scene change has been set.

Definition at line 68 of file d_next.hpp.

◆ mStartSceneChange

bool dNext_c::mStartSceneChange

Whether a scene change should be performed next time execute() is called.

Definition at line 69 of file d_next.hpp.

◆ mSceneChangeDone

bool dNext_c::mSceneChangeDone

Whether the scene change has been performed.

Definition at line 70 of file d_next.hpp.

◆ mMultiplayerDelay

u16 dNext_c::mMultiplayerDelay

Number of frames to delay the scene change in multiplayer mode.

Definition at line 71 of file d_next.hpp.

◆ mFaderType

dFader_c::fader_type_e dNext_c::mFaderType

The type of fader to use for the scene change.

Definition at line 72 of file d_next.hpp.

◆ m_instance

dNext_c * dNext_c::m_instance
static

The singleton instance of this class.

Definition at line 74 of file d_next.hpp.

◆ smc_MULTIPLAYER_SCENE_CHANGE_DELAY

const int dNext_c::smc_MULTIPLAYER_SCENE_CHANGE_DELAY = 180
static

The number of frames to delay scene changes in multiplayer mode.

Definition at line 77 of file d_next.hpp.