-
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
f9fc4f0
commit ef5aaf8
Showing
10 changed files
with
205 additions
and
24 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,22 @@ | ||
_prolog = .text:0x00000000; // type:function size:0x2C scope:global | ||
_epilog = .text:0x00000030; // type:function size:0x2C scope:global | ||
_unresolved = .text:0x00000060; // type:function size:0x4 scope:global | ||
fn_157_70 = .text:0x00000070; // type:function size:0xD4 | ||
fn_157_150 = .text:0x00000150; // type:function size:0xE8 | ||
fn_157_240 = .text:0x00000240; // type:function size:0x1A0 | ||
fn_157_3E0 = .text:0x000003E0; // type:function size:0x8 | ||
fn_157_3F0 = .text:0x000003F0; // type:function size:0xF0 | ||
fn_157_4E0 = .text:0x000004E0; // type:function size:0x6C | ||
fn_157_550 = .text:0x00000550; // type:function size:0x14 | ||
fn_157_570 = .text:0x00000570; // type:function size:0x74 | ||
dAcEhb_leaf_c_classInit__Fv = .text:0x00000070; // type:function size:0xD4 | ||
createHeap__13dAcEhb_leaf_cFv = .text:0x00000150; // type:function size:0xE8 | ||
create__13dAcEhb_leaf_cFv = .text:0x00000240; // type:function size:0x1A0 | ||
doDelete__13dAcEhb_leaf_cFv = .text:0x000003E0; // type:function size:0x8 | ||
actorExecute__13dAcEhb_leaf_cFv = .text:0x000003F0; // type:function size:0xF0 | ||
draw__13dAcEhb_leaf_cFv = .text:0x000004E0; // type:function size:0x6C | ||
setAnm__13dAcEhb_leaf_cFPCcf = .text:0x00000550; // type:function size:0x14 | ||
__dt__13dAcEhb_leaf_cFv = .text:0x00000570; // type:function size:0x74 | ||
_ctors = .ctors:0x00000000; // type:label scope:global | ||
_dtors = .dtors:0x00000000; // type:label scope:global | ||
lbl_157_rodata_0 = .rodata:0x00000000; // type:object size:0x20 data:float | ||
lbl_157_rodata_20 = .rodata:0x00000020; // type:object size:0x4 data:float | ||
lbl_157_data_0 = .data:0x00000000; // type:object size:0x34 | ||
lbl_157_data_34 = .data:0x00000034; // type:object size:0x1C | ||
lbl_157_data_50 = .data:0x00000050; // type:object size:0x80 | ||
unkFloat0__13dAcEhb_leaf_c = .rodata:0x00000000; // type:object size:0x4 data:float | ||
unkFloat1__13dAcEhb_leaf_c = .rodata:0x00000004; // type:object size:0x4 data:float | ||
lbl_157_rodata_20 = .rodata:0x00000020; // type:object size:0x4 scope:local data:float | ||
g_profile_E_HB_LEAF = .data:0x00000000; // type:object size:0x10 | ||
lbl_157_data_10 = .data:0x00000010; // type:object size:0x9 scope:local data:string | ||
lbl_157_data_1C = .data:0x0000001C; // type:object size:0x7 scope:local data:string | ||
lbl_157_data_24 = .data:0x00000024; // type:object size:0xE scope:local data:string | ||
lbl_157_data_34 = .data:0x00000034; // type:object size:0x1B scope:local data:string | ||
__vt__13dAcEhb_leaf_c = .data:0x00000050; // type:object size:0x80 |
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,59 @@ | ||
#ifndef D_A_E_HB_LEAF_H | ||
#define D_A_E_HB_LEAF_H | ||
|
||
#include <c/c_math.h> | ||
#include <d/a/obj/d_a_obj_base.h> | ||
#include <m/m3d/m_anmmdl.h> | ||
#include <m/m3d/m_anmtexpat.h> | ||
|
||
extern "C" bool fn_800B9D80(f32, f32, f32 *, int, const mVec3_c &, u32); | ||
|
||
class dAcEhb_leaf_c : public dAcObjBase_c { | ||
public: | ||
dAcEhb_leaf_c() : someFloat(unkFloat0), field_0x3CC(0), field_0x3DE(0) {} | ||
virtual ~dAcEhb_leaf_c() {} | ||
virtual bool createHeap() override; | ||
virtual int create() override; | ||
virtual int actorExecute() override; | ||
virtual int draw() override; | ||
virtual int doDelete() override; | ||
|
||
void setAnm(const char *anm, f32 pos); | ||
|
||
private: | ||
const static f32 unkFloat0; | ||
const static f32 unkFloat1; | ||
|
||
m3d::mdlAnmChr mModel; // 0x330 | ||
m3d::anmTexPat_c mAnm; // 0x398 | ||
|
||
f32 someFloat; // 0x3C4 | ||
UNKWORD field_0x3C8; // 0x3C8 | ||
u8 field_0x3CC; // 0x3CC | ||
mVec3_c mStartingPos; // 0x3D0 | ||
u16 someRot; // 0x3DC | ||
u8 field_0x3DE; // 0x3DE | ||
u8 mType; // 0x3DF | ||
|
||
bool isNearZero() { | ||
return fabsf(someFloat) <= FLT_EPSILON; | ||
} | ||
|
||
bool isHidden() { | ||
return mType != 0 && isNearZero() ? true : false; | ||
} | ||
|
||
void doCheck() { | ||
fn_800B9D80(10.0f, 0.2f, &someFloat, roomid, mStartingPos, 0); | ||
} | ||
|
||
int getParam1() { | ||
return params & 7; | ||
} | ||
|
||
int getParam2() { | ||
return params >> 7 & 3; | ||
} | ||
}; | ||
|
||
#endif |
File renamed without changes.
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,109 @@ | ||
#include <d/a/e/d_a_e_hb_leaf.h> | ||
|
||
const f32 dAcEhb_leaf_c::unkFloat0 = 0.0f; | ||
const f32 dAcEhb_leaf_c::unkFloat1 = -0.0f; | ||
|
||
SPECIAL_ACTOR_PROFILE(E_HB_LEAF, dAcEhb_leaf_c, fProfile::E_HB_LEAF, 0x100, 0, 3); | ||
|
||
bool dAcEhb_leaf_c::createHeap() { | ||
// This is ever so slightly weird but our m_anmMdl really doesn't take ResFile by value | ||
// but only ever a single pointer. | ||
void *fp = getOarcResFile("Degubaba"); | ||
TRY_CREATE(mModel.create(fp, "degubaba_leaf", "shake2", &heap_allocator, 0x123)); | ||
nw4r::g3d::ResFile f = fp; | ||
nw4r::g3d::ResMdl mdl = f.GetResMdl("degubaba_leaf"); | ||
nw4r::g3d::ResAnmTexPat anm = f.GetResAnmTexPat("degubaba_leaf"); | ||
TRY_CREATE(mAnm.create(mdl, anm, &heap_allocator, nullptr, 1)); | ||
mModel.getModel().setAnm(mAnm); | ||
return true; | ||
} | ||
|
||
int dAcEhb_leaf_c::create() { | ||
if (!initAllocatorWork1Heap(-1, "dAcEhb_leaf_c::m_allocator", 0x20)) { | ||
return FAILED; | ||
} | ||
|
||
setBoundingBox(mVec3_c(-100.0f, -100.0f, -100.0f), mVec3_c(100.0f, 100.0f, 100.0f)); | ||
|
||
rotation.y = cM::rndF(65535.0f); | ||
someRot = rotation.y.mVal; | ||
|
||
switch (getParam1()) { | ||
case 0: | ||
case 7: | ||
mType = 0; | ||
break; | ||
case 1: | ||
mType = 1; | ||
break; | ||
case 2: | ||
mType = 2; | ||
break; | ||
case 3: | ||
case 4: | ||
case 5: | ||
rotation.z = -0x8000; | ||
break; | ||
default: | ||
break; | ||
} | ||
|
||
if (mType == 0) { | ||
u32 param2 = getParam2(); | ||
if (param2 == 1) { | ||
mType = 1; | ||
} else if (param2 == 2) { | ||
mType = 2; | ||
} | ||
} | ||
|
||
if (mType == 2) { | ||
field_0x3CC = 1; | ||
someFloat = 1.0f; | ||
} | ||
|
||
if (mType != 0) { | ||
actor_properties &= ~1; | ||
} | ||
|
||
mStartingPos = position; | ||
|
||
return SUCCEEDED; | ||
} | ||
|
||
int dAcEhb_leaf_c::doDelete() { | ||
return 1; | ||
} | ||
|
||
int dAcEhb_leaf_c::actorExecute() { | ||
if (mType != 0) { | ||
doCheck(); | ||
if (isNearZero()) { | ||
return 1; | ||
} | ||
} | ||
|
||
updateMatrix(); | ||
if (mType != 0) { | ||
Mtx m; | ||
PSMTXScale(m, someFloat, someFloat, someFloat); | ||
PSMTXConcat(worldMatrix.m, m, worldMatrix.m); | ||
} | ||
mModel.getModel().setLocalMtx(worldMatrix); | ||
mModel.getModel().calc(false); | ||
someRot++; | ||
|
||
return 1; | ||
} | ||
|
||
int dAcEhb_leaf_c::draw() { | ||
if (!isHidden()) { | ||
drawModelType1(&mModel.getModel()); | ||
} | ||
|
||
return 1; | ||
} | ||
|
||
void dAcEhb_leaf_c::setAnm(const char *anm, f32 pos) { | ||
mModel.setAnm(anm, m3d::PLAY_MODE_4, pos); | ||
} |
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