summaryrefslogtreecommitdiffstats
path: root/src/animation
diff options
context:
space:
mode:
Diffstat (limited to 'src/animation')
-rw-r--r--src/animation/AnimBlendHierarchy.cpp11
-rw-r--r--src/animation/AnimBlendHierarchy.h5
-rw-r--r--src/animation/AnimBlendSequence.cpp21
-rw-r--r--src/animation/AnimBlendSequence.h5
4 files changed, 42 insertions, 0 deletions
diff --git a/src/animation/AnimBlendHierarchy.cpp b/src/animation/AnimBlendHierarchy.cpp
index 67b19019..c7800de5 100644
--- a/src/animation/AnimBlendHierarchy.cpp
+++ b/src/animation/AnimBlendHierarchy.cpp
@@ -82,3 +82,14 @@ CAnimBlendHierarchy::RemoveUncompressedData(void)
#endif
compressed = 1;
}
+
+#ifdef USE_CUSTOM_ALLOCATOR
+void
+CAnimBlendHierarchy::MoveMemory(bool onlyone)
+{
+ int i;
+ for(i = 0; i < numSequences; i++)
+ if(sequences[i].MoveMemory() && onlyone)
+ return;
+}
+#endif
diff --git a/src/animation/AnimBlendHierarchy.h b/src/animation/AnimBlendHierarchy.h
index 0144108d..e35b4925 100644
--- a/src/animation/AnimBlendHierarchy.h
+++ b/src/animation/AnimBlendHierarchy.h
@@ -2,6 +2,10 @@
#include "templates.h"
+#ifdef MoveMemory
+#undef MoveMemory // windows shit
+#endif
+
class CAnimBlendSequence;
// A collection of sequences
@@ -23,6 +27,7 @@ public:
void RemoveAnimSequences(void);
void Uncompress(void);
void RemoveUncompressedData(void);
+ void MoveMemory(bool onlyone = false);
};
VALIDATE_SIZE(CAnimBlendHierarchy, 0x28); \ No newline at end of file
diff --git a/src/animation/AnimBlendSequence.cpp b/src/animation/AnimBlendSequence.cpp
index 5a2fa605..c958b71a 100644
--- a/src/animation/AnimBlendSequence.cpp
+++ b/src/animation/AnimBlendSequence.cpp
@@ -176,3 +176,24 @@ CAnimBlendSequence::RemoveUncompressedData(void)
keyFrames = nil;
}
+#ifdef USE_CUSTOM_ALLOCATOR
+bool
+CAnimBlendSequence::MoveMemory(void)
+{
+ if(keyFrames){
+ void *newaddr = gMainHeap.MoveMemory(keyFrames);
+ if(newaddr != keyFrames){
+ keyFrames = newaddr;
+ return true;
+ }
+ }else if(keyFramesCompressed){
+ void *newaddr = gMainHeap.MoveMemory(keyFramesCompressed);
+ if(newaddr != keyFramesCompressed){
+ keyFramesCompressed = newaddr;
+ return true;
+ }
+ }
+ return false;
+}
+#endif
+
diff --git a/src/animation/AnimBlendSequence.h b/src/animation/AnimBlendSequence.h
index e51e5aaa..c6e70f22 100644
--- a/src/animation/AnimBlendSequence.h
+++ b/src/animation/AnimBlendSequence.h
@@ -2,6 +2,10 @@
#include "Quaternion.h"
+#ifdef MoveMemory
+#undef MoveMemory // windows shit
+#endif
+
// TODO: put them somewhere else?
struct KeyFrame {
CQuaternion rotation;
@@ -53,6 +57,7 @@ public:
void Uncompress(void);
void CompressKeyframes(void);
void RemoveUncompressedData(void);
+ bool MoveMemory(void);
#ifdef PED_SKIN
void SetBoneTag(int tag) { boneTag = tag; }