-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5980549
commit b83c0d5
Showing
6 changed files
with
134 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#ifndef D_A_OBJ_PUMPKIN_LEAF_H | ||
#define D_A_OBJ_PUMPKIN_LEAF_H | ||
|
||
#include <d/a/obj/d_a_obj_base.h> | ||
#include <m/m3d/m_smdl.h> | ||
#include <s/s_State.hpp> | ||
#include <s/s_StateMgr.hpp> | ||
|
||
class dAcOPumpkinLeaf_c : public dAcObjBase_c { | ||
public: | ||
dAcOPumpkinLeaf_c() : mStateMgr(*this, sStateID::null) {} | ||
virtual ~dAcOPumpkinLeaf_c() {} | ||
virtual bool createHeap() override; | ||
virtual int create() override; | ||
virtual int actorExecute() override; | ||
virtual int draw() override; | ||
virtual int doDelete() override; | ||
|
||
STATE_FUNC_DECLARE(dAcOPumpkinLeaf_c, Wait); | ||
|
||
private: | ||
nw4r::g3d::ResFile mBrres; | ||
m3d::smdl_c mModel; | ||
STATE_MGR_DECLARE(dAcOPumpkinLeaf_c); | ||
void dummy_executeState() { | ||
// Not called from the class but needed for weak function ordering | ||
mStateMgr.executeState(); | ||
} | ||
}; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#include <d/a/obj/d_a_obj_pumpkin_leaf.h> | ||
#include <s/s_Math.h> | ||
|
||
SPECIAL_ACTOR_PROFILE(OBJ_PUMPKIN_LEAF, dAcOPumpkinLeaf_c, fProfile::OBJ_PUMPKIN_LEAF, 0x0135, 0, 3); | ||
|
||
STATE_DEFINE(dAcOPumpkinLeaf_c, Wait); | ||
|
||
bool dAcOPumpkinLeaf_c::createHeap() { | ||
mBrres = getOarcResFile("Pumpkin"); | ||
nw4r::g3d::ResMdl mdl = mBrres.GetResMdl("Leaf"); | ||
TRY_CREATE(mModel.create(mdl, &heap_allocator, 0x120, 1, nullptr)); | ||
return true; | ||
} | ||
|
||
int dAcOPumpkinLeaf_c::create() { | ||
if (!initAllocatorWork1Heap(0x1000, "dAcOPumpkinLeaf_c::m_allocator", 0x20)) { | ||
return FAILED; | ||
} | ||
|
||
forwardAccel = -1.0f; | ||
forwardMaxSpeed = -40.0f; | ||
updateMatrix(); | ||
mStateMgr.changeState(StateID_Wait); | ||
setBoundingBox(mVec3_c(-50.0f, -10.0f, -50.0f), mVec3_c(50.0f, 50.0f, 50.0f)); | ||
dAcObjBase_c::create( | ||
"PmpknBd", getRoomId(), 0, &position, &rotation, &scale, getParams2_ignoreLower(), -1, viewclip_index | ||
); | ||
return SUCCEEDED; | ||
} | ||
|
||
int dAcOPumpkinLeaf_c::doDelete() { | ||
return SUCCEEDED; | ||
} | ||
|
||
int dAcOPumpkinLeaf_c::actorExecute() { | ||
mModel.setLocalMtx(worldMatrix); | ||
return SUCCEEDED; | ||
} | ||
|
||
int dAcOPumpkinLeaf_c::draw() { | ||
drawModelType1(&mModel); | ||
return SUCCEEDED; | ||
} | ||
|
||
void dAcOPumpkinLeaf_c::initializeState_Wait() {} | ||
void dAcOPumpkinLeaf_c::executeState_Wait() {} | ||
void dAcOPumpkinLeaf_c::finalizeState_Wait() {} |