diff options
author | aap <aap@papnet.eu> | 2019-06-11 08:59:28 +0200 |
---|---|---|
committer | aap <aap@papnet.eu> | 2019-06-11 08:59:28 +0200 |
commit | e7ed4d009636804d5dbe05aae9e7ab23b80fdd37 (patch) | |
tree | 4c95f6e07923b5ed0a7046afeb42a1ea2b8693bf /src/animation/AnimBlendClumpData.cpp | |
parent | Merge branch 'master' of github.com:GTAmodding/re3 (diff) | |
download | re3-e7ed4d009636804d5dbe05aae9e7ab23b80fdd37.tar re3-e7ed4d009636804d5dbe05aae9e7ab23b80fdd37.tar.gz re3-e7ed4d009636804d5dbe05aae9e7ab23b80fdd37.tar.bz2 re3-e7ed4d009636804d5dbe05aae9e7ab23b80fdd37.tar.lz re3-e7ed4d009636804d5dbe05aae9e7ab23b80fdd37.tar.xz re3-e7ed4d009636804d5dbe05aae9e7ab23b80fdd37.tar.zst re3-e7ed4d009636804d5dbe05aae9e7ab23b80fdd37.zip |
Diffstat (limited to '')
-rw-r--r-- | src/animation/AnimBlendClumpData.cpp | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/src/animation/AnimBlendClumpData.cpp b/src/animation/AnimBlendClumpData.cpp new file mode 100644 index 00000000..57985533 --- /dev/null +++ b/src/animation/AnimBlendClumpData.cpp @@ -0,0 +1,46 @@ +#include "common.h" +#include "patcher.h" +#include "AnimBlendClumpData.h" + +// TODO: implement those +#define RwFreeAlign RwFree +#define RwMallocAlign(sz, algn) RwMalloc(sz) + +CAnimBlendClumpData::CAnimBlendClumpData(void) +{ + numFrames = 0; + pedPosition = nil; + frames = nil; + link.Init(); +} + +CAnimBlendClumpData::~CAnimBlendClumpData(void) +{ + link.Remove(); + if(frames) + RwFreeAlign(frames); +} + +void +CAnimBlendClumpData::SetNumberOfFrames(int n) +{ + if(frames) + RwFreeAlign(frames); + numFrames = n; + frames = (AnimBlendFrameData*)RwMallocAlign(numFrames * sizeof(AnimBlendFrameData), 64); +} + +void +CAnimBlendClumpData::ForAllFrames(void (*cb)(AnimBlendFrameData*, void*), void *arg) +{ + int i; + for(i = 0; i < numFrames; i++) + cb(&frames[i], arg); +} + +STARTPATCHES + 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 |