summaryrefslogtreecommitdiffstats
path: root/src/objects
diff options
context:
space:
mode:
authorFire_Head <Fire-Head@users.noreply.github.com>2019-07-11 02:48:36 +0200
committerGitHub <noreply@github.com>2019-07-11 02:48:36 +0200
commitaa449b6fe162d8960351c5fe164a9120b8572652 (patch)
treefa82496d356ac2b77ffa1ab00684b0150907f009 /src/objects
parentfixfixfix (diff)
parentMerge pull request #129 from erorcun/erorcun (diff)
downloadre3-aa449b6fe162d8960351c5fe164a9120b8572652.tar
re3-aa449b6fe162d8960351c5fe164a9120b8572652.tar.gz
re3-aa449b6fe162d8960351c5fe164a9120b8572652.tar.bz2
re3-aa449b6fe162d8960351c5fe164a9120b8572652.tar.lz
re3-aa449b6fe162d8960351c5fe164a9120b8572652.tar.xz
re3-aa449b6fe162d8960351c5fe164a9120b8572652.tar.zst
re3-aa449b6fe162d8960351c5fe164a9120b8572652.zip
Diffstat (limited to 'src/objects')
-rw-r--r--src/objects/CutsceneHead.cpp17
-rw-r--r--src/objects/CutsceneHead.h5
-rw-r--r--src/objects/CutsceneObject.cpp26
-rw-r--r--src/objects/CutsceneObject.h20
-rw-r--r--src/objects/DummyObject.cpp10
-rw-r--r--src/objects/DummyObject.h1
-rw-r--r--src/objects/Object.cpp21
-rw-r--r--src/objects/Object.h5
-rw-r--r--src/objects/ParticleObject.cpp10
-rw-r--r--src/objects/ParticleObject.h2
-rw-r--r--src/objects/Projectile.cpp10
-rw-r--r--src/objects/Projectile.h1
12 files changed, 82 insertions, 46 deletions
diff --git a/src/objects/CutsceneHead.cpp b/src/objects/CutsceneHead.cpp
index a9c47777..c423d0b8 100644
--- a/src/objects/CutsceneHead.cpp
+++ b/src/objects/CutsceneHead.cpp
@@ -109,10 +109,19 @@ CCutsceneHead::PlayAnimation(const char *animName)
}
}
+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(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/CutsceneHead.h b/src/objects/CutsceneHead.h
index de4f011f..52b66ede 100644
--- a/src/objects/CutsceneHead.h
+++ b/src/objects/CutsceneHead.h
@@ -15,10 +15,5 @@ public:
void Render(void);
void PlayAnimation(const char *animName);
-
- void CreateRwObject_(void) { CCutsceneHead::CreateRwObject(); }
- void DeleteRwObject_(void) { CCutsceneHead::DeleteRwObject(); }
- void ProcessControl_(void) { CCutsceneHead::ProcessControl(); }
- void Render_(void) { CCutsceneHead::Render(); }
};
static_assert(sizeof(CCutsceneHead) == 0x19C, "CCutsceneHead: error");
diff --git a/src/objects/CutsceneObject.cpp b/src/objects/CutsceneObject.cpp
index ede5be5b..2f667a5d 100644
--- a/src/objects/CutsceneObject.cpp
+++ b/src/objects/CutsceneObject.cpp
@@ -89,12 +89,24 @@ 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);
+ 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/CutsceneObject.h b/src/objects/CutsceneObject.h
index 9360651e..31c3a528 100644
--- a/src/objects/CutsceneObject.h
+++ b/src/objects/CutsceneObject.h
@@ -7,19 +7,11 @@ class CCutsceneObject : public CObject
public:
CCutsceneObject(void);
- virtual void SetModelIndex(uint32 id);
- virtual void ProcessControl(void);
- virtual void PreRender(void);
- virtual void Render(void);
- virtual bool SetupLighting(void);
- virtual void RemoveLighting(bool reset);
-
- 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); }
+ void SetModelIndex(uint32 id);
+ void ProcessControl(void);
+ void PreRender(void);
+ void Render(void);
+ bool SetupLighting(void);
+ void RemoveLighting(bool reset);
};
static_assert(sizeof(CCutsceneObject) == 0x198, "CCutsceneObject: error");
diff --git a/src/objects/DummyObject.cpp b/src/objects/DummyObject.cpp
index 1e4b2ae0..41b15129 100644
--- a/src/objects/DummyObject.cpp
+++ b/src/objects/DummyObject.cpp
@@ -12,6 +12,12 @@ CDummyObject::CDummyObject(CObject *obj)
m_level = obj->m_level;
}
+class CDummyObject_ : public CDummyObject
+{
+public:
+ void dtor(void) { CDummyObject::~CDummyObject(); }
+};
+
STARTPATCHES
- InjectHook(0x4BAB70, &CDummyObject::dtor, PATCH_JUMP);
-ENDPATCHES \ No newline at end of file
+ InjectHook(0x4BAB70, &CDummyObject_::dtor, PATCH_JUMP);
+ENDPATCHES
diff --git a/src/objects/DummyObject.h b/src/objects/DummyObject.h
index 10554bdd..d4dce609 100644
--- a/src/objects/DummyObject.h
+++ b/src/objects/DummyObject.h
@@ -9,6 +9,5 @@ class CDummyObject : public CDummy
public:
CDummyObject(void) {}
CDummyObject(CObject *obj);
- void dtor(void) { this->CDummyObject::~CDummyObject(); }
};
static_assert(sizeof(CDummyObject) == 0x68, "CDummyObject: error");
diff --git a/src/objects/Object.cpp b/src/objects/Object.cpp
index 6712d77b..f3ba8087 100644
--- a/src/objects/Object.cpp
+++ b/src/objects/Object.cpp
@@ -7,8 +7,10 @@
#include "Object.h"
WRAPPER void CObject::ObjectDamage(float amount) { EAXJMP(0x4BB240); }
+WRAPPER void CObject::DeleteAllTempObjectInArea(CVector, float) { EAXJMP(0x4BBED0); }
int16 &CObject::nNoTempObjects = *(int16*)0x95CCA2;
+int16 &CObject::nBodyCastHealth = *(int16*)0x5F7D4C; // 1000
void *CObject::operator new(size_t sz) { return CPools::GetObjectPool()->New(); }
void CObject::operator delete(void *p, size_t sz) { CPools::GetObjectPool()->Delete((CObject*)p); }
@@ -85,9 +87,22 @@ CObject::RemoveLighting(bool reset)
WorldReplaceScorchedLightsWithNormal(Scene.world);
}
-WRAPPER void CObject::DeleteAllTempObjectInArea(CVector, float) { EAXJMP(0x4BBED0); }
+
+void
+CObject::RefModelInfo(int32 modelId)
+{
+ m_nRefModelIndex = modelId;
+ CModelInfo::GetModelInfo(modelId)->AddRef();
+}
+
+class CObject_ : public CObject
+{
+public:
+ void dtor(void) { this->CObject::~CObject(); }
+ void Render_(void) { CObject::Render(); }
+};
STARTPATCHES
- InjectHook(0x4BAE00, &CObject::dtor, PATCH_JUMP);
- InjectHook(0x4BB1E0, &CObject::Render_, PATCH_JUMP);
+ InjectHook(0x4BAE00, &CObject_::dtor, PATCH_JUMP);
+ InjectHook(0x4BB1E0, &CObject_::Render_, PATCH_JUMP);
ENDPATCHES
diff --git a/src/objects/Object.h b/src/objects/Object.h
index de4c8e05..0ce1a3aa 100644
--- a/src/objects/Object.h
+++ b/src/objects/Object.h
@@ -60,6 +60,7 @@ public:
int8 m_colour1, m_colour2;
static int16 &nNoTempObjects;
+ static int16 &nBodyCastHealth;
static void *operator new(size_t);
static void operator delete(void*, size_t);
@@ -72,10 +73,8 @@ public:
void RemoveLighting(bool reset);
void ObjectDamage(float amount);
+ void RefModelInfo(int32 modelId);
static void DeleteAllTempObjectInArea(CVector, float);
-
- void dtor(void) { this->CObject::~CObject(); }
- void Render_(void) { CObject::Render(); }
};
static_assert(sizeof(CObject) == 0x198, "CObject: error");
diff --git a/src/objects/ParticleObject.cpp b/src/objects/ParticleObject.cpp
index cf6e84bf..25f223e1 100644
--- a/src/objects/ParticleObject.cpp
+++ b/src/objects/ParticleObject.cpp
@@ -18,6 +18,12 @@ void CParticleObject::UpdateAll()
((void (__cdecl *)())0x4BCA30)();
}
+class CParticleObject_ : public CParticleObject
+{
+public:
+ void dtor() { CParticleObject::~CParticleObject(); }
+};
+
STARTPATCHES
- InjectHook(0x4BC420, &CParticleObject::dtor, PATCH_JUMP);
-ENDPATCHES \ No newline at end of file
+ InjectHook(0x4BC420, &CParticleObject_::dtor, PATCH_JUMP);
+ENDPATCHES
diff --git a/src/objects/ParticleObject.h b/src/objects/ParticleObject.h
index def7b7de..6ec090e7 100644
--- a/src/objects/ParticleObject.h
+++ b/src/objects/ParticleObject.h
@@ -34,6 +34,4 @@ public:
static void AddObject(uint16 type, const CVector &pos, const CVector &dir, float size, bool remove);
static void Initialise();
static void UpdateAll();
-
- void dtor() { this->CParticleObject::~CParticleObject(); }
};
diff --git a/src/objects/Projectile.cpp b/src/objects/Projectile.cpp
index e21323de..c6c2d6e1 100644
--- a/src/objects/Projectile.cpp
+++ b/src/objects/Projectile.cpp
@@ -2,6 +2,12 @@
#include "patcher.h"
#include "Projectile.h"
+class CProjectile_ : public CProjectile
+{
+public:
+ void dtor(void) { CProjectile::~CProjectile(); }
+};
+
STARTPATCHES
- InjectHook(0x4BFED0, &CProjectile::dtor, PATCH_JUMP);
-ENDPATCHES \ No newline at end of file
+ InjectHook(0x4BFED0, &CProjectile_::dtor, PATCH_JUMP);
+ENDPATCHES
diff --git a/src/objects/Projectile.h b/src/objects/Projectile.h
index a8e826b6..4d5041f8 100644
--- a/src/objects/Projectile.h
+++ b/src/objects/Projectile.h
@@ -7,5 +7,4 @@
class CProjectile : public CObject
{
public:
- void dtor(void) { this->CProjectile::~CProjectile(); }
};