mirror of
https://github.com/zeldaret/ss
synced 2026-05-25 23:35:13 -04:00
d_a_obj_F400_gate_leaf OK
This commit is contained in:
@@ -2,10 +2,10 @@ _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
|
||||
dAcOF400GateLeaf_c_classInit__Fv = .text:0x00000070; // type:function size:0x54
|
||||
fn_628_D0 = .text:0x000000D0; // type:function size:0x98
|
||||
AcOF400GateLeaf__init = .text:0x00000170; // type:function size:0xE4
|
||||
AcOF400GateLeaf__draw = .text:0x00000260; // type:function size:0x6C
|
||||
AcOF400GateLeaf__getStoryflag = .text:0x000002D0; // type:function size:0xC
|
||||
createHeap__18dAcOF400GateLeaf_cFv = .text:0x000000D0; // type:function size:0x98
|
||||
create__18dAcOF400GateLeaf_cFv = .text:0x00000170; // type:function size:0xE4
|
||||
draw__18dAcOF400GateLeaf_cFv = .text:0x00000260; // type:function size:0x6C
|
||||
getStoryflag__18dAcOF400GateLeaf_cFv = .text:0x000002D0; // type:function size:0xC
|
||||
__dt__18dAcOF400GateLeaf_cFv = .text:0x000002E0; // type:function size:0x68
|
||||
_ctors = .ctors:0x00000000; // type:label scope:global
|
||||
_dtors = .dtors:0x00000000; // type:label scope:global
|
||||
|
||||
+1
-1
@@ -2044,7 +2044,7 @@ config.libs = [
|
||||
Rel(NonMatching, "d_a_obj_evil_field", "REL/d/a/obj/d_a_obj_evil_field.cpp"),
|
||||
Rel(NonMatching, "d_a_obj_F302_light", "REL/d/a/obj/d_a_obj_F302_light.cpp"),
|
||||
Rel(
|
||||
NonMatching, "d_a_obj_F400_gate_leaf", "REL/d/a/obj/d_a_obj_F400_gate_leaf.cpp"
|
||||
Matching, "d_a_obj_F400_gate_leaf", "REL/d/a/obj/d_a_obj_F400_gate_leaf.cpp"
|
||||
),
|
||||
Rel(
|
||||
NonMatching, "d_a_obj_F400_gate_seal", "REL/d/a/obj/d_a_obj_F400_gate_seal.cpp"
|
||||
|
||||
@@ -8,7 +8,14 @@ public:
|
||||
dAcOF400GateLeaf_c() {}
|
||||
virtual ~dAcOF400GateLeaf_c() {}
|
||||
|
||||
virtual bool createHeap() override;
|
||||
virtual int create() override;
|
||||
virtual int draw() override;
|
||||
|
||||
u16 getStoryflag();
|
||||
|
||||
private:
|
||||
/* 0x330 */ m3d::smdl_c mMdl;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -35,6 +35,10 @@ public:
|
||||
|
||||
u16 getUncommittedValue_Priv(u16 flag) const;
|
||||
|
||||
u32 checkFlagValid(u16 counterIdx) const {
|
||||
return mpFlagIndex->checkFlagValid(counterIdx, mFlagCount);
|
||||
}
|
||||
|
||||
protected:
|
||||
|
||||
void setFlagSizes(u16 flagCount, u16 flagSizeBytes);
|
||||
|
||||
@@ -1,3 +1,56 @@
|
||||
#include "d/a/obj/d_a_obj_F400_gate_leaf.h"
|
||||
#include "common.h"
|
||||
#include "d/a/obj/d_a_obj_base.h"
|
||||
#include "d/flag/storyflag_manager.h"
|
||||
#include "f/f_base.h"
|
||||
#include "nw4r/g3d/res/g3d_resfile.h"
|
||||
|
||||
SPECIAL_ACTOR_PROFILE(OBJ_F400_GATE_LEAF, dAcOF400GateLeaf_c, fProfile::OBJ_F400_GATE_LEAF, 0x286, 0, 3);
|
||||
|
||||
bool dAcOF400GateLeaf_c::createHeap() {
|
||||
void *data = dAcObjBase_c::getOarcResFile("F400GateLeaf");
|
||||
if (data == nullptr) {
|
||||
return false;
|
||||
}
|
||||
|
||||
nw4r::g3d::ResFile resFile(data);
|
||||
if (!resFile.IsValid()){
|
||||
return false;
|
||||
}
|
||||
|
||||
nw4r::g3d::ResMdl mdl = resFile.GetResMdl("F400GateLeaf");
|
||||
if (!mdl.IsValid()){
|
||||
return false;
|
||||
}
|
||||
|
||||
return mMdl.create(mdl, &heap_allocator, 0, 1, nullptr);
|
||||
}
|
||||
|
||||
int dAcOF400GateLeaf_c::create() {
|
||||
u32 counterIdx = getStoryflag();
|
||||
u32 flagValid = StoryflagManager::sInstance->checkFlagValid(counterIdx);
|
||||
if (flagValid == 0) {
|
||||
return FAILED;
|
||||
}
|
||||
CREATE_ALLOCATOR(dAcOF400GateLeaf_c);
|
||||
mMdl.setPriorityDraw(0x1C, 9);
|
||||
updateMatrix();
|
||||
mMdl.setLocalMtx(mWorldMtx);
|
||||
mVec3_c min, max;
|
||||
mMdl.getBounds(&min,&max);
|
||||
boundingBox.Set(min, max);
|
||||
return SUCCEEDED;
|
||||
}
|
||||
|
||||
int dAcOF400GateLeaf_c::draw() {
|
||||
StoryflagManager *storyFlagManager = StoryflagManager::sInstance;
|
||||
u32 counterIdx = getStoryflag();
|
||||
if (!storyFlagManager->getCounterOrFlag(counterIdx)) {
|
||||
dAcObjBase_c::drawModelType1(&mMdl);
|
||||
}
|
||||
return SUCCEEDED;
|
||||
}
|
||||
|
||||
u16 dAcOF400GateLeaf_c::getStoryflag() {
|
||||
return params & 0xffff;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user