NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
Loading...
Searching...
No Matches
d_en_switch_door.cpp
1#include <game/bases/d_en_switch_door.hpp>
2#include <game/bases/d_switch_flag_mng.hpp>
3
4ACTOR_PROFILE(EN_SWITCHDOOR, dEnSwitchDoor_c, 2);
5
7 if (dActor_c::m_flag_keep[1] != 0 && !(dSwitchFlagMng_c::m_instance->mFlag & *(u16 *) dActor_c::m_flag_keep)) {
8 mIsEventActivated = FALSE;
9 } else {
10 mIsEventActivated = TRUE;
11 mCc.entry();
12 }
13
14 mVisibleAreaOffset.set(0.0f, 24.0f);
15}
16
18 if (mEventMask & dSwitchFlagMng_c::m_instance->mFlag) {
20 return;
21 }
22
23 mIsEventActivated = TRUE;
24 mCc.entry();
25 } else if (mIsEventActivated) {
26 mIsEventActivated = FALSE;
27 mCc.release();
28 }
29}
30
32 if (!dEn_c::preDraw()) {
33 return NOT_READY;
34 };
35
37}
static u8 m_flag_keep[2]
Temporary storage for the next created sprite actor's tracked event IDs. See mEventNums.
Definition d_actor.hpp:425
dCc_c mCc
The actor-to-actor collision sensor.
Definition d_actor.hpp:344
u64 mEventMask
The event mask, generated from mEventNums.
Definition d_actor.hpp:361
mVec2_c mVisibleAreaOffset
The offset applied to the area size.
Definition d_actor.hpp:351
An event-activated d-pad door.
virtual int preDraw() override
pre method for the draw operation.
virtual void waitProc() override
Executed every frame during the Wait state.
BOOL mIsEventActivated
Whether the event ID associated to the door has been activated.
virtual void initialize() override
Initializes other elements, called by create().
virtual int preDraw()
pre method for the draw operation.
Definition d_enemy.cpp:115
@ NOT_READY
The step could not completed at this time.
Definition f_base.hpp:46
@ SUCCEEDED
The step was completed successfully.
Definition f_base.hpp:47
#define ACTOR_PROFILE(profName, className, properties)
Creates an actor profile, using the profile number as the execute and draw order value.
Definition f_profile.hpp:29