NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
|
#include <dol/bases/d_base_actor.hpp>
Basic actor class, supporting positioning, rotation and movement/acceleration.
All actors inheriting from this class use fProfile::fActorProfile_c for the profile (instead of fProfile::fBaseProfile_c) and are children to the current scene actor.
Definition at line 14 of file d_base_actor.hpp.
Public Types | |
enum | ACTOR_KIND_e { ACTOR_SYSTEM , ACTOR_MAP_DEMO , ACTOR_MAP , 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 = 1 , DISABLE_EXECUTE = 2 , ROOT_DISABLE_DRAW = 4 , DISABLE_DRAW = 8 } |
Controls if the execute and draw operations should be skipped. More... | |
Public Member Functions | |
void | calcSpeed () |
Updates the actor's speed (3D actors). | |
void | calcSpeedXY () |
Updates the actor's speed (2D actors). | |
void | calcSpeedX () |
Applies mAccelF to the actor's X speed, using mSpeedMax as the speed limit. | |
void | calcFallSpeed () |
Applies mAccelY to the actor's Y speed, using mMaxFallSpeed as the speed limit. | |
void | calcSpeedY () |
Applies mAccelY to the actor's Y speed, using mSpeedMax as the speed limit. | |
void | calcSpeedF () |
Applies mAccelF to mSpeedF, using mMaxSpeedF as the speed limit. | |
void | makeMtx () |
Updates the actor's world matrix. | |
mVec3_c | getCenterPos () const |
Gets the actor's center 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 | |
virtual int | preCreate () |
See fBase_c::preCreate. | |
virtual void | postCreate (fBase_c::MAIN_STATE_e status) |
See fBase_c::postCreate. | |
virtual int | preDelete () |
See fBase_c::preDelete. | |
virtual void | postDelete (fBase_c::MAIN_STATE_e status) |
See fBase_c::postDelete. | |
virtual int | preExecute () |
Code to be executed before execute. | |
virtual void | postExecute (fBase_c::MAIN_STATE_e status) |
See fBase_c::postExecute. | |
virtual int | preDraw () |
Code to be executed before draw. | |
virtual void | postDraw (fBase_c::MAIN_STATE_e status) |
See fBase_c::postDraw. | |
virtual const char * | getKindString () const |
Gets a string describing the kind of this base. | |
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 | |
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 () |
[Unknown purpose. Callbacks do nothing and don't seem to ever be called]. | |
static dBase_c * | createBase (ProfileName profName, dBase_c *parent, unsigned long param, u8 groupType) |
See fBase_c::createChild. | |
static dBase_c * | createRoot (ProfileName profName, unsigned long param, u8 groupType) |
See fBase_c::createRoot. | |
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 | |
mMtx_c | mMatrix |
The actor's world matrix. | |
mVec3_c | mPos |
The actor's position (top-left corner). | |
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. | |
mAng3_c | mLastAngle |
The actor's rotation in the previous frame. | |
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. [Represents nybbles 5 to 12 of Reggie's spritedata]. | |
ProfileName | mProfName |
The base's profile name. | |
Protected Member Functions | |
virtual int | preCreate () |
See dBase_c::preCreate. | |
virtual void | postCreate (fBase_c::MAIN_STATE_e status) |
See dBase_c::postCreate. | |
virtual int | preDelete () |
See dBase_c::preDelete. | |
virtual void | postDelete (fBase_c::MAIN_STATE_e status) |
See dBase_c::postDelete. | |
virtual int | preExecute () |
Code to be executed before execute. | |
virtual void | postExecute (fBase_c::MAIN_STATE_e status) |
Code to be executed after execute. | |
virtual int | preDraw () |
Code to be executed before draw. | |
virtual void | postDraw (fBase_c::MAIN_STATE_e status) |
See dBase_c::postDraw. | |
virtual void | draw2D () |
Alternate drawing function for drawing in front of 2D layouts (first draw pass). | |
virtual void | draw2D_lyt2 () |
Alternate drawing function for drawing in front of 2D layouts (second draw pass). | |
virtual int | GetActorType () |
Gets the actor kind. See ACTOR_KIND_e. | |
virtual void | finalUpdate () |
Code to be executed after all the actors' execute method 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 | preCreate () |
pre method for the create operation. | |
virtual void | postCreate (MAIN_STATE_e state) |
post method for the create operation. | |
virtual int | doDelete () |
do method for the delete operation. | |
virtual int | preDelete () |
pre method for the delete operation. | |
virtual void | postDelete (MAIN_STATE_e state) |
post method for the delete operation. | |
virtual int | execute () |
do method for the execute operation. | |
virtual int | preExecute () |
pre method for the execute operation. | |
virtual void | postExecute (MAIN_STATE_e state) |
post method for the execute operation. | |
virtual int | draw () |
do method for the draw operation. | |
virtual int | preDraw () |
pre method for the draw operation. | |
virtual void | postDraw (MAIN_STATE_e state) |
post 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. | |
Static Private Member Functions | |
static void | setTmpCtData (const mVec3_c *position, const mAng3_c *rotation) |
Sets temporary data to be used for the next actor's construction. | |
Private Attributes | |
fLiNdBa_c | mLinkActor |
The node in m_actorManage. | |
Static Private Attributes | |
static const mVec3_c * | m_tmpCtPosP |
Temporary storage for the next constructed actor's position. See mPos. | |
static const mAng3_c * | m_tmpCtAngleP |
Temporary storage for the next constructed actor's rotation. See mAngle. | |
static fLiMgBa_c | m_actorManage |
A list of all the constructed actors. | |
Additional Inherited Members | |
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 corresponding 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 * | mpHeap |
[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. | |
An identifier that represents the actor's kind.
[This does not seem to be used outside of worldmaps].
Definition at line 19 of file d_base_actor.hpp.
dBaseActor_c::dBaseActor_c | ( | ) |
Definition at line 12 of file d_base_actor.cpp.
|
protectedvirtual |
Definition at line 48 of file d_base_actor.cpp.
|
protectedvirtual |
|
protectedvirtual |
See dBase_c::postCreate.
Reimplemented from dBase_c.
Definition at line 56 of file d_base_actor.cpp.
|
protectedvirtual |
|
protectedvirtual |
See dBase_c::postDelete.
Reimplemented from dBase_c.
Definition at line 64 of file d_base_actor.cpp.
|
protectedvirtual |
Code to be executed before execute.
The actor's execute method is not called if the game is being reset.
Reimplemented from dBase_c.
Definition at line 68 of file d_base_actor.cpp.
|
protectedvirtual |
Code to be executed after execute.
This method updates the actor's previous position and the position delta.
Reimplemented from dBase_c.
Definition at line 84 of file d_base_actor.cpp.
|
protectedvirtual |
Code to be executed before draw.
The actor is not drawn if mVisible is false
.
Reimplemented from dBase_c.
Definition at line 93 of file d_base_actor.cpp.
|
protectedvirtual |
|
protectedvirtual |
Alternate drawing function for drawing in front of 2D layouts (first draw pass).
This feature is not used in stages.
Definition at line 105 of file d_base_actor.cpp.
|
protectedvirtual |
Alternate drawing function for drawing in front of 2D layouts (second draw pass).
This feature is not used in stages.
Definition at line 108 of file d_base_actor.cpp.
|
protectedvirtual |
Gets the actor kind. See ACTOR_KIND_e.
|
protectedvirtual |
Code to be executed after all the actors' execute method has run.
void dBaseActor_c::calcSpeed | ( | ) |
Updates the actor's speed (3D actors).
mSpeedF gets applied to the direction the actor is facing, while mAccelY is added to the vertical speed.
Definition at line 145 of file d_base_actor.cpp.
void dBaseActor_c::calcSpeedXY | ( | ) |
Updates the actor's speed (2D actors).
mSpeedF gets applied to the X axis.
Definition at line 175 of file d_base_actor.cpp.
void dBaseActor_c::calcSpeedX | ( | ) |
Applies mAccelF to the actor's X speed, using mSpeedMax as the speed limit.
Definition at line 181 of file d_base_actor.cpp.
void dBaseActor_c::calcFallSpeed | ( | ) |
Applies mAccelY to the actor's Y speed, using mMaxFallSpeed as the speed limit.
Definition at line 221 of file d_base_actor.cpp.
void dBaseActor_c::calcSpeedY | ( | ) |
Applies mAccelY to the actor's Y speed, using mSpeedMax as the speed limit.
Definition at line 201 of file d_base_actor.cpp.
void dBaseActor_c::calcSpeedF | ( | ) |
Applies mAccelF to mSpeedF, using mMaxSpeedF as the speed limit.
Definition at line 211 of file d_base_actor.cpp.
void dBaseActor_c::makeMtx | ( | ) |
Updates the actor's world matrix.
Definition at line 157 of file d_base_actor.cpp.
mVec3_c dBaseActor_c::getCenterPos | ( | ) | const |
Gets the actor's center position.
Definition at line 231 of file d_base_actor.cpp.
void dBaseActor_c::posMove | ( | mVec3_c & | delta | ) |
Moves the actor by the given delta.
Definition at line 167 of file d_base_actor.cpp.
void dBaseActor_c::posMove | ( | ) |
Moves the actor by its speed.
Definition at line 171 of file d_base_actor.cpp.
int dBaseActor_c::GetProfNameActorNum | ( | ProfileName | profile | ) |
Counts the instances of the given actor profile.
Definition at line 235 of file d_base_actor.cpp.
|
static |
Calls draw2D on every actor.
Definition at line 124 of file d_base_actor.cpp.
|
static |
Calls draw2D_lyt2 on every actor.
Definition at line 132 of file d_base_actor.cpp.
|
static |
Creates an actor without a parent.
The actor is created as a child of the current scene actor so that all actors can be deleted on a scene change, working as a garbage collector of sorts.
profName | The actor's profile name. |
param | The actor's parameters. |
position | The actor's position. |
rotation | The actor's rotation. |
nullptr
. Definition at line 116 of file d_base_actor.cpp.
|
static |
Creates a child actor with the given parent.
profName | The actor's profile name. |
parent | The actor's parent. |
param | The actor's parameters. |
position | The actor's position. |
rotation | The actor's rotation. |
nullptr
. Definition at line 140 of file d_base_actor.cpp.
|
staticprivate |
Sets temporary data to be used for the next actor's construction.
position | The actor's position. |
rotation | The actor's rotation. |
Definition at line 111 of file d_base_actor.cpp.
|
private |
The node in m_actorManage.
Definition at line 127 of file d_base_actor.hpp.
mMtx_c dBaseActor_c::mMatrix |
The actor's world matrix.
Definition at line 130 of file d_base_actor.hpp.
mVec3_c dBaseActor_c::mPos |
The actor's position (top-left corner).
Definition at line 132 of file d_base_actor.hpp.
mVec3_c dBaseActor_c::mLastPos |
The actor's position in the previous frame.
Definition at line 133 of file d_base_actor.hpp.
mVec3_c dBaseActor_c::mPosDelta |
The actor's position delta since the previous frame.
Definition at line 134 of file d_base_actor.hpp.
mVec3_c dBaseActor_c::mCenterOffs |
The offset from the position to the center of the actor (defaults to 0).
Definition at line 136 of file d_base_actor.hpp.
mVec3_c dBaseActor_c::mScale |
The actor's scale (defaults to 1).
Definition at line 137 of file d_base_actor.hpp.
mVec3_c dBaseActor_c::mSpeed |
The actor's speed.
Definition at line 138 of file d_base_actor.hpp.
mVec3_c dBaseActor_c::mSpeedMax |
The actor's maximum speed.
Definition at line 139 of file d_base_actor.hpp.
mAng3_c dBaseActor_c::mAngle |
The actor's rotation.
Definition at line 141 of file d_base_actor.hpp.
mAng3_c dBaseActor_c::mLastAngle |
The actor's rotation in the previous frame.
Definition at line 142 of file d_base_actor.hpp.
float dBaseActor_c::mSpeedF |
The actor's horizontal speed.
Definition at line 144 of file d_base_actor.hpp.
float dBaseActor_c::mMaxSpeedF |
The actor's maximum horizontal speed.
Definition at line 145 of file d_base_actor.hpp.
float dBaseActor_c::mAccelY |
The actor's vertical acceleration.
Definition at line 146 of file d_base_actor.hpp.
float dBaseActor_c::mMaxFallSpeed |
The actor's maximum fall speed.
Definition at line 147 of file d_base_actor.hpp.
float dBaseActor_c::mAccelF |
The actor's horizontal acceleration.
Definition at line 148 of file d_base_actor.hpp.
u32 dBaseActor_c::mActorProperties |
The actor's properties. See fProfile::fActorProfile_c::mActorProperties.
Definition at line 150 of file d_base_actor.hpp.
bool dBaseActor_c::mVisible |
Whether the actor should be visible or not. Defaults to true
.
Definition at line 151 of file d_base_actor.hpp.
|
staticprivate |
Temporary storage for the next constructed actor's position. See mPos.
Definition at line 154 of file d_base_actor.hpp.
|
staticprivate |
Temporary storage for the next constructed actor's rotation. See mAngle.
Definition at line 155 of file d_base_actor.hpp.
|
staticprivate |
A list of all the constructed actors.
Definition at line 156 of file d_base_actor.hpp.