summaryrefslogtreecommitdiffstats
path: root/src/modelinfo
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/modelinfo/BaseModelInfo.cpp24
-rw-r--r--src/modelinfo/ClumpModelInfo.cpp29
-rw-r--r--src/modelinfo/MloModelInfo.cpp2
-rw-r--r--src/modelinfo/ModelIndices.cpp9
-rw-r--r--src/modelinfo/ModelIndices.h2
-rw-r--r--src/modelinfo/ModelInfo.cpp14
-rw-r--r--src/modelinfo/PedModelInfo.cpp16
-rw-r--r--src/modelinfo/SimpleModelInfo.cpp27
-rw-r--r--src/modelinfo/TimeModelInfo.cpp6
-rw-r--r--src/modelinfo/VehicleModelInfo.cpp64
10 files changed, 11 insertions, 182 deletions
diff --git a/src/modelinfo/BaseModelInfo.cpp b/src/modelinfo/BaseModelInfo.cpp
index 830ead51..e8d2601f 100644
--- a/src/modelinfo/BaseModelInfo.cpp
+++ b/src/modelinfo/BaseModelInfo.cpp
@@ -1,5 +1,5 @@
#include "common.h"
-#include "patcher.h"
+
#include "templates.h"
#include "TxdStore.h"
#include "2dEffect.h"
@@ -99,25 +99,3 @@ CBaseModelInfo::Get2dEffect(int n)
else
return nil;
}
-
-
-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(0x4F6AC0, &CBaseModelInfo::DeleteCollisionModel, PATCH_JUMP);
- InjectHook(0x4F6B70, &CBaseModelInfo::ClearTexDictionary, PATCH_JUMP);
- InjectHook(0x4F6BA0, &CBaseModelInfo::AddRef, PATCH_JUMP);
- InjectHook(0x4F6BB0, &CBaseModelInfo::RemoveRef, PATCH_JUMP);
- InjectHook(0x4F6B40, &CBaseModelInfo::SetTexDictionary, PATCH_JUMP);
- InjectHook(0x4F6B80, &CBaseModelInfo::AddTexDictionaryRef, PATCH_JUMP);
- InjectHook(0x4F6B90, &CBaseModelInfo::RemoveTexDictionaryRef, PATCH_JUMP);
- InjectHook(0x4F6B20, &CBaseModelInfo::Add2dEffect, PATCH_JUMP);
- InjectHook(0x4F6AF0, &CBaseModelInfo::Init2dEffects, PATCH_JUMP);
- InjectHook(0x4F6B00, &CBaseModelInfo::Get2dEffect, PATCH_JUMP);
-ENDPATCHES
diff --git a/src/modelinfo/ClumpModelInfo.cpp b/src/modelinfo/ClumpModelInfo.cpp
index c6a6d5d0..464bda61 100644
--- a/src/modelinfo/ClumpModelInfo.cpp
+++ b/src/modelinfo/ClumpModelInfo.cpp
@@ -1,5 +1,5 @@
#include "common.h"
-#include "patcher.h"
+
#include "General.h"
#include "NodeName.h"
#include "VisibilityPlugins.h"
@@ -138,30 +138,3 @@ CClumpModelInfo::GetFrameFromId(RpClump *clump, int32 id)
RwFrameForAllChildren(RpClumpGetFrame(clump), FindFrameFromIdCB, &assoc);
return assoc.frame;
}
-
-
-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(0x4F8940, &CClumpModelInfo::SetAtomicRendererCB, PATCH_JUMP);
- InjectHook(0x4F8960, &CClumpModelInfo::FindFrameFromNameCB, PATCH_JUMP);
- InjectHook(0x4F8A10, &CClumpModelInfo::FindFrameFromNameWithoutIdCB, PATCH_JUMP);
- InjectHook(0x4F8AD0, &CClumpModelInfo::FindFrameFromIdCB, PATCH_JUMP);
- InjectHook(0x4F8BB0, &CClumpModelInfo::SetFrameIds, PATCH_JUMP);
- InjectHook(0x4F8B20, &CClumpModelInfo::FillFrameArrayCB, PATCH_JUMP);
- InjectHook(0x4F8B90, &CClumpModelInfo::FillFrameArray, PATCH_JUMP);
- InjectHook(0x4F8B50, &CClumpModelInfo::GetFrameFromId, PATCH_JUMP);
-ENDPATCHES
diff --git a/src/modelinfo/MloModelInfo.cpp b/src/modelinfo/MloModelInfo.cpp
index 746d9db4..7535e6c5 100644
--- a/src/modelinfo/MloModelInfo.cpp
+++ b/src/modelinfo/MloModelInfo.cpp
@@ -1,5 +1,5 @@
#include "common.h"
-#include "patcher.h"
+
#include "VisibilityPlugins.h"
#include "ModelInfo.h"
diff --git a/src/modelinfo/ModelIndices.cpp b/src/modelinfo/ModelIndices.cpp
index ec039a0b..9a6a74d0 100644
--- a/src/modelinfo/ModelIndices.cpp
+++ b/src/modelinfo/ModelIndices.cpp
@@ -1,9 +1,9 @@
#include "common.h"
-#include "patcher.h"
+
#include "General.h"
#include "ModelIndices.h"
-#define X(name, var, addr) int16 &var = *(int16*)addr;
+#define X(name, var, addr) int16 var;
MODELINDICES
#undef X
@@ -32,8 +32,3 @@ TestModelIndices(void)
{
;
}
-
-STARTPATCHES
- InjectHook(0x48EB60, InitModelIndices, PATCH_JUMP);
- InjectHook(0x48F030, MatchModelString, PATCH_JUMP);
-ENDPATCHES
diff --git a/src/modelinfo/ModelIndices.h b/src/modelinfo/ModelIndices.h
index cc8399e7..8e117882 100644
--- a/src/modelinfo/ModelIndices.h
+++ b/src/modelinfo/ModelIndices.h
@@ -158,7 +158,7 @@
X("subplatform_sub", MI_SUBPLATFORM_SUB2, 0x5F5BC0) \
X("files", MI_FILES, 0x5F5BC4)
-#define X(name, var, addr) extern int16 &var;
+#define X(name, var, addr) extern int16 var;
MODELINDICES
#undef X
diff --git a/src/modelinfo/ModelInfo.cpp b/src/modelinfo/ModelInfo.cpp
index 58124e53..c1ae692f 100644
--- a/src/modelinfo/ModelInfo.cpp
+++ b/src/modelinfo/ModelInfo.cpp
@@ -1,5 +1,5 @@
#include "common.h"
-#include "patcher.h"
+
#include "General.h"
#include "TempColModels.h"
#include "ModelIndices.h"
@@ -248,15 +248,3 @@ CModelInfo::ReInit2dEffects()
ms_modelInfoPtrs[i]->Init2dEffects();
}
}
-
-STARTPATCHES
- InjectHook(0x50B310, CModelInfo::Initialise, PATCH_JUMP);
- InjectHook(0x50B5B0, CModelInfo::ShutDown, PATCH_JUMP);
- InjectHook(0x50B920, CModelInfo::AddSimpleModel, PATCH_JUMP);
- InjectHook(0x50B9C0, CModelInfo::AddTimeModel, PATCH_JUMP);
- InjectHook(0x50BA10, CModelInfo::AddClumpModel, PATCH_JUMP);
- InjectHook(0x50BAD0, CModelInfo::AddPedModel, PATCH_JUMP);
- InjectHook(0x50BA60, CModelInfo::AddVehicleModel, PATCH_JUMP);
- InjectHook(0x50B860, (CBaseModelInfo *(*)(const char*, int*))CModelInfo::GetModelInfo, PATCH_JUMP);
- InjectHook(0x50BBC0, CModelInfo::RemoveColModelsFromOtherLevels, PATCH_JUMP);
-ENDPATCHES
diff --git a/src/modelinfo/PedModelInfo.cpp b/src/modelinfo/PedModelInfo.cpp
index 015c6949..5c801a2b 100644
--- a/src/modelinfo/PedModelInfo.cpp
+++ b/src/modelinfo/PedModelInfo.cpp
@@ -1,5 +1,5 @@
#include "common.h"
-#include "patcher.h"
+
#include "General.h"
#include "Ped.h"
#include "NodeName.h"
@@ -229,17 +229,3 @@ CPedModelInfo::AnimatePedColModel(CColModel* colmodel, RwFrame* frame)
return 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(0x510390, &CPedModelInfo::SetLowDetailClump, PATCH_JUMP);
- InjectHook(0x5104D0, &CPedModelInfo::CreateHitColModel, PATCH_JUMP);
-ENDPATCHES
diff --git a/src/modelinfo/SimpleModelInfo.cpp b/src/modelinfo/SimpleModelInfo.cpp
index f8742f1e..2fb2adeb 100644
--- a/src/modelinfo/SimpleModelInfo.cpp
+++ b/src/modelinfo/SimpleModelInfo.cpp
@@ -1,5 +1,5 @@
#include "common.h"
-#include "patcher.h"
+
#include "General.h"
#include "Camera.h"
#include "ModelInfo.h"
@@ -154,28 +154,3 @@ CSimpleModelInfo::SetupBigBuilding(void)
m_lodDistances[2] = 100.0f;
}
}
-
-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(0x517990, &CSimpleModelInfo::Init, PATCH_JUMP);
- InjectHook(0x517C60, &CSimpleModelInfo::IncreaseAlpha, PATCH_JUMP);
- InjectHook(0x517950, &CSimpleModelInfo::SetAtomic, PATCH_JUMP);
- InjectHook(0x517AA0, &CSimpleModelInfo::SetLodDistances, PATCH_JUMP);
- InjectHook(0x517A90, &CSimpleModelInfo::GetNearDistance, PATCH_JUMP);
- InjectHook(0x517A60, &CSimpleModelInfo::GetLargestLodDistance, PATCH_JUMP);
- InjectHook(0x517A00, &CSimpleModelInfo::GetAtomicFromDistance, PATCH_JUMP);
- InjectHook(0x517C00, &CSimpleModelInfo::FindRelatedModel, PATCH_JUMP);
- InjectHook(0x517B90, &CSimpleModelInfo::SetupBigBuilding, PATCH_JUMP);
-ENDPATCHES
diff --git a/src/modelinfo/TimeModelInfo.cpp b/src/modelinfo/TimeModelInfo.cpp
index 3ab3e13a..fec3f6e5 100644
--- a/src/modelinfo/TimeModelInfo.cpp
+++ b/src/modelinfo/TimeModelInfo.cpp
@@ -1,5 +1,5 @@
#include "common.h"
-#include "patcher.h"
+
#include "Camera.h"
#include "ModelInfo.h"
@@ -30,7 +30,3 @@ CTimeModelInfo::FindOtherTimeModel(void)
}
return nil;
}
-
-STARTPATCHES
- InjectHook(0x517C80, &CTimeModelInfo::FindOtherTimeModel, PATCH_JUMP);
-ENDPATCHES
diff --git a/src/modelinfo/VehicleModelInfo.cpp b/src/modelinfo/VehicleModelInfo.cpp
index fb9e0358..0c3a7720 100644
--- a/src/modelinfo/VehicleModelInfo.cpp
+++ b/src/modelinfo/VehicleModelInfo.cpp
@@ -1,6 +1,6 @@
#include "common.h"
#include <rpmatfx.h>
-#include "patcher.h"
+
#include "RwHelper.h"
#include "General.h"
#include "NodeName.h"
@@ -1104,65 +1104,3 @@ 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(0x427820, &CVehicleModelInfo::SetComponentsToUse, 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);
- InjectHook(0x51FE70, &CVehicleModelInfo::HideDamagedAtomicCB, PATCH_JUMP);
- InjectHook(0x51FED0, &CVehicleModelInfo::HideAllComponentsAtomicCB, PATCH_JUMP);
- InjectHook(0x51FEF0, &CVehicleModelInfo::HasAlphaMaterialCB, PATCH_JUMP);
-
- InjectHook(0x51FF10, &CVehicleModelInfo::SetAtomicRendererCB, PATCH_JUMP);
- InjectHook(0x520030, &CVehicleModelInfo::SetAtomicRendererCB_BigVehicle, PATCH_JUMP);
- InjectHook(0x520230, &CVehicleModelInfo::SetAtomicRendererCB_Train, PATCH_JUMP);
- InjectHook(0x520120, &CVehicleModelInfo::SetAtomicRendererCB_Boat, PATCH_JUMP);
- InjectHook(0x520210, &CVehicleModelInfo::SetAtomicRendererCB_Heli, PATCH_JUMP);
- InjectHook(0x5202C0, &CVehicleModelInfo::SetAtomicRenderCallbacks, PATCH_JUMP);
-
- InjectHook(0x520340, &CVehicleModelInfo::SetAtomicFlagCB, PATCH_JUMP);
- InjectHook(0x520360, &CVehicleModelInfo::ClearAtomicFlagCB, PATCH_JUMP);
-
- InjectHook(0x5204D0, &CVehicleModelInfo::PreprocessHierarchy, PATCH_JUMP);
- InjectHook(0x5203C0, &CVehicleModelInfo::SetVehicleComponentFlags, PATCH_JUMP);
-
- InjectHook(0x520840, &CVehicleModelInfo::GetWheelPosn, PATCH_JUMP);
-
- InjectHook(0x520880, IsValidCompRule, PATCH_JUMP);
- InjectHook(0x520990, CountCompsInRule, PATCH_JUMP);
- InjectHook(0x5209C0, ChooseComponent, PATCH_JUMP);
- InjectHook(0x5208C0, GetListOfComponentsNotUsedByRules, PATCH_JUMP);
- InjectHook(0x520AB0, &CVehicleModelInfo::ChooseComponent, PATCH_JUMP);
- InjectHook(0x520BE0, &CVehicleModelInfo::ChooseSecondComponent, PATCH_JUMP);
-
- InjectHook(0x520DC0, (RpAtomic *(*)(RpAtomic*, void*))CVehicleModelInfo::GetEditableMaterialListCB, PATCH_JUMP);
- InjectHook(0x520D30, (RpMaterial *(*)(RpMaterial*, void*))CVehicleModelInfo::GetEditableMaterialListCB, PATCH_JUMP);
- InjectHook(0x520DE0, &CVehicleModelInfo::FindEditableMaterialList, PATCH_JUMP);
- InjectHook(0x520E70, &CVehicleModelInfo::SetVehicleColour, PATCH_JUMP);
- InjectHook(0x520FD0, &CVehicleModelInfo::ChooseVehicleColour, PATCH_JUMP);
- InjectHook(0x5210A0, &CVehicleModelInfo::AvoidSameVehicleColour, PATCH_JUMP);
- InjectHook(0x521260, &CVehicleModelInfo::LoadVehicleColours, PATCH_JUMP);
- InjectHook(0x521650, &CVehicleModelInfo::DeleteVehicleColourTextures, PATCH_JUMP);
-
- InjectHook(0x5219D0, &CVehicleModelInfo::GetMaximumNumberOfPassengersFromNumberOfDoors, PATCH_JUMP);
-
- InjectHook(0x521820, (RpAtomic *(*)(RpAtomic*, void*))CVehicleModelInfo::SetEnvironmentMapCB, PATCH_JUMP);
- InjectHook(0x5217A0, (RpMaterial *(*)(RpMaterial*, void*))CVehicleModelInfo::SetEnvironmentMapCB, PATCH_JUMP);
- InjectHook(0x521770, CVehicleModelInfo::HasSpecularMaterialCB, PATCH_JUMP);
- InjectHook(0x521890, &CVehicleModelInfo::SetEnvironmentMap, PATCH_JUMP);
- InjectHook(0x521680, CVehicleModelInfo::LoadEnvironmentMaps, PATCH_JUMP);
- InjectHook(0x521720, CVehicleModelInfo::ShutdownEnvironmentMaps, PATCH_JUMP);
-ENDPATCHES