Merge pull request #191 from swekka/d_a_obj_F400_gate_leaf

d_a_obj_F400_gate_leaf OK
This commit is contained in:
robojumper
2025-05-28 19:06:59 +02:00
committed by GitHub
5 changed files with 72 additions and 8 deletions
@@ -2,14 +2,14 @@ _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
g_profile_OBJ_F400_GATE_LEAF = .data:0x00000000; // type:object size:0x10
lbl_628_section4_10 = .data:0x00000010; // type:object size:0x10
lbl_628_section4_20 = .data:0x00000020; // type:object size:0x20 data:string
lbl_628_section4_40 = .data:0x00000040; // type:object size:0x80
lbl_628_section4_10 = .data:0x00000010; // type:object size:0x10 scope:local
lbl_628_section4_20 = .data:0x00000020; // type:object size:0x20 scope:local data:string
__vt__18dAcOF400GateLeaf_c = .data:0x00000040; // type:object size:0x80
+1 -1
View File
@@ -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(
Matching, "d_a_obj_F400_gate_seal", "REL/d/a/obj/d_a_obj_F400_gate_seal.cpp"
+7
View File
@@ -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
+4
View File
@@ -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;
}