NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
|
#include <game/bases/d_wm_actor.hpp>
The minimum required implementation for a world map actor.
dWmActor_c serves as the base for all map actors (Wm stands for World Map). It is typically not used directly, unless the actor's sole purpose is for background tasks or unconditional 3D model rendering. For more complex behaviors, it is recommended to use dWmDemoActor_c and its sub-implementations, which enable the actor to respond to world map events and more.
Map actors can be created by calling one of the two construct methods, which define two additional arguments to provide the starting position and rotation. A parent base can optionally be provided.
The following operation changes have been made:
WM_CS_SEQ_MNG
, WM_ISLAND
and WM_DIRECTOR
are the only actors allowed to keep running while the menu is open.The game uses a bounding sphere to perform frustum culling on the actor.
If the actor's bounding sphere is not within the camera view, it will not be rendered. This behaviour can be controlled by setting the sphere's radius (which must be done manually). If the radius is set to 0.0f
(the default value), the check is bypassed and the actor is always drawn. The sphere's position is updated automatically.
Wrappers to adjust the model lighting are provided for convenience. See dGameCom for details.
Definition at line 50 of file d_wm_actor.hpp.
Private Member Functions | |
dWmActor_c () | |
Constructs a new actor. | |
virtual int | preCreate () |
pre method for the create operation. | |
virtual void | postCreate (fBase_c::MAIN_STATE_e status) |
post method for the create operation. | |
virtual int | preDelete () |
pre method for the delete operation. | |
virtual void | postDelete (fBase_c::MAIN_STATE_e status) |
post method for the delete operation. | |
virtual int | preExecute () |
pre method for the execute operation. | |
virtual void | postExecute (fBase_c::MAIN_STATE_e status) |
post method for the execute operation. | |
virtual int | preDraw () |
pre method for the draw operation. | |
virtual void | postDraw (fBase_c::MAIN_STATE_e status) |
post method for the draw operation. | |
virtual | ~dWmActor_c () |
Destroys the actor. | |
virtual int | GetActorType () |
Gets the actor kind. See ACTOR_KIND_e. | |
Static Private Member Functions | |
static dWmActor_c * | construct (ProfileName profName, unsigned long param, const mVec3_c *position, const mAng3_c *rotation) |
Creates a world map actor without a parent. See dBaseActor_c::construct. | |
static dWmActor_c * | construct (ProfileName profName, dBase_c *base, unsigned long param, const mVec3_c *position, const mAng3_c *rotation) |
Creates a child world map actor with the given parent. See dBaseActor_c::construct. | |
static void | setSoftLight_Map (m3d::bmdl_c &mdl) |
Sets the soft light effect for map actors. | |
static void | setSoftLight_MapObj (m3d::bmdl_c &mdl) |
Sets the soft light effect for map objects. | |
static void | setSoftLight_Enemy (m3d::bmdl_c &mdl) |
Sets the soft light effect for enemies. | |
static void | setSoftLight_Boss (m3d::bmdl_c &mdl) |
Sets the soft light effect for bosses. | |
Private Attributes | |
mSphere_c | mCullSphere |
A sphere representing the actor's visible area. | |
Additional Inherited Members | |
Public Types inherited from dBaseActor_c | |
enum | ACTOR_KIND_e { ACTOR_MAP_GENERIC , ACTOR_MAP_DEMO , ACTOR_MAP_OBJECT , ACTOR_MAP_ENEMY , ACTOR_MAP_PLAYER , ACTOR_MAP_STOP , ACTOR_UNK_6 , ACTOR_MENU_PLAYER , ACTOR_GENERIC } |
An identifier that represents the actor's kind. More... | |
Public Types inherited from fBase_c | |
enum | LIFECYCLE_e { CREATING , ACTIVE , DELETING } |
The possible lifecycle states. More... | |
enum | GROUP_TYPE_e { OTHER , SCENE , ACTOR } |
The possible group types. More... | |
enum | MAIN_STATE_e { CANCELED , ERROR , SUCCESS , WAITING } |
The possible operation results. More... | |
enum | PACK_RESULT_e { NOT_READY , SUCCEEDED , FAILED } |
The possible operation step results. More... | |
enum | PROC_DISABLE_e { ROOT_DISABLE_EXECUTE = BIT_FLAG(0) , DISABLE_EXECUTE = BIT_FLAG(1) , ROOT_DISABLE_DRAW = BIT_FLAG(2) , DISABLE_DRAW = BIT_FLAG(3) } |
Controls if the execute and draw operations should be skipped. More... | |
Public Member Functions inherited from dBaseActor_c | |
dBaseActor_c () | |
Constructs a new actor. | |
void | calcSpeed () |
Updates the actor's speed (3D actors). See here for details. | |
void | calcSpeedXY () |
Updates the actor's speed (2D actors). See here for details. | |
void | calcSpeedX () |
Updates the actor's X speed. See here for details. | |
void | calcFallSpeed () |
Updates the actor's falling speed. See here for details. | |
void | calcSpeedY () |
Updates the actor's Y speed. See here for details. | |
void | calcSpeedF () |
Updates the actor's forward speed. See here for details. | |
void | makeMtx () |
Generates a partial transformation matrix for the actor and stores it in mMatrix. | |
mVec3_c | getCenterPos () const |
Gets the actor's centered position. | |
void | posMove (mVec3_c &delta) |
Moves the actor by the given delta. | |
void | posMove () |
Moves the actor by its speed. | |
int | GetProfNameActorNum (ProfileName profile) |
Counts the instances of the given actor profile. | |
Public Member Functions inherited from dBase_c | |
dBase_c () | |
Constructs a new base. | |
virtual | ~dBase_c () |
Destroys the base. | |
virtual const char * | getKindString () const |
Gets the base's kind string. | |
Public Member Functions inherited from fBase_c | |
fBase_c () | |
Constructs a new base. | |
void | deleteRequest () |
Requests deletion of the base. | |
fBase_c * | getConnectParent () const |
Gets the base's parent. | |
fBase_c * | getConnectChild () const |
Gets the base's first child. | |
fBase_c * | getConnectBrNext () const |
Gets the base's next sibling. | |
bool | checkChildProcessCreateState () const |
Checks if the base has at least one child in the CREATING state. | |
Public Member Functions inherited from cOwnerSetMg_c | |
cOwnerSetMg_c () | |
Constructs a new set container. | |
~cOwnerSetMg_c () | |
Destroys the set. | |
void | add (cOwnerSetNd_c *nd, void *owner) |
Adds a node to the set. | |
void | remove (cOwnerSetNd_c *nd, void *owner) |
Removes a node from the set. | |
Static Public Member Functions inherited from dBaseActor_c | |
static void | draw2DActorOnLyt1 () |
Calls draw2D on every actor. | |
static void | draw2DActorOnLyt2 () |
Calls draw2D_lyt2 on every actor. | |
static dBaseActor_c * | construct (ProfileName profName, unsigned long param, const mVec3_c *position, const mAng3_c *rotation) |
Creates an actor without a parent. | |
static dBaseActor_c * | construct (ProfileName profName, dBase_c *parent, unsigned long param, const mVec3_c *position, const mAng3_c *rotation) |
Creates a child actor with the given parent. | |
Static Public Member Functions inherited from dBase_c | |
static dBase_c * | searchBaseByProfName (ProfileName profile, const dBase_c *parent) |
Searches for a base with a given profile name, optionally under a given parent. | |
static void | initLoader () |
[Unused]. Sets the callbacks for the scrapped relocatable profile system. | |
static dBase_c * | createBase (ProfileName profName, dBase_c *parent, unsigned long param, u8 groupType) |
Creates a child base under the given parent. | |
static dBase_c * | createRoot (ProfileName profName, unsigned long param, u8 groupType) |
Creates a root base. | |
Static Public Member Functions inherited from fBase_c | |
static void * | operator new (size_t) |
new operator override for all bases. | |
static void | operator delete (void *) |
delete operator override for all bases. | |
static fBase_c * | createChild (ProfileName profName, fBase_c *parent, unsigned long param, u8 groupType) |
Creates a child base under the given parent. | |
static fBase_c * | createRoot (ProfileName profName, unsigned long param, u8 groupType) |
Creates a root base. | |
Public Attributes inherited from dBaseActor_c | |
mMtx_c | mMatrix |
The actor's partial transformation matrix. See makeMtx for details. | |
mVec3_c | mPos |
The actor's position. | |
mVec3_c | mLastPos |
The actor's position in the previous frame. | |
mVec3_c | mPosDelta |
The actor's position delta since the previous frame. | |
mVec3_c | mCenterOffs |
The offset from the position to the center of the actor (defaults to 0). | |
mVec3_c | mScale |
The actor's scale (defaults to 1). | |
mVec3_c | mSpeed |
The actor's speed. | |
mVec3_c | mSpeedMax |
The actor's maximum speed. | |
mAng3_c | mAngle |
The actor's rotation (for 2D actors). | |
mAng3_c | mAngle3D |
The actor's rotation (for 3D actors). | |
float | mSpeedF |
The actor's horizontal speed. | |
float | mMaxSpeedF |
The actor's maximum horizontal speed. | |
float | mAccelY |
The actor's vertical acceleration. | |
float | mMaxFallSpeed |
The actor's maximum fall speed. | |
float | mAccelF |
The actor's horizontal acceleration. | |
u32 | mActorProperties |
The actor's properties. See fProfile::fActorProfile_c::mActorProperties. | |
bool | mVisible |
Whether the actor should be visible or not. Defaults to true . | |
Public Attributes inherited from fBase_c | |
fBaseID_e | mUniqueID |
The base's unique identifier. | |
u32 | mParam |
A bitfield that configures the base's behaviour. Its usage varies from profile to profile. | |
ProfileName | mProfName |
The base's profile name. | |
Protected Member Functions inherited from dBaseActor_c | |
virtual | ~dBaseActor_c () |
Destroys the actor. | |
virtual void | draw2D () |
Alternate drawing function used to draw 3D models in front of 2D graphics (first draw pass). | |
virtual void | draw2D_lyt2 () |
Alternate drawing function used to draw 3D models in front of 2D graphics (second draw pass). | |
virtual void | finalUpdate () |
Code to be executed after all actors' execute operation has run. | |
Protected Member Functions inherited from fBase_c | |
bool | isProcControlFlag (u8 flag) const |
Checks if a flag is set in mProcControl. | |
void | setProcControlFlag (u8 flag) |
Sets a flag in mProcControl. | |
void | clearProcControlFlag (u8 flag) |
Clears a flag in mProcControl. | |
virtual int | create () |
do method for the create operation. | |
virtual int | doDelete () |
do method for the delete operation. | |
virtual int | execute () |
do method for the execute operation. | |
virtual int | draw () |
do method for the draw operation. | |
virtual void | deleteReady () |
Informs the base that it's about to be deleted. | |
virtual bool | entryFrmHeap (unsigned long size, EGG::Heap *parentHeap) |
[Unused]. Creates a heap of the given size for the base. | |
virtual bool | entryFrmHeapNonAdjust (unsigned long size, EGG::Heap *parentHeap) |
[Unused]. Creates a heap of the given size for the base. | |
virtual bool | createHeap () |
[Unused]. [Does nothing]. | |
virtual | ~fBase_c () |
Destroys the base. | |
Protected Attributes inherited from fBase_c | |
u8 | mLifecycleState |
The base's lifecycle state. Value is a LIFECYCLE_e. | |
bool | mDeleteRequested |
If deletion of the base was requested, but the delete operation has not been scheduled yet. | |
bool | mDeferExecute |
If the create operation was completed, but scheduling the execute and draw operations isn't possible at this time. | |
bool | mDeferRetryCreate |
If the create operation has not been completed, and rescheduling it isn't possible at this time. | |
u8 | mGroupType |
The base's group type. Value is a GROUP_TYPE_e. | |
u8 | mProcControl |
The operations to be skipped. Value is a PROC_DISABLE_e. | |
fManager_c | mMng |
The base's process manager. | |
fBaHelper_c * | mpUnusedHelper |
[Unused]. See Unused Content. | |
fLiMgBa_c | mUnusedList |
[Unused]. See Unused Content. | |
EGG::FrmHeap * | mHeap |
[Unused]. The base's dedicated heap. | |
Static Protected Attributes inherited from fBase_c | |
static int(* | sLoadAsyncCallback )() |
[Unused]. See Unused Content. | |
static void(* | sUnloadCallback )() |
[Unused]. See Unused Content. | |
|
private |
Constructs a new actor.
Definition at line 6 of file d_wm_actor.cpp.
|
privatevirtual |
pre
method for the create
operation.
Reimplemented from dBaseActor_c.
Definition at line 10 of file d_wm_actor.cpp.
|
privatevirtual |
post
method for the create
operation.
Reimplemented from dBaseActor_c.
Definition at line 14 of file d_wm_actor.cpp.
|
privatevirtual |
pre
method for the delete
operation.
Reimplemented from dBaseActor_c.
Definition at line 18 of file d_wm_actor.cpp.
|
privatevirtual |
post
method for the delete
operation.
Reimplemented from dBaseActor_c.
Definition at line 25 of file d_wm_actor.cpp.
|
privatevirtual |
pre
method for the execute
operation.
Reimplemented from dBaseActor_c.
Definition at line 29 of file d_wm_actor.cpp.
|
privatevirtual |
post
method for the execute
operation.
Reimplemented from dBaseActor_c.
Definition at line 51 of file d_wm_actor.cpp.
|
privatevirtual |
pre
method for the draw
operation.
Reimplemented from dBaseActor_c.
Definition at line 55 of file d_wm_actor.cpp.
|
privatevirtual |
post
method for the draw
operation.
Reimplemented from dBaseActor_c.
Definition at line 77 of file d_wm_actor.cpp.
|
privatevirtual |
Destroys the actor.
Definition at line 8 of file d_wm_actor.cpp.
|
privatevirtual |
Gets the actor kind. See ACTOR_KIND_e.
Reimplemented from dBaseActor_c.
Definition at line 105 of file d_wm_actor.cpp.
|
staticprivate |
Creates a world map actor without a parent. See dBaseActor_c::construct.
Definition at line 81 of file d_wm_actor.cpp.
|
staticprivate |
Creates a child world map actor with the given parent. See dBaseActor_c::construct.
Definition at line 85 of file d_wm_actor.cpp.
|
staticprivate |
Sets the soft light effect for map actors.
Definition at line 89 of file d_wm_actor.cpp.
|
staticprivate |
Sets the soft light effect for map objects.
Definition at line 93 of file d_wm_actor.cpp.
|
staticprivate |
Sets the soft light effect for enemies.
Definition at line 97 of file d_wm_actor.cpp.
|
staticprivate |
Sets the soft light effect for bosses.
Definition at line 101 of file d_wm_actor.cpp.
|
private |
A sphere representing the actor's visible area.
Definition at line 83 of file d_wm_actor.hpp.