d_a_obj_treasure_island mostly done

This commit is contained in:
CovenEsme
2025-03-14 07:00:51 +00:00
parent b3b140ff7f
commit 1f47b66472
4 changed files with 180 additions and 35 deletions
@@ -11,3 +11,5 @@ REL/executor.c:
REL/d/a/obj/d_a_obj_treasure_island.cpp:
.text start:0x00000070 end:0x0000076C
.rodata start:0x00000000 end:0x000000A4
.data start:0x00000000 end:0x00000218
@@ -2,41 +2,53 @@ _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
dAcOtreasureIsland_c_classInit__Fv = .text:0x00000070; // type:function size:0xF8
AcOtreasureIsland__initModels = .text:0x00000170; // type:function size:0x2B0
AcOtreasureIsland__init = .text:0x00000420; // type:function size:0x168
AcOtreasureIsland__destroy = .text:0x00000590; // type:function size:0x58
AcOtreasureIsland__update = .text:0x000005F0; // type:function size:0x5C
AcOtreasureIsland__draw = .text:0x00000650; // type:function size:0x58
createHeap__20dAcOtreasureIsland_cFv = .text:0x00000170; // type:function size:0x2B0
create__20dAcOtreasureIsland_cFv = .text:0x00000420; // type:function size:0x168
doDelete__20dAcOtreasureIsland_cFv = .text:0x00000590; // type:function size:0x58
actorExecute__20dAcOtreasureIsland_cFv = .text:0x000005F0; // type:function size:0x5C
draw__20dAcOtreasureIsland_cFv = .text:0x00000650; // type:function size:0x58
__dt__20dAcOtreasureIsland_cFv = .text:0x000006B0; // type:function size:0xBC
_ctors = .ctors:0x00000000; // type:label scope:global
_dtors = .dtors:0x00000000; // type:label scope:global
lbl_392_rodata_0 = .rodata:0x00000000; // type:object size:0xA4 data:float
lbl_392_data_0 = .data:0x00000000; // type:object size:0x8 data:string
lbl_392_data_8 = .data:0x00000008; // type:object size:0x8 data:string
lbl_392_data_10 = .data:0x00000010; // type:object size:0x8 data:string
lbl_392_data_18 = .data:0x00000018; // type:object size:0x8 data:string
lbl_392_data_20 = .data:0x00000020; // type:object size:0x8 data:string
lbl_392_data_28 = .data:0x00000028; // type:object size:0x8 data:string
lbl_392_data_30 = .data:0x00000030; // type:object size:0x8 data:string
lbl_392_data_38 = .data:0x00000038; // type:object size:0x8 data:string
lbl_392_data_40 = .data:0x00000040; // type:object size:0x10 data:string
lbl_392_data_50 = .data:0x00000050; // type:object size:0x10 data:string
lbl_392_data_60 = .data:0x00000060; // type:object size:0x10 data:string
lbl_392_data_70 = .data:0x00000070; // type:object size:0x10 data:string
lbl_392_data_80 = .data:0x00000080; // type:object size:0x10 data:string
lbl_392_data_90 = .data:0x00000090; // type:object size:0x10 data:string
lbl_392_data_A0 = .data:0x000000A0; // type:object size:0x10 data:string
lbl_392_data_B0 = .data:0x000000B0; // type:object size:0x10 data:string
lbl_392_data_C0 = .data:0x000000C0; // type:object size:0x10 data:string
lbl_392_data_D0 = .data:0x000000D0; // type:object size:0x10 data:string
lbl_392_data_E0 = .data:0x000000E0; // type:object size:0x10 data:string
lbl_392_data_F0 = .data:0x000000F0; // type:object size:0x10 data:string
lbl_392_data_100 = .data:0x00000100; // type:object size:0x10 data:string
lbl_392_data_110 = .data:0x00000110; // type:object size:0x10 data:string
lbl_392_data_120 = .data:0x00000120; // type:object size:0x10 data:string
lbl_392_data_130 = .data:0x00000130; // type:object size:0x10 data:string
lbl_392_rodata_00 = .rodata:0x00000000; // type:object size:0x4 scope:local data:float
lbl_392_rodata_04 = .rodata:0x00000004; // type:object size:0x4 scope:local data:float
lbl_392_rodata_08 = .rodata:0x00000008; // type:object size:0x20 scope:local
lbl_392_rodata_28 = .rodata:0x00000028; // type:object size:0x20 scope:local
lbl_392_rodata_48 = .rodata:0x00000048; // type:object size:0x20 scope:local
lbl_392_rodata_68 = .rodata:0x00000068; // type:object size:0x20 scope:local
lbl_392_rodata_88 = .rodata:0x00000088; // type:object size:0x4 scope:local data:float
lbl_392_rodata_8C = .rodata:0x0000008C; // type:object size:0x4 scope:local data:float
lbl_392_rodata_90 = .rodata:0x00000090; // type:object size:0x4 scope:local data:float
lbl_392_rodata_94 = .rodata:0x00000094; // type:object size:0x4 scope:local data:float
lbl_392_rodata_98 = .rodata:0x00000098; // type:object size:0x4 scope:local data:float
lbl_392_rodata_9C = .rodata:0x0000009C; // type:object size:0x4 scope:local data:float
lbl_392_rodata_A0 = .rodata:0x000000A0; // type:object size:0x4 scope:local data:float
lbl_392_data_00 = .data:0x00000000; // type:object size:0x8 scope:local data:string
lbl_392_data_08 = .data:0x00000008; // type:object size:0x8 scope:local data:string
lbl_392_data_10 = .data:0x00000010; // type:object size:0x8 scope:local data:string
lbl_392_data_18 = .data:0x00000018; // type:object size:0x8 scope:local data:string
lbl_392_data_20 = .data:0x00000020; // type:object size:0x8 scope:local data:string
lbl_392_data_28 = .data:0x00000028; // type:object size:0x8 scope:local data:string
lbl_392_data_30 = .data:0x00000030; // type:object size:0x8 scope:local data:string
lbl_392_data_38 = .data:0x00000038; // type:object size:0x8 scope:local data:string
lbl_392_data_40 = .data:0x00000040; // type:object size:0x10 scope:local data:string
lbl_392_data_50 = .data:0x00000050; // type:object size:0x10 scope:local data:string
lbl_392_data_60 = .data:0x00000060; // type:object size:0x10 scope:local data:string
lbl_392_data_70 = .data:0x00000070; // type:object size:0x10 scope:local data:string
lbl_392_data_80 = .data:0x00000080; // type:object size:0x10 scope:local data:string
lbl_392_data_90 = .data:0x00000090; // type:object size:0x10 scope:local data:string
lbl_392_data_A0 = .data:0x000000A0; // type:object size:0x10 scope:local data:string
lbl_392_data_B0 = .data:0x000000B0; // type:object size:0x10 scope:local data:string
lbl_392_data_C0 = .data:0x000000C0; // type:object size:0x10 scope:local data:string
lbl_392_data_D0 = .data:0x000000D0; // type:object size:0x10 scope:local data:string
lbl_392_data_E0 = .data:0x000000E0; // type:object size:0x10 scope:local data:string
lbl_392_data_F0 = .data:0x000000F0; // type:object size:0x10 scope:local data:string
lbl_392_data_100 = .data:0x00000100; // type:object size:0x10 scope:local data:string
lbl_392_data_110 = .data:0x00000110; // type:object size:0x10 scope:local data:string
lbl_392_data_120 = .data:0x00000120; // type:object size:0x10 scope:local data:string
lbl_392_data_130 = .data:0x00000130; // type:object size:0x10 scope:local data:string
g_profile_OBJ_TREASURE_ISLAND = .data:0x00000140; // type:object size:0x10
lbl_392_data_150 = .data:0x00000150; // type:object size:0x10
lbl_392_data_160 = .data:0x00000160; // type:object size:0x10
lbl_392_data_170 = .data:0x00000170; // type:object size:0x28
AcOtreasureIsland__vtable = .data:0x00000198; // type:object size:0x80
lbl_392_data_150 = .data:0x00000150; // type:object size:0x10 scope:local data:string
lbl_392_data_160 = .data:0x00000160; // type:object size:0x10 scope:local data:string
lbl_392_data_170 = .data:0x00000170; // type:object size:0x28 scope:local data:string
__vt__20dAcOtreasureIsland_c = .data:0x00000198; // type:object size:0x80
+19 -1
View File
@@ -2,11 +2,29 @@
#define D_A_OBJ_TREASURE_ISLAND_H
#include "d/a/obj/d_a_obj_base.h"
#include "d/col/bg/d_bg_w.h"
#include "m/m3d/m_anmtexsrt.h"
#include "toBeSorted/unk_with_water.h"
class dAcOtreasureIsland_c : public dAcObjBase_c {
public:
dAcOtreasureIsland_c() {}
virtual ~dAcOtreasureIsland_c() {}
virtual int create() override;
virtual int doDelete() override;
virtual int draw() override;
virtual bool createHeap() override;
virtual ~dAcOtreasureIsland_c() override;
virtual int actorExecute() override;
/* 0x330 */ UnkWithWater waterStuff;
/* 0x348 */ m3d::smdl_c mModel;
/* 0x364 */ m3d::smdl_c mWater00;
/* 0x380 */ m3d::smdl_c mWater01;
/* 0x39C */ m3d::anmTexSrt_c mWaterSrt00;
/* 0x3C8 */ m3d::anmTexSrt_c mWaterSrt01;
/* 0x3F4 */ nw4r::g3d::ResFile mResFile;
/* 0x3F8 */ dBgW mCollision;
/* 0x608 */ u8 subtype;
private:
};
+113
View File
@@ -1,3 +1,116 @@
#include "d/a/obj/d_a_obj_treasure_island.h"
#include "d/a/obj/d_a_obj_base.h"
#include "d/col/bg/d_bg_s.h"
#include "d/d_stage.h"
#include "d/d_stage_mgr.h"
static const char *const AcOtreasureIsland__OarcNames[] = {
"IslTreA", "IslTreB", "IslTreC", "IslTreD", "IslTreE", "IslTreF", "IslTreG", "IslTreH",
};
static const char *const AcOtreasureIsland__ModelNames[] = {
"IslTreA", "IslTreB", "IslTreC", "IslTreD", "IslTreE", "IslTreF", "IslTreG", "IslTreH",
};
static const char *const AcOtreasureIsland__DbzNames[] = {
"dzb/IslTreA.dzb", "dzb/IslTreB.dzb", "dzb/IslTreC.dzb", "dzb/IslTreD.dzb",
"dzb/IslTreE.dzb", "dzb/IslTreF.dzb", "dzb/IslTreG.dzb", "dzb/IslTreH.dzb",
};
static const char *const AcOtreasureIsland__PlcNames[] = {
"dat/IslTreA.plc", "dat/IslTreB.plc", "dat/IslTreC.plc", "dat/IslTreD.plc",
"dat/IslTreE.plc", "dat/IslTreF.plc", "dat/IslTreG.plc", "dat/IslTreH.plc",
};
SPECIAL_ACTOR_PROFILE(OBJ_TREASURE_ISLAND, dAcOtreasureIsland_c, fProfile::OBJ_TREASURE_ISLAND, 0x1EE, 0, 3);
bool dAcOtreasureIsland_c::createHeap() {
mResFile = nw4r::g3d::ResFile(getOarcResFile(AcOtreasureIsland__OarcNames[subtype]));
dStage_c::bindStageResToFile(&mResFile);
dStage_c::bindSkyCmnToResFile(&mResFile);
nw4r::g3d::ResMdl mdl;
nw4r::g3d::ResAnmTexSrt anmSrt;
mdl = mResFile.GetResMdl(AcOtreasureIsland__ModelNames[subtype]);
TRY_CREATE(mModel.create(mdl, &heap_allocator, 0x120));
if (subtype == 2) {
mdl = mResFile.GetResMdl("IslTreCWater00");
TRY_CREATE(mWater00.create(mdl, &heap_allocator, 0x324));
if (dStage_c::getMA0IndirectSrt(&anmSrt, mdl)) {
TRY_CREATE(mWaterSrt00.create(mdl, anmSrt, &heap_allocator, 0x0, 1));
}
mdl = mResFile.GetResMdl("IslTreCWater01");
UnkWithWater::linkMdl(mdl, &waterStuff);
TRY_CREATE(mWater01.create(mdl, &heap_allocator, 0x324));
if (dStage_c::getMA0IndirectSrt(&anmSrt, mdl)) {
TRY_CREATE(mWaterSrt01.create(mdl, anmSrt, &heap_allocator, 0x0, 1));
}
}
void *dzb = getOarcFile(AcOtreasureIsland__OarcNames[subtype], AcOtreasureIsland__DbzNames[subtype]);
void *plc = getOarcFile(AcOtreasureIsland__OarcNames[subtype], AcOtreasureIsland__PlcNames[subtype]);
updateMatrix();
mModel.setLocalMtx(mWorldMtx);
if (subtype == 2) {
mWater00.setLocalMtx(mWorldMtx);
mWater01.setLocalMtx(mWorldMtx);
}
TRY_CREATE(!mCollision.Set((cBgD_t *)dzb, (PLC *)plc, cBgW::MOVE_BG_e, &mWorldMtx, &mScale));
mCollision.Lock();
return mCollision.InitMapStuff(&heap_allocator);
}
int dAcOtreasureIsland_c::create() {
subtype = params & 0xf;
if (subtype == 2) {
dStageMgr_c::GetInstance()->initUnkWithWater(0, &waterStuff);
}
CREATE_ALLOCATOR(dAcOtreasureIsland_c);
dBgS::GetInstance()->Regist(&mCollision, this);
dBgS::GetInstance()->RegistBg(&mCollision, this);
mModel.setPriorityDraw(0x1C, 0x9);
if (subtype == 2) {
mWater00.setAnm(mWaterSrt00);
mWater01.setAnm(mWaterSrt01);
mWater01.setPriorityDraw(0x1C, 0x84);
mWater00.setPriorityDraw(0x1C, 0x9);
}
boundingBox.Set(mVec3_c(-1850.0f, -2050.0f, -1900.0f), mVec3_c(1950.0f, 2500.0f, 1850.0f));
mCullingDistance = 500000.0;
return SUCCEEDED;
}
int dAcOtreasureIsland_c::doDelete() {
if (subtype == 2) {
dStageMgr_c::GetInstance()->destroyUnkWithWater(0, &waterStuff);
}
dBgS::GetInstance()->UnRegist(&mCollision);
return SUCCEEDED;
}
int dAcOtreasureIsland_c::actorExecute() {
if (subtype == 2) {
mWaterSrt00.play();
mWaterSrt01.play();
}
return SUCCEEDED;
}
int dAcOtreasureIsland_c::draw() {
drawModelType1(&mModel);
if (subtype == 2) {
drawModelType1(&mWater00);
drawModelType1(&mWater01);
}
return SUCCEEDED;
}
dAcOtreasureIsland_c::~dAcOtreasureIsland_c() {}