mirror of
https://github.com/zeldaret/ss
synced 2026-08-09 10:53:09 -04:00
Merge branch 'zeldaret:main' into d_a_obj_girahim_foot
This commit is contained in:
@@ -91,7 +91,7 @@ fn_129_8390 = .text:0x00008390; // type:function size:0x374
|
||||
fn_129_8710 = .text:0x00008710; // type:function size:0x29C
|
||||
fn_129_89B0 = .text:0x000089B0; // type:function size:0x3C4
|
||||
fn_129_8D80 = .text:0x00008D80; // type:function size:0x4C
|
||||
fn_129_8DD0 = .text:0x00008DD0; // type:function size:0xB8
|
||||
accelerateTowards__7dBird_cFR7mVec3_c = .text:0x00008DD0; // type:function size:0xB8
|
||||
fn_129_8E90 = .text:0x00008E90; // type:function size:0x2B4
|
||||
changesRot = .text:0x00009150; // type:function size:0x74
|
||||
fn_129_91D0 = .text:0x000091D0; // type:function size:0x374
|
||||
@@ -252,7 +252,7 @@ lbl_129_data_B50 = .data:0x00000B50; // type:object size:0xC data:string
|
||||
lbl_129_data_B5C = .data:0x00000B5C; // type:object size:0xC
|
||||
__global_destructor_chain = .bss:0x00000000; // type:object size:0x4 scope:global
|
||||
lbl_129_bss_8 = .bss:0x00000008; // type:object size:0x14 data:4byte
|
||||
LOFTWING_POINTER = .bss:0x0000001C; // type:object size:0x94 data:4byte
|
||||
spInstance__7dBird_c = .bss:0x0000001C; // type:object size:0x94 data:4byte
|
||||
AcBird__STATE_MOVE = .bss:0x000000B0; // type:object size:0x40 data:4byte
|
||||
AcBird__STATE_HIDE = .bss:0x000000F0; // type:object size:0x40 data:4byte
|
||||
AcBird__STATE_RIDE_DEMO = .bss:0x00000130; // type:object size:0xC0 data:4byte
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
dAcOF400GateSeal_c_classInit__Fv = .text:0x00000070; // type:function size:0x98
|
||||
AcOF400GateSeal__initModels = .text:0x00000110; // type:function size:0x11C
|
||||
fn_629_230 = .text:0x00000230; // type:function size:0x8
|
||||
AcOF400GateSeal__init = .text:0x00000240; // type:function size:0x1A4
|
||||
fn_629_3F0 = .text:0x000003F0; // type:function size:0xD8
|
||||
AcOF400GateSeal__draw = .text:0x000004D0; // type:function size:0x28
|
||||
createHeap__18dAcOF400GateSeal_cFv = .text:0x00000110; // type:function size:0x11C
|
||||
actorCreate__18dAcOF400GateSeal_cFv = .text:0x00000230; // type:function size:0x8
|
||||
actorPostCreate__18dAcOF400GateSeal_cFv = .text:0x00000240; // type:function size:0x1A4
|
||||
actorExecute__18dAcOF400GateSeal_cFv = .text:0x000003F0; // type:function size:0xD8
|
||||
draw__18dAcOF400GateSeal_cFv = .text:0x000004D0; // type:function size:0x28
|
||||
__dt__18dAcOF400GateSeal_cFv = .text:0x00000500; // type:function size:0x84
|
||||
_ctors = .ctors:0x00000000; // type:label scope:global
|
||||
_dtors = .dtors:0x00000000; // type:label scope:global
|
||||
lbl_629_rodata_0 = .rodata:0x00000000; // type:object size:0x4 data:float
|
||||
lbl_629_rodata_0 = .rodata:0x00000000; // type:object size:0x4 scope:local data:float
|
||||
g_profile_OBJ_F400_GATE_SEAL = .data:0x00000000; // type:object size:0x10
|
||||
lbl_629_data_10 = .data:0x00000010; // type:object size:0x10
|
||||
lbl_629_data_20 = .data:0x00000020; // type:object size:0x20 data:string
|
||||
AcOF400GateSeal__vtable = .data:0x00000040; // type:object size:0x80
|
||||
lbl_629_data_10 = .data:0x00000010; // type:object size:0x10 scope:local
|
||||
lbl_629_data_20 = .data:0x00000020; // type:object size:0x20 scope:local data:string
|
||||
__vt__18dAcOF400GateSeal_c = .data:0x00000040; // type:object size:0x80
|
||||
|
||||
@@ -2,15 +2,15 @@ _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
|
||||
dAcObjBirdSp_c_classInit__Fv = .text:0x00000070; // type:function size:0x54
|
||||
fn_241_D0 = .text:0x000000D0; // type:function size:0x8
|
||||
AcObjBirdSp__init = .text:0x000000E0; // type:function size:0xC4
|
||||
AcObjBirdSp__update = .text:0x000001B0; // type:function size:0x230
|
||||
fn_241_3E0 = .text:0x000003E0; // type:function size:0x8
|
||||
createHeap__14dAcObjBirdSp_cFv = .text:0x000000D0; // type:function size:0x8
|
||||
create__14dAcObjBirdSp_cFv = .text:0x000000E0; // type:function size:0xC4
|
||||
actorExecute__14dAcObjBirdSp_cFv = .text:0x000001B0; // type:function size:0x230
|
||||
draw__14dAcObjBirdSp_cFv = .text:0x000003E0; // type:function size:0x8
|
||||
__dt__14dAcObjBirdSp_cFv = .text:0x000003F0; // type:function size:0x68
|
||||
_ctors = .ctors:0x00000000; // type:label scope:global
|
||||
_dtors = .dtors:0x00000000; // type:label scope:global
|
||||
lbl_241_rodata_0 = .rodata:0x00000000; // type:object size:0x18 data:float
|
||||
lbl_241_rodata_0 = .rodata:0x00000000; // type:object size:0x18 scope:local data:float
|
||||
AcObjBirdSp__colliderInit = .data:0x00000000; // type:object size:0x30
|
||||
g_profile_OBJ_BIRD_SP_UP = .data:0x00000030; // type:object size:0x10
|
||||
lbl_241_data_40 = .data:0x00000040; // type:object size:0x20
|
||||
AcObjBirdSp__vtable = .data:0x00000060; // type:object size:0x80
|
||||
@14827 = .data:0x00000040; // type:object size:0x20 scope:local
|
||||
__vt__14dAcObjBirdSp_c = .data:0x00000060; // type:object size:0x80
|
||||
|
||||
@@ -20,7 +20,7 @@ fn_572_1250 = .text:0x00001250; // type:function size:0x16C4
|
||||
fn_572_2920 = .text:0x00002920; // type:function size:0x1C
|
||||
AcODoor__update = .text:0x00002940; // type:function size:0x808
|
||||
fn_572_3150 = .text:0x00003150; // type:function size:0x98
|
||||
AcODoor__isLocked = .text:0x000031F0; // type:function size:0x158
|
||||
isLocked__10dAcOdoor_cFv = .text:0x000031F0; // type:function size:0x158
|
||||
fn_572_3350 = .text:0x00003350; // type:function size:0x84
|
||||
fn_572_33E0 = .text:0x000033E0; // type:function size:0xC
|
||||
fn_572_33F0 = .text:0x000033F0; // type:function size:0x78
|
||||
|
||||
@@ -2,7 +2,7 @@ _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
|
||||
dAcOMapparts_c_classInit__Fv = .text:0x00000070; // type:function size:0x4C
|
||||
AcOMapparts__init = .text:0x000000C0; // type:function size:0x8
|
||||
create__14dAcOMapparts_cFv = .text:0x000000C0; // type:function size:0x8
|
||||
__dt__14dAcOMapparts_cFv = .text:0x000000D0; // type:function size:0x58
|
||||
_ctors = .ctors:0x00000000; // type:label scope:global
|
||||
_dtors = .dtors:0x00000000; // type:label scope:global
|
||||
|
||||
+4
-4
@@ -1957,7 +1957,7 @@ config.libs = [
|
||||
Rel(
|
||||
NonMatching, "d_a_obj_bigbomb_flower", "REL/d/a/obj/d_a_obj_bigbomb_flower.cpp"
|
||||
),
|
||||
Rel(NonMatching, "d_a_obj_bird_sp", "REL/d/a/obj/d_a_obj_bird_sp.cpp"),
|
||||
Rel(Matching, "d_a_obj_bird_sp", "REL/d/a/obj/d_a_obj_bird_sp.cpp"),
|
||||
Rel(Matching, "d_a_obj_bird_statue", "REL/d/a/obj/d_a_obj_bird_statue.cpp"),
|
||||
Rel(NonMatching, "d_a_obj_blade", "REL/d/a/obj/d_a_obj_blade.cpp"),
|
||||
Rel(NonMatching, "d_a_obj_blast_rock", "REL/d/a/obj/d_a_obj_blast_rock.cpp"),
|
||||
@@ -2044,10 +2044,10 @@ 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"
|
||||
Matching, "d_a_obj_F400_gate_seal", "REL/d/a/obj/d_a_obj_F400_gate_seal.cpp"
|
||||
),
|
||||
Rel(NonMatching, "d_a_obj_farmland", "REL/d/a/obj/d_a_obj_farmland.cpp"),
|
||||
Rel(NonMatching, "d_a_obj_fence", "REL/d/a/obj/d_a_obj_fence.cpp"),
|
||||
@@ -2147,7 +2147,7 @@ config.libs = [
|
||||
Rel(NonMatching, "d_a_obj_lotus", "REL/d/a/obj/d_a_obj_lotus.cpp"),
|
||||
Rel(NonMatching, "d_a_obj_lotus_flower", "REL/d/a/obj/d_a_obj_lotus_flower.cpp"),
|
||||
Rel(NonMatching, "d_a_obj_lotus_seed", "REL/d/a/obj/d_a_obj_lotus_seed.cpp"),
|
||||
Rel(NonMatching, "d_a_obj_mapparts", "REL/d/a/obj/d_a_obj_mapparts.cpp"),
|
||||
Rel(Matching, "d_a_obj_mapparts", "REL/d/a/obj/d_a_obj_mapparts.cpp"),
|
||||
Rel(Matching, "d_a_obj_megami_island", "REL/d/a/obj/d_a_obj_megami_island.cpp"),
|
||||
Rel(NonMatching, "d_a_obj_mg_pumpkin", "REL/d/a/obj/d_a_obj_mg_pumpkin.cpp"),
|
||||
Rel(NonMatching, "d_a_obj_mole_cover", "REL/d/a/obj/d_a_obj_mole_cover.cpp"),
|
||||
|
||||
@@ -26,11 +26,19 @@ public:
|
||||
STATE_FUNC_DECLARE(dBird_c, MiniGameEnd);
|
||||
STATE_FUNC_DECLARE(dBird_c, MiniGameLevelUpDemo);
|
||||
|
||||
// fn_129_8DD0, only referenced by d_a_obj_bird_sp
|
||||
void accelerateTowards(mVec3_c &targetDirection);
|
||||
|
||||
s16 getNumDashes() const {
|
||||
return mNumDashes;
|
||||
}
|
||||
|
||||
static dBird_c *getInstance() {
|
||||
return spInstance;
|
||||
}
|
||||
|
||||
private:
|
||||
static dBird_c *spInstance;
|
||||
/* 0x??? */ STATE_MGR_DECLARE(dBird_c);
|
||||
u8 _0x36C[0xF8E - 0x36C];
|
||||
/* 0xF8E */ s16 mNumDashes;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -2,13 +2,25 @@
|
||||
#define D_A_OBJ_F400_GATE_SEAL_H
|
||||
|
||||
#include "d/a/obj/d_a_obj_base.h"
|
||||
#include "d/a/obj/d_a_obj_door.h"
|
||||
#include "m/m3d/m_anmmatclr.h"
|
||||
#include "m/m3d/m_smdl.h"
|
||||
|
||||
class dAcOF400GateSeal_c : public dAcObjBase_c {
|
||||
public:
|
||||
dAcOF400GateSeal_c() {}
|
||||
virtual ~dAcOF400GateSeal_c() {}
|
||||
|
||||
virtual bool createHeap() override;
|
||||
virtual int actorCreate() override;
|
||||
virtual int actorPostCreate() override;
|
||||
virtual int actorExecute() override;
|
||||
virtual int draw() override;
|
||||
|
||||
private:
|
||||
/* 0x330 */ m3d::smdl_c mMdl;
|
||||
/* 0x34C */ m3d::anmMatClr_c mAnmClr;
|
||||
/* 0x378 */ dAcRef_c<dAcOdoor_c> mDoor;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -2,13 +2,21 @@
|
||||
#define D_A_OBJ_BIRD_SP_H
|
||||
|
||||
#include "d/a/obj/d_a_obj_base.h"
|
||||
#include "d/col/cc/d_cc_d.h"
|
||||
|
||||
class dAcObjBirdSp_c : public dAcObjBase_c {
|
||||
public:
|
||||
dAcObjBirdSp_c() {}
|
||||
virtual ~dAcObjBirdSp_c() {}
|
||||
|
||||
virtual bool createHeap() override;
|
||||
virtual int create() override;
|
||||
virtual int actorExecute() override;
|
||||
virtual int draw() override;
|
||||
|
||||
private:
|
||||
static dCcD_SrcSph sCcSrc;
|
||||
/* 0x330 */ dCcD_Sph mCollider;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -8,6 +8,8 @@ public:
|
||||
dAcOdoor_c() {}
|
||||
virtual ~dAcOdoor_c() {}
|
||||
|
||||
bool isLocked();
|
||||
|
||||
private:
|
||||
};
|
||||
|
||||
|
||||
@@ -8,6 +8,8 @@ public:
|
||||
dAcOMapparts_c() {}
|
||||
virtual ~dAcOMapparts_c() {}
|
||||
|
||||
virtual int create() override;
|
||||
|
||||
private:
|
||||
};
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -18,6 +18,8 @@ STATE_DEFINE(dBird_c, MiniGameMove);
|
||||
STATE_DEFINE(dBird_c, MiniGameEnd);
|
||||
STATE_DEFINE(dBird_c, MiniGameLevelUpDemo);
|
||||
|
||||
dBird_c *dBird_c::spInstance;
|
||||
|
||||
void dBird_c::initializeState_Wait() {}
|
||||
void dBird_c::executeState_Wait() {}
|
||||
void dBird_c::finalizeState_Wait() {}
|
||||
@@ -63,3 +65,5 @@ void dBird_c::finalizeState_MiniGameEnd() {}
|
||||
void dBird_c::initializeState_MiniGameLevelUpDemo() {}
|
||||
void dBird_c::executeState_MiniGameLevelUpDemo() {}
|
||||
void dBird_c::finalizeState_MiniGameLevelUpDemo() {}
|
||||
|
||||
void dBird_c::accelerateTowards(mVec3_c &targetDirection) {}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,115 @@
|
||||
#include "d/a/obj/d_a_obj_F400_gate_seal.h"
|
||||
|
||||
#include "common.h"
|
||||
#include "d/a/obj/d_a_obj_base.h"
|
||||
#include "d/a/obj/d_a_obj_door.h"
|
||||
#include "f/f_base.h"
|
||||
#include "f/f_profile_name.h"
|
||||
#include "m/m3d/m_anmmatclr.h"
|
||||
#include "nw4r/g3d/res/g3d_resanmclr.h"
|
||||
#include "nw4r/g3d/res/g3d_resfile.h"
|
||||
#include "nw4r/g3d/res/g3d_resmdl.h"
|
||||
#include "rvl/MTX/vec.h"
|
||||
|
||||
SPECIAL_ACTOR_PROFILE(OBJ_F400_GATE_SEAL, dAcOF400GateSeal_c, fProfile::OBJ_F400_GATE_SEAL, 0x287, 0, 6);
|
||||
|
||||
bool dAcOF400GateSeal_c::createHeap() {
|
||||
void *data = dAcObjBase_c::getOarcResFile("F400GateSeal");
|
||||
if (data == nullptr) {
|
||||
return false;
|
||||
}
|
||||
|
||||
nw4r::g3d::ResFile resFile(data);
|
||||
if (!resFile.IsValid()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
nw4r::g3d::ResMdl mdl = resFile.GetResMdl("F400GateSeal");
|
||||
if (!mdl.IsValid()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!mMdl.create(mdl, &heap_allocator, 0)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
nw4r::g3d::ResAnmClr anmClr = resFile.GetResAnmClr("F400GateSeal");
|
||||
if (!anmClr.IsValid()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!mAnmClr.create(mdl, anmClr, &heap_allocator, 0, 1)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return mMdl.setAnm(mAnmClr);
|
||||
}
|
||||
|
||||
int dAcOF400GateSeal_c::actorCreate() {
|
||||
return SUCCEEDED;
|
||||
}
|
||||
|
||||
int dAcOF400GateSeal_c::actorPostCreate() {
|
||||
bool notDone = true;
|
||||
dAcOdoor_c *parent = (dAcOdoor_c *)fManager_c::searchBaseByProfName(fProfile::OBJ_DOOR, nullptr);
|
||||
dAcOdoor_c *door;
|
||||
|
||||
while (notDone && parent != nullptr) {
|
||||
if (10000.0f < PSVECSquareDistance(position, parent->position)) {
|
||||
parent = (dAcOdoor_c *)fManager_c::searchBaseByProfName(fProfile::OBJ_DOOR, parent);
|
||||
door = parent;
|
||||
} else {
|
||||
notDone = false;
|
||||
}
|
||||
}
|
||||
if (notDone) {
|
||||
return FAILED;
|
||||
}
|
||||
|
||||
mDoor.link(door);
|
||||
CREATE_ALLOCATOR(dAcOF400GateSeal_c);
|
||||
if (mDoor.get() == nullptr) {
|
||||
return FAILED;
|
||||
}
|
||||
if (mDoor.get()->isLocked()) {
|
||||
mAnmClr.setFrame(mAnmClr.getFrameStart(0), 0);
|
||||
} else {
|
||||
mAnmClr.setFrame(mAnmClr.getFrameMax(0), 0);
|
||||
}
|
||||
mMdl.setPriorityDraw(0x1C, 9);
|
||||
updateMatrix();
|
||||
mMdl.setLocalMtx(mWorldMtx);
|
||||
mVec3_c min, max;
|
||||
mMdl.getBounds(&min, &max);
|
||||
boundingBox.Set(min, max);
|
||||
return SUCCEEDED;
|
||||
}
|
||||
|
||||
int dAcOF400GateSeal_c::actorExecute() {
|
||||
if (mDoor.get() == nullptr) {
|
||||
return SUCCEEDED;
|
||||
}
|
||||
|
||||
if (mDoor.get()->isLocked()) {
|
||||
f32 frame = mAnmClr.getFrameStart(0);
|
||||
mAnmClr.setFrame(frame, 0);
|
||||
} else {
|
||||
if (checkObjectProperty(2)) {
|
||||
f32 frame = mAnmClr.getFrameMax(0);
|
||||
mAnmClr.setFrame(frame, 0);
|
||||
} else {
|
||||
mAnmClr.play();
|
||||
}
|
||||
}
|
||||
if (mAnmClr.isStop(0)) {
|
||||
setObjectProperty(0x200);
|
||||
} else {
|
||||
clearObjectProperty(0x200);
|
||||
}
|
||||
return SUCCEEDED;
|
||||
}
|
||||
|
||||
int dAcOF400GateSeal_c::draw() {
|
||||
dAcObjBase_c::drawModelType1(&mMdl);
|
||||
return SUCCEEDED;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,68 @@
|
||||
#include "d/a/obj/d_a_obj_bird_sp.h"
|
||||
|
||||
#include "d/a/d_a_bird.h"
|
||||
#include "d/col/c/c_cc_d.h"
|
||||
#include "d/col/cc/d_cc_s.h"
|
||||
#include "f/f_base.h"
|
||||
#include "f/f_profile_name.h"
|
||||
#include "m/m_mtx.h"
|
||||
|
||||
// clang-format off
|
||||
dCcD_SrcSph dAcObjBirdSp_c::sCcSrc = {
|
||||
/* mObjInf */ {
|
||||
/* mObjAt */ {0, 2, {0, 0, 0}, 0, 0, 0, 0, 0, 0},
|
||||
// AT_TYPE_COMMON0 - AT_TYPE_WIND
|
||||
/* mObjTg */ {~(AT_TYPE_BUGNET | AT_TYPE_BEETLE | AT_TYPE_0x80000 | AT_TYPE_0x8000), 0x00000105, {0, 00, 0x407}, 0, 0},
|
||||
/* mObjCo */ {0x00004029}},
|
||||
/* mSphInf */ {1000.0f}
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
SPECIAL_ACTOR_PROFILE(OBJ_BIRD_SP_UP, dAcObjBirdSp_c, fProfile::OBJ_BIRD_SP_UP, 0x260, 0, 1);
|
||||
|
||||
bool dAcObjBirdSp_c::createHeap() {
|
||||
return SUCCEEDED;
|
||||
}
|
||||
|
||||
int dAcObjBirdSp_c::create() {
|
||||
CREATE_ALLOCATOR(dAcObjBirdSp_c);
|
||||
|
||||
boundingBox.Set(mVec3_c(-2000, -2000, -2000), mVec3_c(2000, 2000, 2000));
|
||||
mCollider.Set(sCcSrc);
|
||||
mCollider.SetStts(mStts);
|
||||
mCollider.SetR(mScale.x * 1000.0f);
|
||||
|
||||
return SUCCEEDED;
|
||||
}
|
||||
int dAcObjBirdSp_c::actorExecute() {
|
||||
/* if its colliding with Bird or Player */
|
||||
if (mCollider.ChkCoHit() && mCollider.GetCoActor() != nullptr &&
|
||||
(mCollider.GetCoActor()->profile_name == fProfile::BIRD ||
|
||||
mCollider.GetCoActor()->profile_name == fProfile::PLAYER)) {
|
||||
mVec3_c posChange(0, -0.2, 1.0);
|
||||
mMtx_c matrix;
|
||||
matrix.ZXYrotS(rotation);
|
||||
PSMTXMultVec(matrix.m, posChange, posChange);
|
||||
|
||||
f32 angle = (position - dBird_c::getInstance()->position).dot(posChange);
|
||||
if (angle < 0.0f) {
|
||||
posChange = -posChange;
|
||||
}
|
||||
|
||||
posChange *= 1000.0f;
|
||||
posChange += position;
|
||||
posChange -= dBird_c::getInstance()->position;
|
||||
dBird_c::getInstance()->accelerateTowards(posChange);
|
||||
}
|
||||
|
||||
mCollider.SetC(position);
|
||||
dCcS::GetInstance()->Set(&mCollider);
|
||||
mWorldMtx.transS(position.x, position.y, position.z);
|
||||
mWorldMtx.ZXYrotM(rotation);
|
||||
|
||||
return SUCCEEDED;
|
||||
}
|
||||
|
||||
int dAcObjBirdSp_c::draw() {
|
||||
return SUCCEEDED;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
#include "d/a/obj/d_a_obj_mapparts.h"
|
||||
#include "f/f_base.h"
|
||||
|
||||
SPECIAL_ACTOR_PROFILE(OBJ_MAPPARTS, dAcOMapparts_c, fProfile::OBJ_MAPPARTS, 0x288, 0, 0);
|
||||
|
||||
int dAcOMapparts_c::create() {
|
||||
return FAILED;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user