summaryrefslogtreecommitdiffstats
path: root/src/objects
diff options
context:
space:
mode:
Diffstat (limited to 'src/objects')
-rw-r--r--src/objects/CutsceneHead.cpp19
-rw-r--r--src/objects/CutsceneObject.cpp24
-rw-r--r--src/objects/DummyObject.cpp18
-rw-r--r--src/objects/Object.cpp42
-rw-r--r--src/objects/Object.h6
-rw-r--r--src/objects/ObjectData.cpp7
-rw-r--r--src/objects/ParticleObject.cpp46
-rw-r--r--src/objects/ParticleObject.h8
-rw-r--r--src/objects/Projectile.cpp16
9 files changed, 21 insertions, 165 deletions
diff --git a/src/objects/CutsceneHead.cpp b/src/objects/CutsceneHead.cpp
index a7722b8a..b716e17e 100644
--- a/src/objects/CutsceneHead.cpp
+++ b/src/objects/CutsceneHead.cpp
@@ -1,6 +1,6 @@
#include "common.h"
#include <rpskin.h>
-#include "patcher.h"
+
#include "main.h"
#include "RwHelper.h"
#include "RpAnimBlend.h"
@@ -109,20 +109,3 @@ CCutsceneHead::PlayAnimation(const char *animName)
RwStreamClose(stream, nil);
}
}
-
-class CCutsceneHead_ : public CCutsceneHead
-{
-public:
- void CreateRwObject_(void) { CCutsceneHead::CreateRwObject(); }
- void DeleteRwObject_(void) { CCutsceneHead::DeleteRwObject(); }
- void ProcessControl_(void) { CCutsceneHead::ProcessControl(); }
- void Render_(void) { CCutsceneHead::Render(); }
-};
-
-STARTPATCHES
- InjectHook(0x4BA650, &CCutsceneHead_::CreateRwObject_, PATCH_JUMP);
- InjectHook(0x4BA690, &CCutsceneHead_::DeleteRwObject_, PATCH_JUMP);
- InjectHook(0x4BA760, &CCutsceneHead_::ProcessControl_, PATCH_JUMP);
- InjectHook(0x4BA800, &CCutsceneHead_::Render_, PATCH_JUMP);
- InjectHook(0x4BA6A0, &CCutsceneHead::PlayAnimation, PATCH_JUMP);
-ENDPATCHES
diff --git a/src/objects/CutsceneObject.cpp b/src/objects/CutsceneObject.cpp
index 2f667a5d..cee83848 100644
--- a/src/objects/CutsceneObject.cpp
+++ b/src/objects/CutsceneObject.cpp
@@ -1,5 +1,5 @@
#include "common.h"
-#include "patcher.h"
+
#include "main.h"
#include "Lights.h"
#include "PointLights.h"
@@ -88,25 +88,3 @@ CCutsceneObject::RemoveLighting(bool reset)
{
CRenderer::RemoveVehiclePedLights(this, reset);
}
-
-class CCutsceneObject_ : public CCutsceneObject
-{
-public:
- void dtor(void) { this->CCutsceneObject::~CCutsceneObject(); }
- void SetModelIndex_(uint32 id) { CCutsceneObject::SetModelIndex(id); }
- void ProcessControl_(void) { CCutsceneObject::ProcessControl(); }
- void PreRender_(void) { CCutsceneObject::PreRender(); }
- void Render_(void) { CCutsceneObject::Render(); }
- bool SetupLighting_(void) { return CCutsceneObject::SetupLighting(); }
- void RemoveLighting_(bool reset) { CCutsceneObject::RemoveLighting(reset); }
-};
-
-STARTPATCHES
- InjectHook(0x4BA960, &CCutsceneObject_::dtor, PATCH_JUMP);
- InjectHook(0x4BA980, &CCutsceneObject_::SetModelIndex_, PATCH_JUMP);
- InjectHook(0x4BA9C0, &CCutsceneObject_::ProcessControl_, PATCH_JUMP);
- InjectHook(0x4BAA40, &CCutsceneObject_::PreRender_, PATCH_JUMP);
- InjectHook(0x4BAAA0, &CCutsceneObject_::Render_, PATCH_JUMP);
- InjectHook(0x4A7E70, &CCutsceneObject_::SetupLighting_, PATCH_JUMP);
- InjectHook(0x4A7F00, &CCutsceneObject_::RemoveLighting_, PATCH_JUMP);
-ENDPATCHES
diff --git a/src/objects/DummyObject.cpp b/src/objects/DummyObject.cpp
index ba09ac3e..d5805073 100644
--- a/src/objects/DummyObject.cpp
+++ b/src/objects/DummyObject.cpp
@@ -1,5 +1,5 @@
#include "common.h"
-#include "patcher.h"
+
#include "DummyObject.h"
#include "Pools.h"
@@ -11,19 +11,3 @@ CDummyObject::CDummyObject(CObject *obj)
obj->DetachFromRwObject();
m_level = obj->m_level;
}
-
-#include <new>
-
-class CDummyObject_ : public CDummyObject
-{
-public:
- void dtor(void) { CDummyObject::~CDummyObject(); }
- CDummyObject *ctor(void) { return ::new (this) CDummyObject(); }
- CDummyObject *ctor(CObject *obj) { return ::new (this) CDummyObject(obj); }
-};
-
-STARTPATCHES
- InjectHook(0x4BAAF0, (CDummyObject* (CDummyObject::*)(void)) &CDummyObject_::ctor, PATCH_JUMP);
- InjectHook(0x4BAB10, (CDummyObject* (CDummyObject::*)(CObject*)) &CDummyObject_::ctor, PATCH_JUMP);
- InjectHook(0x4BAB70, &CDummyObject_::dtor, PATCH_JUMP);
-ENDPATCHES \ No newline at end of file
diff --git a/src/objects/Object.cpp b/src/objects/Object.cpp
index 867624c7..8968c117 100644
--- a/src/objects/Object.cpp
+++ b/src/objects/Object.cpp
@@ -1,5 +1,5 @@
#include "common.h"
-#include "patcher.h"
+
#include "main.h"
#include "Lights.h"
#include "Pools.h"
@@ -12,8 +12,8 @@
#include "World.h"
#include "Floater.h"
-int16 &CObject::nNoTempObjects = *(int16*)0x95CCA2;
-int16 &CObject::nBodyCastHealth = *(int16*)0x5F7D4C; // 1000
+int16 CObject::nNoTempObjects;
+int16 CObject::nBodyCastHealth = 1000;
void *CObject::operator new(size_t sz) { return CPools::GetObjectPool()->New(); }
void *CObject::operator new(size_t sz, int handle) { return CPools::GetObjectPool()->New(handle);};
@@ -383,7 +383,7 @@ CObject::DeleteAllTempObjects()
}
void
-CObject::DeleteAllTempObjectInArea(CVector point, float fRadius)
+CObject::DeleteAllTempObjectsInArea(CVector point, float fRadius)
{
CObjectPool *objectPool = CPools::GetObjectPool();
for (int32 i = 0; i < objectPool->GetSize(); i++) {
@@ -394,37 +394,3 @@ CObject::DeleteAllTempObjectInArea(CVector point, float fRadius)
}
}
}
-
-#include <new>
-
-class CObject_ : public CObject
-{
-public:
- CObject *ctor(void) { return ::new (this) CObject(); }
- CObject *ctor(int32 mi, bool createRW) { return ::new (this) CObject(mi, createRW); }
- CObject *ctor(CDummyObject *dummy) { return ::new (this) CObject(dummy); }
- void dtor(void) { CObject::~CObject(); }
- void Render_(void) { CObject::Render(); }
- void ProcessControl_(void) { CObject::ProcessControl(); }
- bool SetupLighting_(void) { return CObject::SetupLighting(); }
- void RemoveLighting_(bool reset) { CObject::RemoveLighting(reset); }
-};
-
-STARTPATCHES
- InjectHook(0x4BABD0, (CObject* (CObject::*)(void)) &CObject_::ctor, PATCH_JUMP);
- InjectHook(0x4BACE0, (CObject* (CObject::*)(int32, bool)) &CObject_::ctor, PATCH_JUMP);
- InjectHook(0x4BAD50, (CObject* (CObject::*)(CDummyObject*)) &CObject_::ctor, PATCH_JUMP);
- InjectHook(0x4BAE00, &CObject_::dtor, PATCH_JUMP);
- InjectHook(0x4BB040, &CObject_::ProcessControl_, PATCH_JUMP);
- InjectHook(0x4BBDA0, &CObject::Teleport, PATCH_JUMP);
- InjectHook(0x4BB1E0, &CObject_::Render_, PATCH_JUMP);
- InjectHook(0x4A7C90, &CObject_::SetupLighting_, PATCH_JUMP);
- InjectHook(0x4A7CD0, &CObject_::RemoveLighting_, PATCH_JUMP);
- InjectHook(0x4BB240, &CObject::ObjectDamage, PATCH_JUMP);
- InjectHook(0x4BBD80, &CObject::RefModelInfo, PATCH_JUMP);
- InjectHook(0x4BAEC0, &CObject::Init, PATCH_JUMP);
- InjectHook(0x4BB010, &CObject::CanBeDeleted, PATCH_JUMP);
- InjectHook(0x4BBE60, &CObject::DeleteAllMissionObjects, PATCH_JUMP);
- InjectHook(0x4BBDF0, &CObject::DeleteAllTempObjects, PATCH_JUMP);
- InjectHook(0x4BBED0, &CObject::DeleteAllTempObjectInArea, PATCH_JUMP);
-ENDPATCHES
diff --git a/src/objects/Object.h b/src/objects/Object.h
index 6d04c78a..0c00f441 100644
--- a/src/objects/Object.h
+++ b/src/objects/Object.h
@@ -73,8 +73,8 @@ public:
CEntity *m_pCollidingEntity;
int8 m_colour1, m_colour2;
- static int16 &nNoTempObjects;
- static int16 &nBodyCastHealth;
+ static int16 nNoTempObjects;
+ static int16 nBodyCastHealth;
static void *operator new(size_t);
static void *operator new(size_t, int);
@@ -99,6 +99,6 @@ public:
static void DeleteAllMissionObjects();
static void DeleteAllTempObjects();
- static void DeleteAllTempObjectInArea(CVector point, float fRadius);
+ static void DeleteAllTempObjectsInArea(CVector point, float fRadius);
};
static_assert(sizeof(CObject) == 0x198, "CObject: error");
diff --git a/src/objects/ObjectData.cpp b/src/objects/ObjectData.cpp
index aa58a845..589cc3f7 100644
--- a/src/objects/ObjectData.cpp
+++ b/src/objects/ObjectData.cpp
@@ -1,5 +1,5 @@
#include "common.h"
-#include "patcher.h"
+
#include "main.h"
#include "ModelInfo.h"
#include "Object.h"
@@ -96,8 +96,3 @@ CObjectData::SetObjectData(int32 modelId, CObject &object)
object.bExplosionProof = true;
}
}
-
-STARTPATCHES
- InjectHook(0x4BC0E0, CObjectData::Initialise, PATCH_JUMP);
- InjectHook(0x4BC270, CObjectData::SetObjectData, PATCH_JUMP);
-ENDPATCHES
diff --git a/src/objects/ParticleObject.cpp b/src/objects/ParticleObject.cpp
index 60827411..fe448966 100644
--- a/src/objects/ParticleObject.cpp
+++ b/src/objects/ParticleObject.cpp
@@ -1,5 +1,5 @@
#include "common.h"
-#include "patcher.h"
+
#include "ParticleObject.h"
#include "Timer.h"
#include "General.h"
@@ -9,11 +9,11 @@
#include "Game.h"
-CParticleObject (&gPObjectArray)[MAX_PARTICLEOBJECTS] = *(CParticleObject(*)[MAX_PARTICLEOBJECTS])*(uintptr*)0x62A58C;
+CParticleObject gPObjectArray[MAX_PARTICLEOBJECTS];
-CParticleObject *&CParticleObject::pCloseListHead = *(CParticleObject **)int(0x8F4340);
-CParticleObject *&CParticleObject::pFarListHead = *(CParticleObject **)int(0x942F78);
-CParticleObject *&CParticleObject::pUnusedListHead = *(CParticleObject **)int(0x94128C);
+CParticleObject *CParticleObject::pCloseListHead;
+CParticleObject *CParticleObject::pFarListHead;
+CParticleObject *CParticleObject::pUnusedListHead;
CAudioHydrant List[MAX_AUDIOHYDRANTS];
@@ -1099,39 +1099,3 @@ CParticleObject::MoveToList(CParticleObject **from, CParticleObject **to, CParti
if ( obj->m_pNext )
obj->m_pNext->m_pPrev = obj;
}
-
-class CParticleObject_ : public CParticleObject
-{
-public:
- void ctor() { CParticleObject::CParticleObject(); }
- void dtor() { CParticleObject::~CParticleObject(); }
-};
-
-STARTPATCHES
- InjectHook(0x4BC330, CAudioHydrant::Add, PATCH_JUMP);
- InjectHook(0x4BC390, CAudioHydrant::Remove, PATCH_JUMP);
-
- InjectHook(0x4BC3E0, &CParticleObject_::ctor, PATCH_JUMP);
- InjectHook(0x4BC420, &CParticleObject_::dtor, PATCH_JUMP);
- InjectHook(0x4BC440, CParticleObject::Initialise, PATCH_JUMP);
-
- InjectHook(0x4BC4D0, (CParticleObject *(*)(uint16, CVector const &, uint8))CParticleObject::AddObject, PATCH_JUMP);
- InjectHook(0x4BC520, (CParticleObject *(*)(uint16, CVector const &, float, uint8))CParticleObject::AddObject, PATCH_JUMP);
- InjectHook(0x4BC570, (CParticleObject *(*)(uint16, CVector const &, CVector const &, float, uint8))CParticleObject::AddObject, PATCH_JUMP);
- InjectHook(0x4BC5B0, (CParticleObject *(*)(uint16, CVector const &, CVector const &, float, uint32, RwRGBA const &, uint8))CParticleObject::AddObject, PATCH_JUMP);
-
- InjectHook(0x4BC9F0, &CParticleObject::RemoveObject, PATCH_JUMP);
- InjectHook(0x4BCA30, CParticleObject::UpdateAll, PATCH_JUMP);
- InjectHook(0x4BCA80, &CParticleObject::UpdateClose, PATCH_JUMP);
- InjectHook(0x4BF9F0, &CParticleObject::UpdateFar, PATCH_JUMP);
- InjectHook(0x4BFA80, CParticleObject::SaveParticle, PATCH_JUMP);
- InjectHook(0x4BFB30, CParticleObject::LoadParticle, PATCH_JUMP);
- InjectHook(0x4BFC80, CParticleObject::RemoveAllParticleObjects, PATCH_JUMP);
- InjectHook(0x4BFD10, CParticleObject::MoveToList, PATCH_JUMP);
- //InjectHook(0x4BFD70, CParticleObject::~CParticleObject, PATCH_JUMP); // virtual
- //InjectHook(0x4BFDB0, `global constructor keyed to'ParticleObject.cpp, PATCH_JUMP);
- //InjectHook(0x4BFE00, CAudioHydrant::CAudioHydrant, PATCH_JUMP);
- //InjectHook(0x4BFE10, sub_4BFE10, PATCH_JUMP); // destroy gPObjectArray array
-
-
-ENDPATCHES
diff --git a/src/objects/ParticleObject.h b/src/objects/ParticleObject.h
index 45a3fa30..cfa5936d 100644
--- a/src/objects/ParticleObject.h
+++ b/src/objects/ParticleObject.h
@@ -62,9 +62,9 @@ public:
int8 m_nCreationChance;
char _pad1[2];
- static CParticleObject *&pCloseListHead;
- static CParticleObject *&pFarListHead;
- static CParticleObject *&pUnusedListHead;
+ static CParticleObject *pCloseListHead;
+ static CParticleObject *pFarListHead;
+ static CParticleObject *pUnusedListHead;
CParticleObject();
~CParticleObject();
@@ -89,7 +89,7 @@ public:
static void MoveToList(CParticleObject **from, CParticleObject **to, CParticleObject *obj);
};
-extern CParticleObject (&gPObjectArray)[MAX_PARTICLEOBJECTS];
+extern CParticleObject gPObjectArray[MAX_PARTICLEOBJECTS];
class CAudioHydrant
{
diff --git a/src/objects/Projectile.cpp b/src/objects/Projectile.cpp
index 32bc6bdb..fe8b0c68 100644
--- a/src/objects/Projectile.cpp
+++ b/src/objects/Projectile.cpp
@@ -1,5 +1,5 @@
#include "common.h"
-#include "patcher.h"
+
#include "Projectile.h"
CProjectile::CProjectile(int32 model) : CObject()
@@ -13,17 +13,3 @@ CProjectile::CProjectile(int32 model) : CObject()
SetModelIndex(model);
ObjectCreatedBy = MISSION_OBJECT;
}
-
-#include <new>
-
-class CProjectile_ : public CProjectile
-{
-public:
- CProjectile* ctor(int32 model) { return ::new (this) CProjectile(model); }
- void dtor(void) { CProjectile::~CProjectile(); }
-};
-
-STARTPATCHES
- InjectHook(0x4BFE30, &CProjectile_::ctor, PATCH_JUMP);
- InjectHook(0x4BFED0, &CProjectile_::dtor, PATCH_JUMP);
-ENDPATCHES