diff --git a/asm/MetroidPrime/Player/CPlayerGun.s b/asm/MetroidPrime/Player/CPlayerGun.s index f752a866..6a4c99dc 100644 --- a/asm/MetroidPrime/Player/CPlayerGun.s +++ b/asm/MetroidPrime/Player/CPlayerGun.s @@ -9673,7 +9673,7 @@ lbl_80042AB8: lbl_80042ACC: /* 80042ACC 0003FA2C 38 7E 07 84 */ addi r3, r30, 0x784 /* 80042AD0 0003FA30 38 80 FF FF */ li r4, -1 -/* 80042AD4 0003FA34 48 00 06 41 */ bl sub_80043114 +/* 80042AD4 0003FA34 48 00 06 41 */ bl "__dt__Q24rstl80reserved_vector,2>,2>Fv" /* 80042AD8 0003FA38 34 1E 07 7C */ addic. r0, r30, 0x77c /* 80042ADC 0003FA3C 41 82 00 30 */ beq lbl_80042B0C /* 80042AE0 0003FA40 88 1E 07 7C */ lbz r0, 0x77c(r30) @@ -10138,8 +10138,8 @@ lbl_800430F8: /* 8004310C 0004006C 38 21 00 20 */ addi r1, r1, 0x20 /* 80043110 00040070 4E 80 00 20 */ blr -.global sub_80043114 -sub_80043114: +.global "__dt__Q24rstl80reserved_vector,2>,2>Fv" +"__dt__Q24rstl80reserved_vector,2>,2>Fv": /* 80043114 00040074 94 21 FF D0 */ stwu r1, -0x30(r1) /* 80043118 00040078 7C 08 02 A6 */ mflr r0 /* 8004311C 0004007C 90 01 00 34 */ stw r0, 0x34(r1) diff --git a/include/Kyoto/Particles/CElementGen.hpp b/include/Kyoto/Particles/CElementGen.hpp index 1d959519..3b444e55 100644 --- a/include/Kyoto/Particles/CElementGen.hpp +++ b/include/Kyoto/Particles/CElementGen.hpp @@ -3,19 +3,49 @@ #include "types.h" -class CElementGen { +#include "Kyoto/Particles/CParticleGen.hpp" + +class CElementGen : public CParticleGen { public: enum EModelOrientationType { kMOT_Normal, kMOT_One }; enum EOptionalSystemFlags { kOSF_None, kOSF_One, kOSF_Two }; enum LightType { kLT_None = 0, kLT_Custom = 1, kLT_Directional = 2, kLT_Spot = 3 }; CElementGen(TToken, EModelOrientationType = kMOT_Normal, EOptionalSystemFlags = kOSF_One); + ~CElementGen(); + + virtual void Update(double); + virtual void Render() const; + virtual void SetOrientation(const CTransform4f& orientation); + virtual void SetTranslation(const CVector3f& translation); + virtual void SetGlobalOrientation(const CTransform4f& orientation); + virtual void SetGlobalTranslation(const CVector3f& translation); + virtual void SetGlobalScale(const CVector3f& scale); + virtual void SetLocalScale(const CVector3f& scale); + virtual void SetParticleEmission(bool emission); + virtual void SetModulationColor(const CColor& col); + virtual void SetGeneratorRate(float rate) {} + virtual CTransform4f GetOrientation() const; + virtual CVector3f GetTranslation() const; + virtual CTransform4f GetGlobalOrientation() const; + virtual CVector3f GetGlobalTranslation() const; + virtual CVector3f GetGlobalScale() const; + virtual bool GetParticleEmission() const; + virtual CColor GetModulationColor() const; + virtual bool IsSystemDeletable() const; + virtual CAABox GetBounds() const; + virtual int GetParticleCOunt() const; + virtual bool SystemHasLight() const; + virtual CLight GetLight(); + virtual void DestroyParticles(); + virtual void AddModifier(CWarp*); + virtual uint Get4CharId() const; static void Initialize(); static void ShutDown(); private: - u8 x0_pad[0x340]; + u8 x4_pad[0x33C]; }; CHECK_SIZEOF(CElementGen, 0x340) diff --git a/include/Kyoto/TOneStatic.hpp b/include/Kyoto/TOneStatic.hpp index 71939064..2d85254e 100644 --- a/include/Kyoto/TOneStatic.hpp +++ b/include/Kyoto/TOneStatic.hpp @@ -11,7 +11,7 @@ public: return GetAllocSpace(); }*/ void* operator new(unsigned long sz) { return operator new(sz, "??(??)", nullptr); } - void operator delete(void* ptr) { ReferenceCount()--; } + void operator delete(void* ptr); private: static void* GetAllocSpace() { @@ -24,4 +24,9 @@ private: } }; +template < typename T > +void TOneStatic< T >::operator delete(void* ptr) { + ReferenceCount()--; +} + #endif diff --git a/include/MetroidPrime/CWorldShadow.hpp b/include/MetroidPrime/CWorldShadow.hpp index 1b32295e..a50c9e14 100644 --- a/include/MetroidPrime/CWorldShadow.hpp +++ b/include/MetroidPrime/CWorldShadow.hpp @@ -23,6 +23,7 @@ class CWorldShadow { public: CWorldShadow(uint w, uint h, bool rgba8); + ~CWorldShadow(); }; CHECK_SIZEOF(CWorldShadow, 0x8c) diff --git a/include/MetroidPrime/Player/CPlayerGun.hpp b/include/MetroidPrime/Player/CPlayerGun.hpp index 325a5349..0338950c 100644 --- a/include/MetroidPrime/Player/CPlayerGun.hpp +++ b/include/MetroidPrime/Player/CPlayerGun.hpp @@ -9,6 +9,7 @@ #include "MetroidPrime/Player/CPlayerCameraBob.hpp" #include "MetroidPrime/Player/CPlayerState.hpp" +#include "Kyoto/TOneStatic.hpp" #include "Kyoto/Audio/CSfxHandle.hpp" #include "Kyoto/Math/CAABox.hpp" #include "Kyoto/Math/CTransform4f.hpp" @@ -38,8 +39,9 @@ class CPhazonBeam; class CElementGen; class CWorldShadow; class CGenDescription; +class CPlayerGun; -class CPlayerGun { +class CPlayerGun : public TOneStatic< CPlayerGun > { static float skTractorBeamFactor; public: @@ -91,6 +93,7 @@ public: }; CPlayerGun(TUniqueId); + ~CPlayerGun(); void InitBeamData(); void InitBombData(); diff --git a/src/MetroidPrime/Player/CPlayerGun.cpp b/src/MetroidPrime/Player/CPlayerGun.cpp index 02b40833..0dc57b45 100644 --- a/src/MetroidPrime/Player/CPlayerGun.cpp +++ b/src/MetroidPrime/Player/CPlayerGun.cpp @@ -273,3 +273,5 @@ CPlayerGun::CPlayerGun(TUniqueId playerId) x550_camBob.SetBobMagnitude(0.f); x550_camBob.SetBobTimeScale(0.f); } + +CPlayerGun::~CPlayerGun() {}