diff --git a/config/SOUE01/rels/d_t_barrel_posNP/symbols.txt b/config/SOUE01/rels/d_t_barrel_posNP/symbols.txt index 2b6313ec..b0bfb701 100644 --- a/config/SOUE01/rels/d_t_barrel_posNP/symbols.txt +++ b/config/SOUE01/rels/d_t_barrel_posNP/symbols.txt @@ -2,12 +2,12 @@ _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 dTgBarrelPos_c_classInit__Fv = .text:0x00000070; // type:function size:0x5C -TgBarrelPos__init = .text:0x000000D0; // type:function size:0x7C -fn_443_150 = .text:0x00000150; // type:function size:0x8 -fn_443_160 = .text:0x00000160; // type:function size:0xE0 -fn_443_240 = .text:0x00000240; // type:function size:0x8 +create__14dTgBarrelPos_cFv = .text:0x000000D0; // type:function size:0x7C +doDelete__14dTgBarrelPos_cFv = .text:0x00000150; // type:function size:0x8 +actorExecute__14dTgBarrelPos_cFv = .text:0x00000160; // type:function size:0xE0 +draw__14dTgBarrelPos_cFv = .text:0x00000240; // type:function size:0x8 __dt__14dTgBarrelPos_cFv = .text:0x00000250; // type:function size:0x74 _ctors = .ctors:0x00000000; // type:label scope:global _dtors = .dtors:0x00000000; // type:label scope:global g_profile_TAG_BARREL_POS = .data:0x00000000; // type:object size:0x10 -lbl_443_section4_10 = .data:0x00000010; // type:object size:0x74 +__vt__14dTgBarrelPos_c = .data:0x00000010; // type:object size:0x74 diff --git a/configure.py b/configure.py index 02365a0b..3e57bbf6 100644 --- a/configure.py +++ b/configure.py @@ -2878,7 +2878,7 @@ config.libs = [ Rel(NonMatching, "d_t_at0", "REL/d/t/d_t_at0.cpp"), Rel(NonMatching, "d_t_auto_message", "REL/d/t/d_t_auto_message.cpp"), Rel(NonMatching, "d_t_barrel", "REL/d/t/d_t_barrel.cpp"), - Rel(NonMatching, "d_t_barrel_pos", "REL/d/t/d_t_barrel_pos.cpp"), + Rel(Matching, "d_t_barrel_pos", "REL/d/t/d_t_barrel_pos.cpp"), Rel(NonMatching, "d_t_bb_quake", "REL/d/t/d_t_bb_quake.cpp"), Rel(NonMatching, "d_t_bcal_tag", "REL/d/t/d_t_bcal_tag.cpp"), Rel(NonMatching, "d_t_bcz", "REL/d/t/d_t_bcz.cpp"), diff --git a/include/d/t/d_t_barrel_pos.h b/include/d/t/d_t_barrel_pos.h index 7685cde8..5ac9d066 100644 --- a/include/d/t/d_t_barrel_pos.h +++ b/include/d/t/d_t_barrel_pos.h @@ -2,12 +2,20 @@ #define D_T_BARREL_POS_H #include "d/t/d_tg.h" +#include "m/m_vec.h" + +class dAcOstageSink_c; class dTgBarrelPos_c : public dTg_c { public: dTgBarrelPos_c() {} virtual ~dTgBarrelPos_c() {} + virtual int create() override; + virtual int doDelete() override; + virtual int draw() override; + virtual int actorExecute() override; + u8 getLinkIndex() const { return mLinkIndex; } @@ -16,7 +24,8 @@ public: } private: - /* 0x0FC */ u8 _0xFC[0x114 - 0xFC]; + /* 0x0FC */ dAcRef_c mStageRef; + /* 0x108 */ mVec3_c mSpawnPosition; /* 0x114 */ u8 mLinkIndex; /* 0x115 */ u8 mLinkId; }; diff --git a/src/REL/d/t/d_t_barrel_pos.cpp b/src/REL/d/t/d_t_barrel_pos.cpp index 05b28f67..d57a19f4 100644 --- a/src/REL/d/t/d_t_barrel_pos.cpp +++ b/src/REL/d/t/d_t_barrel_pos.cpp @@ -1,3 +1,47 @@ #include "d/t/d_t_barrel_pos.h" +#include "d/a/obj/d_a_obj_stage_sink.h" +#include "d/t/d_t_barrel.h" +#include "f/f_base.h" + SPECIAL_ACTOR_PROFILE(TAG_BARREL_POS, dTgBarrelPos_c, fProfile::TAG_BARREL_POS, 0x222, 0, 0); + +int dTgBarrelPos_c::create() { + mLinkIndex = getFromParams(0, 0xFF); + if (mLinkIndex == 0xFF) { + mLinkIndex = 0; + } + + mLinkId = getFromParams(8, 0xF); + + mStageRef.link(dAcOstageSink_c::GetInstance()); + + mSpawnPosition = mPosition; + + return SUCCEEDED; +} + +int dTgBarrelPos_c::doDelete() { + return SUCCEEDED; +} + +int dTgBarrelPos_c::actorExecute() { + dAcOstageSink_c *pStage = mStageRef.get(); + + mVec3_c pos = pStage->mPosition; + mAng3_c rot = pStage->mRotation; + + mVec3_c stageDist = mSpawnPosition - pos; + mMtx_c m; + m.transS(pos); + m.ZXYrotM(rot); + m.multVecSR(stageDist, mPosition); + + mPosition += pos; + + return SUCCEEDED; +} + +int dTgBarrelPos_c::draw() { + return SUCCEEDED; +}