NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
Loading...
Searching...
No Matches
d_scene.hpp
1#pragma once
2#include <game/bases/d_base.hpp>
4#include <game/sLib/s_Phase.hpp>
5
6/// @brief The minimum required implementation for a scene base.
7/// @ingroup bases
8class dScene_c : public dBase_c {
9public:
10 dScene_c(); ///< Creates a new scene.
11 ~dScene_c(); ///< Destroys the scene.
12
13 virtual int preCreate();
14
15 /// @copybrief fBase_c::postCreate
16 /// @details Appends a LASTACTOR child base to this scene.
17 virtual void postCreate(fBase_c::MAIN_STATE_e status);
18
19 virtual int preDelete();
20 virtual void postDelete(fBase_c::MAIN_STATE_e status);
21
22 /// @copybrief fBase_c::preExecute
23 /// @details If ::m_nextScene is set, prepares to transition to the next scene.
24 /// Once all initial child bases have been added, the execute and draw operations are enabled on this base
25 /// and its children.
26 virtual int preExecute();
27 virtual void postExecute(fBase_c::MAIN_STATE_e status);
28
29 virtual int preDraw();
30 virtual void postDraw(fBase_c::MAIN_STATE_e status);
31
32 static void setStartScene(); ///< Sets up the scene to be shown when the game boots up.
33 static void setResetScene(); ///< Sets up the scene to be shown after a game reset.
34 static dScene_c *createNextScene(); ///< Creates and returns a root base for the next scene.
35
36 /// @brief Attempts to prepare the transition to a new scene.
37 /// @details If the game is resetting, the transition is not performed unless forceChange is @p true.
38 /// @param nextScene The next scene's profile name.
39 /// @param param The next scene's parameters.
40 /// @param forceChange If the transition should always be performed.
41 static void setNextScene(ProfileName nextScene, unsigned long param, bool forceChange);
42
43 /// @brief Sets the duration of the next fade-in transition to @p length.
44 static void setFadeInFrame(unsigned short length);
45
46 /// @brief Sets the duration of the next fade-out transition to @p length.
47 static void setFadeOutFrame(unsigned short length);
48
49 /// @brief Sets the duration of the next fade-in and fade-out transitions to @p length.
50 static void setFadeInOutFrame(unsigned short length);
51
52 sPhase_c *mpPhase; ///< The phase used for scene initialization.
53
54 static u32 mPara; ///< The parameters for the next scene.
55 static ProfileName m_nextScene; ///< The profile name of the next scene.
56 static ProfileName m_nowScene; ///< The profile name of the current scene.
57 static ProfileName m_oldScene; ///< The profile name of the previous scene.
58 static bool m_otherSceneFlg; ///< Whether the next scene has already been created.
59
60 static u16 m_fadeInFrame; ///< The duration of the next fade-in.
61 static u16 m_fadeOutFrame; ///< The duration of the next fade-out.
62 static bool m_isAutoFadeIn; ///< If a fade-in should automatically be performed on scene load.
63};
dBase_c()
Constructs a new base.
Definition d_base.cpp:13
virtual int preExecute()
pre method for the execute operation.
Definition d_scene.cpp:77
static void setFadeInFrame(unsigned short length)
Sets the duration of the next fade-in transition to length.
Definition d_scene.cpp:184
static void setStartScene()
Sets up the scene to be shown when the game boots up.
Definition d_scene.cpp:133
~dScene_c()
Destroys the scene.
Definition d_scene.cpp:37
virtual void postExecute(fBase_c::MAIN_STATE_e status)
post method for the execute operation.
Definition d_scene.cpp:115
virtual void postDelete(fBase_c::MAIN_STATE_e status)
post method for the delete operation.
Definition d_scene.cpp:69
static dScene_c * createNextScene()
Creates and returns a root base for the next scene.
Definition d_scene.cpp:145
virtual int preDraw()
pre method for the draw operation.
Definition d_scene.cpp:122
static void setFadeOutFrame(unsigned short length)
Sets the duration of the next fade-out transition to length.
Definition d_scene.cpp:188
virtual void postDraw(fBase_c::MAIN_STATE_e status)
post method for the draw operation.
Definition d_scene.cpp:129
static bool m_isAutoFadeIn
If a fade-in should automatically be performed on scene load.
Definition d_scene.hpp:62
dScene_c()
Creates a new scene.
Definition d_scene.cpp:23
virtual void postCreate(fBase_c::MAIN_STATE_e status)
post method for the create operation.
Definition d_scene.cpp:53
sPhase_c * mpPhase
The phase used for scene initialization.
Definition d_scene.hpp:52
static ProfileName m_nextScene
The profile name of the next scene.
Definition d_scene.hpp:55
virtual int preDelete()
pre method for the delete operation.
Definition d_scene.cpp:62
static u16 m_fadeInFrame
The duration of the next fade-in.
Definition d_scene.hpp:60
static bool m_otherSceneFlg
Whether the next scene has already been created.
Definition d_scene.hpp:58
static void setResetScene()
Sets up the scene to be shown after a game reset.
Definition d_scene.cpp:141
static u32 mPara
The parameters for the next scene.
Definition d_scene.hpp:54
static ProfileName m_nowScene
The profile name of the current scene.
Definition d_scene.hpp:56
virtual int preCreate()
pre method for the create operation.
Definition d_scene.cpp:44
static u16 m_fadeOutFrame
The duration of the next fade-out.
Definition d_scene.hpp:61
static void setFadeInOutFrame(unsigned short length)
Sets the duration of the next fade-in and fade-out transitions to length.
Definition d_scene.cpp:192
static void setNextScene(ProfileName nextScene, unsigned long param, bool forceChange)
Attempts to prepare the transition to a new scene.
Definition d_scene.cpp:162
static ProfileName m_oldScene
The profile name of the previous scene.
Definition d_scene.hpp:57
MAIN_STATE_e
The possible operation results.
Definition f_base.hpp:30
A phase is a list of methods to be called in order.
Definition s_Phase.hpp:5
u16 ProfileName
The name of a profile. Value is a fProfile::PROFILE_NAME_e.
Definition f_profile.hpp:32