-
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
70c6878
commit 74db770
Showing
6 changed files
with
162 additions
and
45 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#ifndef D_A_OBJ_WATER_SPOUT_H | ||
#define D_A_OBJ_WATER_SPOUT_H | ||
|
||
#include "d/a/obj/d_a_obj_base.h" | ||
#include "m/m3d/m_anmmatclr.h" | ||
#include "m/m3d/m_anmmdl.h" | ||
#include "m/m3d/m_anmtexsrt.h" | ||
#include "nw4r/g3d/g3d_resfile.h" | ||
#include "s/s_State.hpp" | ||
#include "s/s_StateMgr.hpp" | ||
|
||
class dAcOwaterSpout_c : public dAcObjBase_c { | ||
public: | ||
dAcOwaterSpout_c() : mStateMgr(*this, sStateID::null) {} | ||
virtual ~dAcOwaterSpout_c() {} | ||
|
||
virtual bool createHeap() override; | ||
virtual int create() override; | ||
virtual int doDelete() override; | ||
virtual int actorExecute() override; | ||
virtual int draw() override; | ||
|
||
STATE_FUNC_DECLARE(dAcOwaterSpout_c, Wait); | ||
|
||
private: | ||
/* 0x330 */ nw4r::g3d::ResFile mResFile; | ||
/* 0x334 */ m3d::mdlAnmChr mMdl; | ||
/* 0x39C */ m3d::anmTexSrt_c mAnmSrt; | ||
/* 0x3C8 */ m3d::anmMatClr_c mAnmClr; | ||
/* 0x3F4 */ STATE_MGR_DECLARE(dAcOwaterSpout_c); | ||
}; | ||
|
||
#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
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,76 @@ | ||
#include "d/a/obj/d_a_obj_water_spout.h" | ||
|
||
#include "common.h" | ||
#include "d/a/obj/d_a_obj_base.h" | ||
#include "m/m3d/m_fanm.h" | ||
#include "m/m_vec.h" | ||
#include "nw4r/g3d/g3d_resanmclr.h" | ||
#include "nw4r/g3d/g3d_resanmtexsrt.h" | ||
#include "nw4r/g3d/g3d_resmdl.h" | ||
#include "s/s_State.hpp" | ||
|
||
|
||
SPECIAL_ACTOR_PROFILE(OBJ_WATER_SPOUT, dAcOwaterSpout_c, fProfile::OBJ_WATER_SPOUT, 0x1DA, 0, 6); | ||
|
||
STATE_DEFINE(dAcOwaterSpout_c, Wait); | ||
|
||
bool dAcOwaterSpout_c::createHeap() { | ||
void *data = getOarcResFile("FX_WaterColumn"); | ||
mResFile = data; | ||
nw4r::g3d::ResMdl mdl = mResFile.GetResMdl("FX_WaterColumn"); | ||
TRY_CREATE(mMdl.create(data, "FX_WaterColumn", "FX_WaterColumn", &heap_allocator, 0x32C)); | ||
nw4r::g3d::ResAnmTexSrt anmSrt = mResFile.GetResAnmTexSrt("FX_WaterColumn"); | ||
TRY_CREATE(mAnmSrt.create(mdl, anmSrt, &heap_allocator, nullptr, 1)); | ||
nw4r::g3d::ResAnmClr anmClr = mResFile.GetResAnmClr("FX_WaterColumn"); | ||
TRY_CREATE(mAnmClr.create(mdl, anmClr, &heap_allocator, nullptr, 1)); | ||
return true; | ||
} | ||
|
||
int dAcOwaterSpout_c::create() { | ||
CREATE_ALLOCATOR(dAcOwaterSpout_c); | ||
mMdl.setAnm("FX_WaterColumn", m3d::PLAY_MODE_4); | ||
mMdl.getModel().setAnm(mAnmSrt); | ||
mMdl.getModel().setAnm(mAnmClr); | ||
updateMatrix(); | ||
mMdl.getModel().setLocalMtx(mWorldMtx); | ||
mStateMgr.changeState(StateID_Wait); | ||
if (params == 1) { | ||
mScale.y *= 4.0f; | ||
} | ||
mMdl.getModel().setScale(mScale); | ||
boundingBox.Set(mVec3_c(-400.0f, -250.0f, -400.0f), mVec3_c(400.0f, 250.0f, 400.0f)); | ||
return SUCCEEDED; | ||
} | ||
|
||
int dAcOwaterSpout_c::doDelete() { | ||
return SUCCEEDED; | ||
} | ||
|
||
int dAcOwaterSpout_c::actorExecute() { | ||
mStateMgr.executeState(); | ||
mMdl.play(); | ||
mAnmSrt.play(); | ||
mAnmClr.play(); | ||
return SUCCEEDED; | ||
} | ||
|
||
int dAcOwaterSpout_c::draw() { | ||
drawModelType1(&mMdl.getModel()); | ||
return SUCCEEDED; | ||
} | ||
|
||
extern "C" void fn_800298B0(u16, mVec3_c *, mVec3_c *, mVec3_c *, u32, u32, u32, u32); | ||
extern "C" u16 PARTICLE_RESOURCE_ID_MAPPING_213_; | ||
|
||
void dAcOwaterSpout_c::initializeState_Wait() { | ||
if (params == 1) { | ||
return; | ||
} | ||
fn_800298B0(PARTICLE_RESOURCE_ID_MAPPING_213_, &position, nullptr, &mScale, 0, 0, 0, 0); | ||
} | ||
void dAcOwaterSpout_c::executeState_Wait() { | ||
if (mMdl.getAnm().isStop()) { | ||
deleteRequest(); | ||
} | ||
} | ||
void dAcOwaterSpout_c::finalizeState_Wait() {} |