diff options
Diffstat (limited to 'src/modelinfo')
-rw-r--r-- | src/modelinfo/BaseModelInfo.cpp | 8 | ||||
-rw-r--r-- | src/modelinfo/BaseModelInfo.h | 2 | ||||
-rw-r--r-- | src/modelinfo/ClumpModelInfo.cpp | 20 | ||||
-rw-r--r-- | src/modelinfo/ClumpModelInfo.h | 7 | ||||
-rw-r--r-- | src/modelinfo/MloInstance.cpp | 7 | ||||
-rw-r--r-- | src/modelinfo/MloInstance.h | 9 | ||||
-rw-r--r-- | src/modelinfo/PedModelInfo.cpp | 12 | ||||
-rw-r--r-- | src/modelinfo/PedModelInfo.h | 4 | ||||
-rw-r--r-- | src/modelinfo/SimpleModelInfo.cpp | 16 | ||||
-rw-r--r-- | src/modelinfo/SimpleModelInfo.h | 5 | ||||
-rw-r--r-- | src/modelinfo/VehicleModelInfo.cpp | 14 | ||||
-rw-r--r-- | src/modelinfo/VehicleModelInfo.h | 5 |
12 files changed, 56 insertions, 53 deletions
diff --git a/src/modelinfo/BaseModelInfo.cpp b/src/modelinfo/BaseModelInfo.cpp index 37f94c93..830ead51 100644 --- a/src/modelinfo/BaseModelInfo.cpp +++ b/src/modelinfo/BaseModelInfo.cpp @@ -101,9 +101,15 @@ CBaseModelInfo::Get2dEffect(int n) } +class CBaseModelInfo_ : public CBaseModelInfo +{ +public: + void Shutdown_(void) { CBaseModelInfo::Shutdown(); } +}; STARTPATCHES // can't easily replace ctor at 4F6A50 - InjectHook(0x4F6A90, &CBaseModelInfo::Shutdown_, PATCH_JUMP); + InjectHook(0x4F6A90, &CBaseModelInfo_::Shutdown_, PATCH_JUMP); + InjectHook(0x4F6AC0, &CBaseModelInfo::DeleteCollisionModel, PATCH_JUMP); InjectHook(0x4F6B70, &CBaseModelInfo::ClearTexDictionary, PATCH_JUMP); InjectHook(0x4F6BA0, &CBaseModelInfo::AddRef, PATCH_JUMP); diff --git a/src/modelinfo/BaseModelInfo.h b/src/modelinfo/BaseModelInfo.h index da72990f..a9bafb64 100644 --- a/src/modelinfo/BaseModelInfo.h +++ b/src/modelinfo/BaseModelInfo.h @@ -62,8 +62,6 @@ public: void Init2dEffects(void); void Add2dEffect(C2dEffect *fx); C2dEffect *Get2dEffect(int n); - - void Shutdown_(void) { this->CBaseModelInfo::Shutdown(); } }; static_assert(sizeof(CBaseModelInfo) == 0x30, "CBaseModelInfo: error"); diff --git a/src/modelinfo/ClumpModelInfo.cpp b/src/modelinfo/ClumpModelInfo.cpp index 24deed38..d666313b 100644 --- a/src/modelinfo/ClumpModelInfo.cpp +++ b/src/modelinfo/ClumpModelInfo.cpp @@ -139,12 +139,22 @@ CClumpModelInfo::GetFrameFromId(RpClump *clump, int32 id) } +class CClumpModelInfo_ : public CClumpModelInfo +{ +public: + void DeleteRwObject_(void) { this->CClumpModelInfo::DeleteRwObject(); } + RwObject *CreateInstance_1(void) { return CClumpModelInfo::CreateInstance(); } + RwObject *CreateInstance_2(RwMatrix *m) { return CClumpModelInfo::CreateInstance(m); } + RwObject *GetRwObject_(void) { return CClumpModelInfo::GetRwObject(); } + void SetClump_(RpClump *clump) { CClumpModelInfo::SetClump(clump); } +}; + STARTPATCHES - InjectHook(0x4F8800, &CClumpModelInfo::DeleteRwObject_, PATCH_JUMP); - InjectHook(0x4F8920, &CClumpModelInfo::CreateInstance_1, PATCH_JUMP); - InjectHook(0x4F88A0, &CClumpModelInfo::CreateInstance_2, PATCH_JUMP); - InjectHook(0x50C1C0, &CClumpModelInfo::GetRwObject_, PATCH_JUMP); - InjectHook(0x4F8830, &CClumpModelInfo::SetClump_, PATCH_JUMP); + InjectHook(0x4F8800, &CClumpModelInfo_::DeleteRwObject_, PATCH_JUMP); + InjectHook(0x4F8920, &CClumpModelInfo_::CreateInstance_1, PATCH_JUMP); + InjectHook(0x4F88A0, &CClumpModelInfo_::CreateInstance_2, PATCH_JUMP); + InjectHook(0x50C1C0, &CClumpModelInfo_::GetRwObject_, PATCH_JUMP); + InjectHook(0x4F8830, &CClumpModelInfo_::SetClump_, PATCH_JUMP); InjectHook(0x4F8940, &CClumpModelInfo::SetAtomicRendererCB, PATCH_JUMP); InjectHook(0x4F8960, &CClumpModelInfo::FindFrameFromNameCB, PATCH_JUMP); InjectHook(0x4F8A10, &CClumpModelInfo::FindFrameFromNameWithoutIdCB, PATCH_JUMP); diff --git a/src/modelinfo/ClumpModelInfo.h b/src/modelinfo/ClumpModelInfo.h index 909d241b..d491bdb9 100644 --- a/src/modelinfo/ClumpModelInfo.h +++ b/src/modelinfo/ClumpModelInfo.h @@ -49,12 +49,5 @@ public: static void FillFrameArray(RpClump *clump, RwFrame **frames); static RwFrame *FillFrameArrayCB(RwFrame *frame, void *data); static RwFrame *GetFrameFromId(RpClump *clump, int32 id); - - - void DeleteRwObject_(void) { this->CClumpModelInfo::DeleteRwObject(); } - RwObject *CreateInstance_1(void) { return this->CClumpModelInfo::CreateInstance(); } - RwObject *CreateInstance_2(RwMatrix *m) { return this->CClumpModelInfo::CreateInstance(m); } - RwObject *GetRwObject_(void) { return this->CClumpModelInfo::GetRwObject(); } - void SetClump_(RpClump *clump) { this->CClumpModelInfo::SetClump(clump); } }; static_assert(sizeof(CClumpModelInfo) == 0x34, "CClumpModelInfo: error"); diff --git a/src/modelinfo/MloInstance.cpp b/src/modelinfo/MloInstance.cpp deleted file mode 100644 index dbd83727..00000000 --- a/src/modelinfo/MloInstance.cpp +++ /dev/null @@ -1,7 +0,0 @@ -#include "common.h" -#include "patcher.h" -#include "MloInstance.h" - -STARTPATCHES -InjectHook(0x50BE90, &CMloInstance::dtor, PATCH_JUMP); -ENDPATCHES
\ No newline at end of file diff --git a/src/modelinfo/MloInstance.h b/src/modelinfo/MloInstance.h deleted file mode 100644 index 00afc379..00000000 --- a/src/modelinfo/MloInstance.h +++ /dev/null @@ -1,9 +0,0 @@ -#pragma once - -#include "Placeable.h" - -class CMloInstance : CPlaceable -{ -public: - void dtor() { this->CMloInstance::~CMloInstance(); } -};
\ No newline at end of file diff --git a/src/modelinfo/PedModelInfo.cpp b/src/modelinfo/PedModelInfo.cpp index 775148c9..747cbc99 100644 --- a/src/modelinfo/PedModelInfo.cpp +++ b/src/modelinfo/PedModelInfo.cpp @@ -189,9 +189,17 @@ CPedModelInfo::CreateHitColModel(void) m_hitColModel = colmodel; } + +class CPedModelInfo_ : public CPedModelInfo +{ +public: + void DeleteRwObject_(void) { CPedModelInfo::DeleteRwObject(); } + void SetClump_(RpClump *clump) { CPedModelInfo::SetClump(clump); } +}; + STARTPATCHES - InjectHook(0x510210, &CPedModelInfo::SetClump_, PATCH_JUMP); - InjectHook(0x510280, &CPedModelInfo::DeleteRwObject_, PATCH_JUMP); + InjectHook(0x510210, &CPedModelInfo_::SetClump_, PATCH_JUMP); + InjectHook(0x510280, &CPedModelInfo_::DeleteRwObject_, PATCH_JUMP); InjectHook(0x510390, &CPedModelInfo::SetLowDetailClump, PATCH_JUMP); InjectHook(0x5104D0, &CPedModelInfo::CreateHitColModel, PATCH_JUMP); ENDPATCHES diff --git a/src/modelinfo/PedModelInfo.h b/src/modelinfo/PedModelInfo.h index 7be2c195..bec46b4e 100644 --- a/src/modelinfo/PedModelInfo.h +++ b/src/modelinfo/PedModelInfo.h @@ -39,9 +39,5 @@ public: void SetLowDetailClump(RpClump*); void CreateHitColModel(void); CColModel *GetHitColModel(void) { return m_hitColModel; } - - - void DeleteRwObject_(void) { this->CPedModelInfo::DeleteRwObject(); } - void SetClump_(RpClump *clump) { this->CPedModelInfo::SetClump(clump); } }; static_assert(sizeof(CPedModelInfo) == 0x54, "CPedModelInfo: error"); diff --git a/src/modelinfo/SimpleModelInfo.cpp b/src/modelinfo/SimpleModelInfo.cpp index ea7a3f9e..dd5010fa 100644 --- a/src/modelinfo/SimpleModelInfo.cpp +++ b/src/modelinfo/SimpleModelInfo.cpp @@ -154,12 +154,20 @@ CSimpleModelInfo::SetupBigBuilding(void) } } +class CSimpleModelInfo_ : public CSimpleModelInfo +{ +public: + void DeleteRwObject_(void) { CSimpleModelInfo::DeleteRwObject(); } + RwObject *CreateInstance_1(void) { return CSimpleModelInfo::CreateInstance(); } + RwObject *CreateInstance_2(RwMatrix *m) { return CSimpleModelInfo::CreateInstance(m); } + RwObject *GetRwObject_(void) { return CSimpleModelInfo::GetRwObject(); } +}; STARTPATCHES - InjectHook(0x5179B0, &CSimpleModelInfo::DeleteRwObject_, PATCH_JUMP); - InjectHook(0x517B60, &CSimpleModelInfo::CreateInstance_1, PATCH_JUMP); - InjectHook(0x517AC0, &CSimpleModelInfo::CreateInstance_2, PATCH_JUMP); - InjectHook(0x4A9BA0, &CSimpleModelInfo::GetRwObject_, PATCH_JUMP); + InjectHook(0x5179B0, &CSimpleModelInfo_::DeleteRwObject_, PATCH_JUMP); + InjectHook(0x517B60, &CSimpleModelInfo_::CreateInstance_1, PATCH_JUMP); + InjectHook(0x517AC0, &CSimpleModelInfo_::CreateInstance_2, PATCH_JUMP); + InjectHook(0x4A9BA0, &CSimpleModelInfo_::GetRwObject_, PATCH_JUMP); InjectHook(0x517990, &CSimpleModelInfo::Init, PATCH_JUMP); InjectHook(0x517C60, &CSimpleModelInfo::IncreaseAlpha, PATCH_JUMP); InjectHook(0x517950, &CSimpleModelInfo::SetAtomic, PATCH_JUMP); diff --git a/src/modelinfo/SimpleModelInfo.h b/src/modelinfo/SimpleModelInfo.h index d5b572a6..35d48669 100644 --- a/src/modelinfo/SimpleModelInfo.h +++ b/src/modelinfo/SimpleModelInfo.h @@ -48,10 +48,5 @@ public: return (CSimpleModelInfo*)m_atomics[2]; } void SetRelatedModel(CSimpleModelInfo *m){ m_atomics[2] = (RpAtomic*)m; } - - void DeleteRwObject_(void) { this->CSimpleModelInfo::DeleteRwObject(); } - RwObject *CreateInstance_1(void) { return this->CSimpleModelInfo::CreateInstance(); } - RwObject *CreateInstance_2(RwMatrix *m) { return this->CSimpleModelInfo::CreateInstance(m); } - RwObject *GetRwObject_(void) { return this->CSimpleModelInfo::GetRwObject(); } }; static_assert(sizeof(CSimpleModelInfo) == 0x4C, "CSimpleModelInfo: error"); diff --git a/src/modelinfo/VehicleModelInfo.cpp b/src/modelinfo/VehicleModelInfo.cpp index f112d546..810ed042 100644 --- a/src/modelinfo/VehicleModelInfo.cpp +++ b/src/modelinfo/VehicleModelInfo.cpp @@ -1098,10 +1098,18 @@ CVehicleModelInfo::GetMaximumNumberOfPassengersFromNumberOfDoors(int id) return n - 1; } +class CVehicleModelInfo_ : public CVehicleModelInfo +{ +public: + void DeleteRwObject_(void) { CVehicleModelInfo::DeleteRwObject(); } + RwObject *CreateInstance_(void) { return CVehicleModelInfo::CreateInstance(); } + void SetClump_(RpClump *clump) { CVehicleModelInfo::SetClump(clump); } +}; + STARTPATCHES - InjectHook(0x51FDC0, &CVehicleModelInfo::DeleteRwObject_, PATCH_JUMP); - InjectHook(0x51FCB0, &CVehicleModelInfo::CreateInstance_, PATCH_JUMP); - InjectHook(0x51FC60, &CVehicleModelInfo::SetClump_, PATCH_JUMP); + InjectHook(0x51FDC0, &CVehicleModelInfo_::DeleteRwObject_, PATCH_JUMP); + InjectHook(0x51FCB0, &CVehicleModelInfo_::CreateInstance_, PATCH_JUMP); + InjectHook(0x51FC60, &CVehicleModelInfo_::SetClump_, PATCH_JUMP); InjectHook(0x51FE10, &CVehicleModelInfo::CollapseFramesCB, PATCH_JUMP); InjectHook(0x51FE50, &CVehicleModelInfo::MoveObjectsCB, PATCH_JUMP); diff --git a/src/modelinfo/VehicleModelInfo.h b/src/modelinfo/VehicleModelInfo.h index 2e2f1be2..f66bc21f 100644 --- a/src/modelinfo/VehicleModelInfo.h +++ b/src/modelinfo/VehicleModelInfo.h @@ -10,6 +10,7 @@ enum { }; enum { + ATOMIC_FLAG_NONE = 0x0, ATOMIC_FLAG_OK = 0x1, ATOMIC_FLAG_DAM = 0x2, ATOMIC_FLAG_LEFT = 0x4, @@ -131,9 +132,5 @@ public: static void ShutdownEnvironmentMaps(void); static int GetMaximumNumberOfPassengersFromNumberOfDoors(int id); - - void DeleteRwObject_(void) { this->CVehicleModelInfo::DeleteRwObject(); } - RwObject *CreateInstance_(void) { return this->CVehicleModelInfo::CreateInstance(); } - void SetClump_(RpClump *clump) { this->CVehicleModelInfo::SetClump(clump); } }; static_assert(sizeof(CVehicleModelInfo) == 0x1F8, "CVehicleModelInfo: error"); |