Merge branch 'miami' of github.com:GTAmodding/re3 into miami

This commit is contained in:
aap
2020-12-19 17:27:01 +01:00
68 changed files with 2055 additions and 310 deletions

View File

@ -118,3 +118,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

View File

@ -2,6 +2,10 @@
#include "templates.h"
#ifdef MoveMemory
#undef MoveMemory // windows shit
#endif
class CAnimBlendSequence;
// A collection of sequences
@ -25,6 +29,7 @@ public:
void RemoveAnimSequences(void);
void Uncompress(void);
void RemoveUncompressedData(void);
void MoveMemory(bool onlyone = false);
bool IsCompressed() { return !!compressed; };
};

View File

@ -179,3 +179,24 @@ CAnimBlendSequence::RemoveUncompressedData(void)
RwFree(keyFrames);
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

View File

@ -2,6 +2,10 @@
#include "Quaternion.h"
#ifdef MoveMemory
#undef MoveMemory // windows shit
#endif
// TODO: put them somewhere else?
struct KeyFrame {
CQuaternion rotation;
@ -84,6 +88,7 @@ public:
void Uncompress(void);
void CompressKeyframes(void);
void RemoveUncompressedData(void);
bool MoveMemory(void);
void SetBoneTag(int tag) { boneTag = tag; }
};