summaryrefslogtreecommitdiff
path: root/src/entities/Entity.cpp
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/entities/Entity.cpp
parent6ec421fe7bc683e0d056d2a1b9d0bd0d159cf8e3 (diff)
cleaned up patching of virtual functions; started CAutomobile
Diffstat (limited to 'src/entities/Entity.cpp')
-rw-r--r--src/entities/Entity.cpp40
1 files changed, 28 insertions, 12 deletions
diff --git a/src/entities/Entity.cpp b/src/entities/Entity.cpp
index fac7f17f..105f14c3 100644
--- a/src/entities/Entity.cpp
+++ b/src/entities/Entity.cpp
@@ -865,10 +865,35 @@ CEntity::ModifyMatrixForBannerInWind(void)
UpdateRwFrame();
}
+class CEntity_ : public CEntity
+{
+public:
+ CEntity *ctor(void) { return ::new (this) CEntity(); }
+ void dtor(void) { this->CEntity::~CEntity(); }
+ void Add_(void) { CEntity::Add(); }
+ void Remove_(void) { CEntity::Remove(); }
+ void SetModelIndex_(uint32 i) { CEntity::SetModelIndex(i); }
+ void CreateRwObject_(void) { CEntity::CreateRwObject(); }
+ void DeleteRwObject_(void) { CEntity::DeleteRwObject(); }
+ CRect GetBoundRect_(void) { return CEntity::GetBoundRect(); }
+ void PreRender_(void) { CEntity::PreRender(); }
+ void Render_(void) { CEntity::Render(); }
+ bool SetupLighting_(void) { return CEntity::SetupLighting(); }
+};
+
STARTPATCHES
- InjectHook(0x473C30, &CEntity::ctor, PATCH_JUMP);
- InjectHook(0x473E40, &CEntity::dtor, PATCH_JUMP);
- InjectHook(0x473E70, &CEntity::SetModelIndex_, PATCH_JUMP);
+ InjectHook(0x473C30, &CEntity_::ctor, PATCH_JUMP);
+ InjectHook(0x473E40, &CEntity_::dtor, PATCH_JUMP);
+ InjectHook(0x473E70, &CEntity_::SetModelIndex_, PATCH_JUMP);
+ InjectHook(0x475080, &CEntity_::Add_, PATCH_JUMP);
+ InjectHook(0x475310, &CEntity_::Remove_, PATCH_JUMP);
+ InjectHook(0x473EA0, &CEntity_::CreateRwObject_, PATCH_JUMP);
+ InjectHook(0x473F90, &CEntity_::DeleteRwObject_, PATCH_JUMP);
+ InjectHook(0x474000, &CEntity_::GetBoundRect_, PATCH_JUMP);
+ InjectHook(0x474350, &CEntity_::PreRender_, PATCH_JUMP);
+ InjectHook(0x474BD0, &CEntity_::Render_, PATCH_JUMP);
+ InjectHook(0x4A7C60, &CEntity_::SetupLighting_, PATCH_JUMP);
+
InjectHook(0x4742C0, (void (CEntity::*)(CVector&))&CEntity::GetBoundCentre, PATCH_JUMP);
InjectHook(0x474310, &CEntity::GetBoundRadius, PATCH_JUMP);
InjectHook(0x474C10, &CEntity::GetIsTouching, PATCH_JUMP);
@@ -889,13 +914,4 @@ STARTPATCHES
InjectHook(0x475670, &CEntity::ModifyMatrixForTreeInWind, PATCH_JUMP);
InjectHook(0x475830, &CEntity::ModifyMatrixForBannerInWind, PATCH_JUMP);
InjectHook(0x4FA530, &CEntity::ProcessLightsForEntity, PATCH_JUMP);
-
- InjectHook(0x475080, &CEntity::Add_, PATCH_JUMP);
- InjectHook(0x475310, &CEntity::Remove_, PATCH_JUMP);
- InjectHook(0x473EA0, &CEntity::CreateRwObject_, PATCH_JUMP);
- InjectHook(0x473F90, &CEntity::DeleteRwObject_, PATCH_JUMP);
- InjectHook(0x474000, &CEntity::GetBoundRect_, PATCH_JUMP);
- InjectHook(0x474350, &CEntity::PreRender_, PATCH_JUMP);
- InjectHook(0x474BD0, &CEntity::Render_, PATCH_JUMP);
- InjectHook(0x4A7C60, &CEntity::SetupLighting_, PATCH_JUMP);
ENDPATCHES