mirror of
https://github.com/zeldaret/ss
synced 2026-06-30 03:18:55 -04:00
d_a_obj_desert_debris 93%
This commit is contained in:
@@ -2,16 +2,16 @@ _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
|
||||
dAcOdesertDebris_c_classInit__Fv = .text:0x00000070; // type:function size:0x64
|
||||
AcOdesertDebris__initModels = .text:0x000000E0; // type:function size:0x114
|
||||
AcOdesertDebris__init = .text:0x00000200; // type:function size:0xF0
|
||||
AcOdesertDebris__destroy = .text:0x000002F0; // type:function size:0x38
|
||||
AcOdesertDebris__update = .text:0x00000330; // type:function size:0x40
|
||||
AcOdesertDebris__draw = .text:0x00000370; // type:function size:0x28
|
||||
AcOdesertDebris__checkStoryFlag = .text:0x000003A0; // type:function size:0x5C
|
||||
createHeap__18dAcOdesertDebris_cFv = .text:0x000000E0; // type:function size:0x114
|
||||
create__18dAcOdesertDebris_cFv = .text:0x00000200; // type:function size:0xF0
|
||||
doDelete__18dAcOdesertDebris_cFv = .text:0x000002F0; // type:function size:0x38
|
||||
actorExecute__18dAcOdesertDebris_cFv = .text:0x00000330; // type:function size:0x40
|
||||
draw__18dAcOdesertDebris_cFv = .text:0x00000370; // type:function size:0x28
|
||||
checkStoryFlag__18dAcOdesertDebris_cFv = .text:0x000003A0; // type:function size:0x5C
|
||||
__dt__18dAcOdesertDebris_cFv = .text:0x00000400; // type:function size:0x74
|
||||
_ctors = .ctors:0x00000000; // type:label scope:global
|
||||
_dtors = .dtors:0x00000000; // type:label scope:global
|
||||
lbl_428_rodata_0 = .rodata:0x00000000; // type:object size:0x4 data:float
|
||||
lbl_428_rodata_0 = .rodata:0x00000000; // type:object size:0x4 scope:local data:float
|
||||
g_profile_OBJ_DESERT_DEBRIS = .data:0x00000000; // type:object size:0x70
|
||||
lbl_428_data_70 = .data:0x00000070; // type:object size:0x20 data:string
|
||||
lbl_428_data_70 = .data:0x00000070; // type:object size:0x20 scope:local data:string
|
||||
AcOdesertDebris__vtable = .data:0x00000090; // type:object size:0x80
|
||||
|
||||
@@ -2,13 +2,28 @@
|
||||
#define D_A_OBJ_DESERT_DEBRIS_H
|
||||
|
||||
#include "d/a/obj/d_a_obj_base.h"
|
||||
#include "d/col/bg/d_bg_w.h"
|
||||
#include "m/m3d/m_smdl.h"
|
||||
#include "nw4r/g3d/res/g3d_resfile.h"
|
||||
|
||||
class dAcOdesertDebris_c : public dAcObjBase_c {
|
||||
public:
|
||||
dAcOdesertDebris_c() {}
|
||||
virtual ~dAcOdesertDebris_c() {}
|
||||
|
||||
virtual bool createHeap() override;
|
||||
virtual int create() override;
|
||||
virtual int doDelete() override;
|
||||
virtual int actorExecute() override;
|
||||
virtual int draw() override;
|
||||
|
||||
bool checkStoryFlag();
|
||||
|
||||
private:
|
||||
nw4r::g3d::ResFile mResFile;
|
||||
m3d::smdl_c mMdl;
|
||||
dBgW mBgW;
|
||||
u16 mStoryFlag;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,3 +1,64 @@
|
||||
#include "d/a/obj/d_a_obj_desert_debris.h"
|
||||
|
||||
#include "common.h"
|
||||
#include "d/a/obj/d_a_obj_base.h"
|
||||
#include "d/col/bg/d_bg_s.h"
|
||||
#include "d/flag/storyflag_manager.h"
|
||||
#include "f/f_base.h"
|
||||
#include "m/m_vec.h"
|
||||
#include "nw4r/g3d/res/g3d_resfile.h"
|
||||
#include "nw4r/g3d/res/g3d_resmdl.h"
|
||||
#include "toBeSorted/arc_managers/current_stage_arc_manager.h"
|
||||
|
||||
SPECIAL_ACTOR_PROFILE(OBJ_DESERT_DEBRIS, dAcOdesertDebris_c, fProfile::OBJ_DESERT_DEBRIS, 0x213, 0, 2);
|
||||
|
||||
bool dAcOdesertDebris_c::createHeap() {
|
||||
void *data = CurrentStageArcManager::GetInstance()->getData("g3d/stage.brres");
|
||||
mResFile = nw4r::g3d::ResFile(data);
|
||||
nw4r::g3d::ResMdl mdl = mResFile.GetResMdl("StageF300_4Gareki");
|
||||
TRY_CREATE(mMdl.create(mdl, &heap_allocator, 0x120, 1, nullptr));
|
||||
void *dzb = CurrentStageArcManager::GetInstance()->getData("dzb/StageF300_4Gareki.dzb");
|
||||
void *plc = CurrentStageArcManager::GetInstance()->getData("dat/StageF300_4Gareki.plc");
|
||||
updateMatrix();
|
||||
mMdl.setLocalMtx(mWorldMtx);
|
||||
TRY_CREATE(!mBgW.Set((cBgD_t *)dzb, (PLC *)plc, 1, &mWorldMtx, &mScale));
|
||||
mBgW.Lock();
|
||||
return mBgW.InitMapStuff(&heap_allocator);
|
||||
}
|
||||
|
||||
int dAcOdesertDebris_c::create() {
|
||||
CREATE_ALLOCATOR(dAcOdesertDebris_c);
|
||||
dBgS::GetInstance()->Regist(&mBgW, this);
|
||||
dBgS::GetInstance()->RegistBg(&mBgW, this);
|
||||
mStoryFlag = getFromParams(0, 0x7FF);
|
||||
if (checkStoryFlag()) {
|
||||
return FAILED;
|
||||
}
|
||||
mMdl.setPriorityDraw(0x1C, 9);
|
||||
mVec3_c min, max;
|
||||
mMdl.getBounds(&min, &max);
|
||||
boundingBox.Set(min, max);
|
||||
mCullingDistance = 50000.0f;
|
||||
return SUCCEEDED;
|
||||
}
|
||||
|
||||
int dAcOdesertDebris_c::doDelete() {
|
||||
dBgS::GetInstance()->UnRegist(&mBgW);
|
||||
return SUCCEEDED;
|
||||
}
|
||||
|
||||
int dAcOdesertDebris_c::actorExecute() {
|
||||
if (checkStoryFlag()) {
|
||||
deleteRequest();
|
||||
}
|
||||
return SUCCEEDED;
|
||||
}
|
||||
|
||||
int dAcOdesertDebris_c::draw() {
|
||||
drawModelType1(&mMdl);
|
||||
return SUCCEEDED;
|
||||
}
|
||||
|
||||
bool dAcOdesertDebris_c::checkStoryFlag() {
|
||||
return mStoryFlag < 0x7FF && StoryflagManager::sInstance->getCounterOrFlag(mStoryFlag);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user