Almost match ~CPlayerGun

This commit is contained in:
Henrique Gemignani Passos Lima 2022-10-06 14:04:05 +03:00
parent 72d07311fd
commit c332d1ef47
No known key found for this signature in database
GPG Key ID: E224F951761145F8
6 changed files with 48 additions and 7 deletions

View File

@ -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<Q24rstl52reserved_vector<31TLockedToken<15CGenDescription>,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<Q24rstl52reserved_vector<31TLockedToken<15CGenDescription>,2>,2>Fv"
"__dt__Q24rstl80reserved_vector<Q24rstl52reserved_vector<31TLockedToken<15CGenDescription>,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)

View File

@ -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<CGenDescription>, 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)

View File

@ -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

View File

@ -23,6 +23,7 @@ class CWorldShadow {
public:
CWorldShadow(uint w, uint h, bool rgba8);
~CWorldShadow();
};
CHECK_SIZEOF(CWorldShadow, 0x8c)

View File

@ -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();

View File

@ -273,3 +273,5 @@ CPlayerGun::CPlayerGun(TUniqueId playerId)
x550_camBob.SetBobMagnitude(0.f);
x550_camBob.SetBobTimeScale(0.f);
}
CPlayerGun::~CPlayerGun() {}