summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2019-07-08 08:46:42 +0200
committeraap <aap@papnet.eu>2019-07-08 08:46:42 +0200
commit12af85ca3d29e155f40323ad07a77f96a4aececf (patch)
tree7a6d7c8ed51ec1c527903835bbe4ee39eef2ab8b /src/core
parentMerge pull request #111 from gennariarmando/master (diff)
downloadre3-12af85ca3d29e155f40323ad07a77f96a4aececf.tar
re3-12af85ca3d29e155f40323ad07a77f96a4aececf.tar.gz
re3-12af85ca3d29e155f40323ad07a77f96a4aececf.tar.bz2
re3-12af85ca3d29e155f40323ad07a77f96a4aececf.tar.lz
re3-12af85ca3d29e155f40323ad07a77f96a4aececf.tar.xz
re3-12af85ca3d29e155f40323ad07a77f96a4aececf.tar.zst
re3-12af85ca3d29e155f40323ad07a77f96a4aececf.zip
Diffstat (limited to 'src/core')
-rw-r--r--src/core/Instance.cpp13
-rw-r--r--src/core/Instance.h10
-rw-r--r--src/core/Placeable.cpp12
-rw-r--r--src/core/Placeable.h3
4 files changed, 33 insertions, 5 deletions
diff --git a/src/core/Instance.cpp b/src/core/Instance.cpp
new file mode 100644
index 00000000..5426605f
--- /dev/null
+++ b/src/core/Instance.cpp
@@ -0,0 +1,13 @@
+#include "common.h"
+#include "patcher.h"
+#include "Instance.h"
+
+class CInstance_ : public CInstance
+{
+public:
+ void dtor() { CInstance::~CInstance(); }
+};
+
+STARTPATCHES
+ InjectHook(0x50BE90, &CInstance_::dtor, PATCH_JUMP);
+ENDPATCHES
diff --git a/src/core/Instance.h b/src/core/Instance.h
new file mode 100644
index 00000000..1038c005
--- /dev/null
+++ b/src/core/Instance.h
@@ -0,0 +1,10 @@
+#pragma once
+
+#include "Placeable.h"
+
+// unused
+
+class CInstance : CPlaceable
+{
+public:
+};
diff --git a/src/core/Placeable.cpp b/src/core/Placeable.cpp
index b4b2a37b..c1fe705e 100644
--- a/src/core/Placeable.cpp
+++ b/src/core/Placeable.cpp
@@ -63,9 +63,17 @@ CPlaceable::IsWithinArea(float x1, float y1, float z1, float x2, float y2, float
z1 <= GetPosition().z && GetPosition().z <= z2;
}
+class CPlaceable_ : public CPlaceable
+{
+public:
+ CPlaceable *ctor(void) { return ::new (this) CPlaceable(); }
+ void dtor(void) { CPlaceable::~CPlaceable(); }
+};
+
STARTPATCHES
- InjectHook(0x49F9A0, &CPlaceable::ctor, PATCH_JUMP);
- InjectHook(0x49F9E0, &CPlaceable::dtor, PATCH_JUMP);
+ InjectHook(0x49F9A0, &CPlaceable_::ctor, PATCH_JUMP);
+ InjectHook(0x49F9E0, &CPlaceable_::dtor, PATCH_JUMP);
+
InjectHook(0x49FA00, &CPlaceable::SetHeading, PATCH_JUMP);
InjectHook(0x49FA50, (bool (CPlaceable::*)(float, float, float, float))&CPlaceable::IsWithinArea, PATCH_JUMP);
InjectHook(0x49FAF0, (bool (CPlaceable::*)(float, float, float, float, float, float))&CPlaceable::IsWithinArea, PATCH_JUMP);
diff --git a/src/core/Placeable.h b/src/core/Placeable.h
index 868ca9e7..bd1d50ab 100644
--- a/src/core/Placeable.h
+++ b/src/core/Placeable.h
@@ -19,8 +19,5 @@ public:
void SetHeading(float angle);
bool IsWithinArea(float x1, float y1, float x2, float y2);
bool IsWithinArea(float x1, float y1, float z1, float x2, float y2, float z2);
-
- CPlaceable *ctor(void) { return ::new (this) CPlaceable(); }
- void dtor(void) { this->CPlaceable::~CPlaceable(); }
};
static_assert(sizeof(CPlaceable) == 0x4C, "CPlaceable: error");