summaryrefslogtreecommitdiffstats
path: root/src/animation
diff options
context:
space:
mode:
authorNikolay Korolev <nickvnuk@gmail.com>2020-03-28 13:24:55 +0100
committerNikolay Korolev <nickvnuk@gmail.com>2020-03-28 13:24:55 +0100
commit9fb101fdd96c82f73f8b09a75a2f248e1ccc0f18 (patch)
tree6e220fddfcabc63c477335fb1ddccefe7b6d5e0d /src/animation
parentgarages part 1 (diff)
parentremove include <new> from common.h (diff)
downloadre3-9fb101fdd96c82f73f8b09a75a2f248e1ccc0f18.tar
re3-9fb101fdd96c82f73f8b09a75a2f248e1ccc0f18.tar.gz
re3-9fb101fdd96c82f73f8b09a75a2f248e1ccc0f18.tar.bz2
re3-9fb101fdd96c82f73f8b09a75a2f248e1ccc0f18.tar.lz
re3-9fb101fdd96c82f73f8b09a75a2f248e1ccc0f18.tar.xz
re3-9fb101fdd96c82f73f8b09a75a2f248e1ccc0f18.tar.zst
re3-9fb101fdd96c82f73f8b09a75a2f248e1ccc0f18.zip
Diffstat (limited to 'src/animation')
-rw-r--r--src/animation/AnimBlendAssociation.cpp15
-rw-r--r--src/animation/AnimBlendAssociation.h4
-rw-r--r--src/animation/AnimBlendClumpData.cpp14
-rw-r--r--src/animation/AnimBlendClumpData.h4
4 files changed, 24 insertions, 13 deletions
diff --git a/src/animation/AnimBlendAssociation.cpp b/src/animation/AnimBlendAssociation.cpp
index ec42191b..246322ba 100644
--- a/src/animation/AnimBlendAssociation.cpp
+++ b/src/animation/AnimBlendAssociation.cpp
@@ -203,6 +203,15 @@ CAnimBlendAssociation::UpdateBlend(float timeDelta)
return true;
}
+#include <new>
+
+class CAnimBlendAssociation_ : public CAnimBlendAssociation
+{
+public:
+ CAnimBlendAssociation *ctor1(void) { return ::new (this) CAnimBlendAssociation(); }
+ CAnimBlendAssociation *ctor2(CAnimBlendAssociation &other) { return ::new (this) CAnimBlendAssociation(other); }
+ void dtor(void) { this->CAnimBlendAssociation::~CAnimBlendAssociation(); }
+};
STARTPATCHES
InjectHook(0x4016A0, &CAnimBlendAssociation::AllocateAnimBlendNodeArray, PATCH_JUMP);
@@ -219,7 +228,7 @@ STARTPATCHES
InjectHook(0x4031F0, &CAnimBlendAssociation::UpdateTime, PATCH_JUMP);
InjectHook(0x4032B0, &CAnimBlendAssociation::UpdateBlend, PATCH_JUMP);
- InjectHook(0x401460, &CAnimBlendAssociation::ctor1, PATCH_JUMP);
- InjectHook(0x4014C0, &CAnimBlendAssociation::ctor2, PATCH_JUMP);
- InjectHook(0x401520, &CAnimBlendAssociation::dtor, PATCH_JUMP);
+ InjectHook(0x401460, &CAnimBlendAssociation_::ctor1, PATCH_JUMP);
+ InjectHook(0x4014C0, &CAnimBlendAssociation_::ctor2, PATCH_JUMP);
+ InjectHook(0x401520, &CAnimBlendAssociation_::dtor, PATCH_JUMP);
ENDPATCHES
diff --git a/src/animation/AnimBlendAssociation.h b/src/animation/AnimBlendAssociation.h
index aec28f56..d35db1db 100644
--- a/src/animation/AnimBlendAssociation.h
+++ b/src/animation/AnimBlendAssociation.h
@@ -85,9 +85,5 @@ public:
static CAnimBlendAssociation *FromLink(CAnimBlendLink *l) {
return (CAnimBlendAssociation*)((uint8*)l - offsetof(CAnimBlendAssociation, link));
}
-
- CAnimBlendAssociation *ctor1(void) { return ::new (this) CAnimBlendAssociation(); }
- CAnimBlendAssociation *ctor2(CAnimBlendAssociation &other) { return ::new (this) CAnimBlendAssociation(other); }
- void dtor(void) { this->CAnimBlendAssociation::~CAnimBlendAssociation(); }
};
static_assert(sizeof(CAnimBlendAssociation) == 0x40, "CAnimBlendAssociation: error");
diff --git a/src/animation/AnimBlendClumpData.cpp b/src/animation/AnimBlendClumpData.cpp
index 06625eb5..cc4281d6 100644
--- a/src/animation/AnimBlendClumpData.cpp
+++ b/src/animation/AnimBlendClumpData.cpp
@@ -36,9 +36,19 @@ CAnimBlendClumpData::ForAllFrames(void (*cb)(AnimBlendFrameData*, void*), void *
cb(&frames[i], arg);
}
+#include <new>
+
+class CAnimBlendClumpData_ : public CAnimBlendClumpData
+{
+public:
+ CAnimBlendClumpData *ctor(void) { return ::new (this) CAnimBlendClumpData(); }
+ void dtor(void) { this->CAnimBlendClumpData::~CAnimBlendClumpData(); }
+};
+
+
STARTPATCHES
- InjectHook(0x401880, &CAnimBlendClumpData::ctor, PATCH_JUMP);
- InjectHook(0x4018B0, &CAnimBlendClumpData::dtor, PATCH_JUMP);
+ InjectHook(0x401880, &CAnimBlendClumpData_::ctor, PATCH_JUMP);
+ InjectHook(0x4018B0, &CAnimBlendClumpData_::dtor, PATCH_JUMP);
InjectHook(0x4018F0, &CAnimBlendClumpData::SetNumberOfFrames, PATCH_JUMP);
InjectHook(0x401930, &CAnimBlendClumpData::ForAllFrames, PATCH_JUMP);
ENDPATCHES
diff --git a/src/animation/AnimBlendClumpData.h b/src/animation/AnimBlendClumpData.h
index df2fbc56..1c8c391d 100644
--- a/src/animation/AnimBlendClumpData.h
+++ b/src/animation/AnimBlendClumpData.h
@@ -49,9 +49,5 @@ public:
void SetNumberOfBones(int n) { SetNumberOfFrames(n); }
#endif
void ForAllFrames(void (*cb)(AnimBlendFrameData*, void*), void *arg);
-
-
- CAnimBlendClumpData *ctor(void) { return ::new (this) CAnimBlendClumpData(); }
- void dtor(void) { this->CAnimBlendClumpData::~CAnimBlendClumpData(); }
};
static_assert(sizeof(CAnimBlendClumpData) == 0x14, "CAnimBlendClumpData: error");