NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
Loading...
Searching...
No Matches
d_en_castle_door.cpp
1#include <game/bases/d_en_castle_door.hpp>
5
6ACTOR_PROFILE(EN_CASTLEDOOR, dEnCastleDoor_c, 2);
7
8const sCcDatNewF l_cdoor_cc_data = {
9 0.0f, 20.0f,
10 24.0f, 20.0f,
11 CC_KIND_ENEMY,
12 CC_ATTACK_NONE,
13 BIT_FLAG(CC_KIND_PLAYER),
14 0,
15 CC_STATUS_NONE,
17};
18
20 mResFile = dResMng_c::m_instance->getRes("obj_door_shiroboss", "g3d/obj_door_shiroboss.brres");
21
22 nw4r::g3d::ResMdl resMdl = mResFile.GetResMdl("obj_door_shiroboss");
23 mModel.create(resMdl, &mAllocator, nw4r::g3d::ScnMdl::BUFFER_RESMATMISC, 1, nullptr);
24
26
27 nw4r::g3d::ResAnmChr resAnmChr = mResFile.GetResAnmChr("obj_door_shiroboss");
28 mAnim.create(resMdl, resAnmChr, &mAllocator, nullptr);
29}
30
32 nw4r::g3d::ResAnmChr resAnmChr = mResFile.GetResAnmChr("obj_door_shiroboss");
33 mAnim.setAnm(mModel, resAnmChr, m3d::FORWARD_ONCE);
34 mModel.setAnm(mAnim, 0.0f);
35 mAnim.setRate(0.0f);
36}
37
39 mCc.set(this, (sCcDatNewF *) &l_cdoor_cc_data);
40 mCc.entry();
41}
42
46
48 mAnim.setRate(1.0f);
49 mAnim.mPlayMode = m3d::FORWARD_ONCE;
50}
51
53 mAnim.setRate(1.0f);
54 mAnim.mPlayMode = m3d::REVERSE_ONCE;
55}
56
58 mAnim.setRate(0.0f);
59 mAnim.setFrame(0.0f);
60}
61
62// To get automatically copied virtual functions in the right order. @unused
63void UNUSED_dEnCastleDoor_c() {
64 dEnCastleDoor_c *door = nullptr;
65 door->waitProc();
66 door->ActorDrawCullCheck();
67 door->isDummyOpen();
68}
69
71 dAudio::SndObjctCmnMap_c *sndObjMap = dAudio::g_pSndObjMap;
72 sndObjMap->holdSound(SE_OBJ_BDOOR_MOVE, mUniqueID, mPos, 0);
73}
74
76 dAudio::g_pSndObjMap->startSound(SE_OBJ_BDOOR_CLOSE, mPos, 0);
77}
78
80 dAudio::g_pSndObjMap->startSound(SE_OBJ_BDOOR_OPEN, mPos, 0);
81}
sRangeDataF mDestroyBound
Definition d_actor.hpp:353
static void setSoftLight_MapObj(m3d::bmdl_c &mdl)
Sets the soft light effect for map objects.
Definition d_actor.cpp:333
static const float smc_CULL_YLIMIT
The default max bound Y offset.
Definition d_actor.hpp:408
dCc_c mCc
The actor-to-actor collision sensor.
Definition d_actor.hpp:344
static const float smc_CULL_XLIMIT
The default max bound X offset.
Definition d_actor.hpp:407
mVec3_c mPos
The actor's position.
A red door used in castles.
virtual void setCloseMoveSE() override
Plays the door closing SFX.
virtual void initCcData() override
Initializes collision data for the door.
virtual void setCloseAnm() override
Sets up the door close animation.
virtual void initAnm() override
Initializes the animation for the door.
virtual void setCloseSE() override
Plays the door closed SFX.
virtual void createMdl() override
Creates the model and animation for the door.
virtual void setOpenSE() override
Plays the door opening SFX.
virtual void setWaitAnm() override
Stops all animations for the door.
virtual void setOpenAnm() override
Sets up the door open animation.
virtual void initialize() override
Initializes other elements, called by create().
static dResMng_c * m_instance
The instance of this class.
Definition d_res_mng.hpp:71
virtual bool ActorDrawCullCheck() override
Checks if the actor is out of view.
m3d::mdl_c mModel
The door model.
nw4r::g3d::ResFile mResFile
The resource file.
virtual bool isDummyOpen()
Returns whether the door must act like fake Ghost House Doors.
dHeapAllocator_c mAllocator
The allocator.
m3d::anmChr_c mAnim
The door model animation.
virtual void waitProc()
Executed every frame during the Wait state.
static void ccCallback(dCc_c *self, dCc_c *other)
Collision callback for the door.
fBaseID_e mUniqueID
The base's unique identifier.
Definition f_base.hpp:62
#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
@ FORWARD_ONCE
Play the animation forward once.
Definition banm.hpp:9
@ REVERSE_ONCE
Play the animation in reverse once.
Definition banm.hpp:11
A structure that contains information about a collider.
Definition d_cc.hpp:99