NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
Loading...
Searching...
No Matches
d_a_wm_cannon.cpp
2#include <game/bases/d_a_wm_map.hpp>
3#include <game/bases/d_cs_seq_manager.hpp>
4#include <game/bases/d_a_wm_cannon.hpp>
5#include <game/bases/d_wm_lib.hpp>
6
7ACTOR_PROFILE(WM_CANNON, daWmCannon_c, 0);
8
11
13 float a = 0.0f; // [Needed for .rodata ordering]
14
17 calcModel();
18
19 return SUCCEEDED;
20}
21
23 setCutEndSpecific(dCsSeqMng_c::ms_instance->GetCutName(), dCsSeqMng_c::ms_instance->m_164);
24
25 mModel.play();
26 daWmMap_c::m_instance->GetNodePos(mResNodeIdx, mPos);
27 calcModel();
28
29 return SUCCEEDED;
30}
31
33 mModel.entry();
34 return SUCCEEDED;
35}
36
38 return SUCCEEDED;
39}
40
42 mClipSphere.mCenter = mPos;
43 mClipSphere.mRadius = 120.0f;
44}
45
47 mAllocator.createFrmHeap(-1, mHeap::g_gameHeaps[mHeap::GAME_HEAP_DEFAULT], nullptr, 0x20);
48
49 nw4r::g3d::ResFile resFile = dResMng_c::m_instance->getRes("cobCannon", "g3d/model.brres");
50 nw4r::g3d::ResMdl resMdl = resFile.GetResMdl("cobCannon");
51
52 mModel.create(resMdl, &mAllocator, nw4r::g3d::ScnMdl::BUFFER_RESMATMISC, 1, nullptr);
54
55 mAllocator.adjustFrmHeap();
56}
57
59 mVec3_c pos = mPos;
60 mAng3_c angle = mAngle;
61 mMatrix.trans(pos);
62 mMatrix.ZXYrotM(angle);
63 mModel.setLocalMtx(&mMatrix);
64 mModel.setScale(mScale);
65 mModel.calc(false);
66}
67
68void daWmCannon_c::setCutEndSpecific(int cutsceneCommandId, bool param2) {
69 if (cutsceneCommandId == dCsSeqMng_c::CUTSCENE_CMD_NONE) {
70 return;
71 }
72
73 switch (cutsceneCommandId) {
74 case dCsSeqMng_c::CUTSCENE_CMD_27:
75 mIsCutEnd = true;
76 break;
77 case dCsSeqMng_c::CUTSCENE_CMD_28:
78 mIsCutEnd = true;
79 break;
80 case dCsSeqMng_c::CUTSCENE_CMD_29:
81 mIsCutEnd = true;
82 break;
83 default:
84 mIsCutEnd = true;
85 break;
86 }
87}
mMtx_c mMatrix
The actor's partial transformation matrix. See makeMtx() for details.
mVec3_c mScale
The actor's scale (defaults to 1).
mVec3_c mPos
The actor's position.
mAng3_c mAngle
The actor's rotation (for 2D actors).
static dResMng_c * m_instance
The instance of this class.
Definition d_res_mng.hpp:61
static void setSoftLight_MapObj(m3d::bmdl_c &mdl)
Sets the soft light effect for map objects.
mSphere_c mClipSphere
A sphere representing the actor's visible area.
int mResNodeIdx
The index of the model's root resource node.
The actor for the Warp Cannons found on the World Map.
dHeapAllocator_c mAllocator
The allocator.
virtual int draw()
do method for the draw operation.
virtual int create()
do method for the create operation.
virtual int doDelete()
do method for the delete operation.
void createModel()
Initializes the resources for the actor.
void calcModel()
Updates the model's transformation matrix.
m3d::smdl_c mModel
The model.
void setClipSphere()
Sets the clip sphere for the actor.
~daWmCannon_c()
Destroys the object.
virtual void setCutEndSpecific(int cutsceneCommandId, bool param2)
virtual int execute()
do method for the execute operation.
daWmCannon_c()
Constructs a new object.
@ SUCCEEDED
The step was completed successfully.
Definition f_base.hpp:45
A three-dimensional short angle vector.
Definition m_angle.hpp:59
A three-dimensional floating point vector.
Definition m_vec.hpp:107
#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
@ GAME_HEAP_DEFAULT
The default game heap (alias of MEM1 or MEM2).
Definition m_heap.hpp:38
EGG::Heap * g_gameHeaps[GAME_HEAP_COUNT]
The game heaps.
Definition m_heap.cpp:13