Use raw pointers in CWeaponDescription, link it

This commit is contained in:
Henrique Gemignani Passos Lima 2022-11-17 07:13:56 +02:00
parent 19877f6fa2
commit 0e45d77036
No known key found for this signature in database
GPG Key ID: E224F951761145F8
5 changed files with 43 additions and 18 deletions

View File

@ -425,7 +425,7 @@ LIBS = [
["Weapons/IWeaponRenderer", True],
"Weapons/CDecalDataFactory",
["Weapons/CDecal", False],
"Weapons/CWeaponDescription",
["Weapons/CWeaponDescription", True],
["Weapons/CDecalDescription", True],
],
},

View File

@ -22,16 +22,16 @@ public:
CWeaponDescription();
~CWeaponDescription();
rstl::single_ptr< CVectorElement > x0_IORN;
rstl::single_ptr< CVectorElement > x4_IVEC;
rstl::single_ptr< CVectorElement > x8_PSOV;
rstl::single_ptr< CModVectorElement > xc_PSVM;
CVectorElement* x0_IORN;
CVectorElement* x4_IVEC;
CVectorElement* x8_PSOV;
CModVectorElement* xc_PSVM;
bool x10_VMD2;
rstl::single_ptr< CIntElement > x14_PSLT;
rstl::single_ptr< CVectorElement > x18_PSCL;
rstl::single_ptr< CColorElement > x1c_PCOL;
rstl::single_ptr< CVectorElement > x20_POFS;
rstl::single_ptr< CVectorElement > x24_OFST;
CIntElement* x14_PSLT;
CVectorElement* x18_PSCL;
CColorElement* x1c_PCOL;
CVectorElement* x20_POFS;
CVectorElement* x24_OFST;
bool x28_APSO;
bool x29_HOMG;
bool x2a_AP11;
@ -39,7 +39,7 @@ public:
bool x2c_AS11;
bool x2d_AS12;
bool x2e_AS13;
rstl::single_ptr< CRealElement > x30_TRAT;
CRealElement* x30_TRAT;
TChildGeneratorDesc x34_APSM;
TChildGeneratorDesc x44_APS2;
TSwooshGeneratorDesc x54_ASW1;
@ -51,8 +51,8 @@ public:
bool xa5_LWTR;
bool xa6_SWTR;
int xa8_PJFX;
rstl::single_ptr< CRealElement > xac_RNGE;
rstl::single_ptr< CRealElement > xb0_FOFF;
CRealElement* xac_RNGE;
CRealElement* xb0_FOFF;
};
#endif // _CWEAPONDESCRIPTION

View File

@ -378,7 +378,7 @@ WEAPONS :=\
$(BUILD_DIR)/src/Weapons/IWeaponRenderer.o\
$(BUILD_DIR)/asm/Weapons/CDecalDataFactory.o\
$(BUILD_DIR)/asm/Weapons/CDecal.o\
$(BUILD_DIR)/asm/Weapons/CWeaponDescription.o\
$(BUILD_DIR)/src/Weapons/CWeaponDescription.o\
$(BUILD_DIR)/src/Weapons/CDecalDescription.o\
METARENDER :=\

View File

@ -18,7 +18,7 @@ float CProjectileInfo::GetProjectileSpeed() const {
float result = 45000.0f;
TToken< CWeaponDescription > token(x0_weaponDescription);
if (!token->x4_IVEC.null()) {
if (token->x4_IVEC) {
CVector3f vec = CVector3f::Zero();
token->x4_IVEC->GetValue(0, vec);
result = vec.Magnitude() / CProjectileWeapon::GetTickPeriod();

View File

@ -2,16 +2,41 @@
#include "Kyoto/Alloc/CMemory.hpp"
CWeaponDescription::CWeaponDescription()
: x10_VMD2(false)
: x0_IORN(nullptr)
, x4_IVEC(nullptr)
, x8_PSOV(nullptr)
, xc_PSVM(nullptr)
, x10_VMD2(false)
, x14_PSLT(nullptr)
, x18_PSCL(nullptr)
, x1c_PCOL(nullptr)
, x20_POFS(nullptr)
, x24_OFST(nullptr)
, x28_APSO(false)
, x2a_AP11(false)
, x2b_AP21(false)
, x2c_AS11(false)
, x2d_AS12(false)
, x2e_AS13(false)
, x30_TRAT(nullptr)
, xa4_EWTR(true)
, xa5_LWTR(true)
, xa6_SWTR(true)
, xa8_PJFX(-1) {}
, xa8_PJFX(-1)
, xac_RNGE(nullptr)
, xb0_FOFF(nullptr) {}
CWeaponDescription::~CWeaponDescription() {}
CWeaponDescription::~CWeaponDescription() {
delete x4_IVEC;
delete x0_IORN;
delete xc_PSVM;
delete x8_PSOV;
delete x14_PSLT;
delete x18_PSCL;
delete x1c_PCOL;
delete x20_POFS;
delete x24_OFST;
delete x30_TRAT;
delete xac_RNGE;
delete xb0_FOFF;
}