diff options
Diffstat (limited to 'src/animation/AnimBlendSequence.cpp')
-rw-r--r-- | src/animation/AnimBlendSequence.cpp | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/src/animation/AnimBlendSequence.cpp b/src/animation/AnimBlendSequence.cpp index 2ae150c1..93cce91d 100644 --- a/src/animation/AnimBlendSequence.cpp +++ b/src/animation/AnimBlendSequence.cpp @@ -3,15 +3,15 @@ #include "AnimBlendSequence.h" #include "MemoryHeap.h" +//--MIAMI: file done + CAnimBlendSequence::CAnimBlendSequence(void) { type = 0; numFrames = 0; keyFrames = nil; keyFramesCompressed = nil; -#ifdef PED_SKIN boneTag = -1; -#endif } CAnimBlendSequence::~CAnimBlendSequence(void) @@ -29,18 +29,21 @@ CAnimBlendSequence::SetName(char *name) } void -CAnimBlendSequence::SetNumFrames(int numFrames, bool translation) +CAnimBlendSequence::SetNumFrames(int numFrames, bool translation, bool compressed) { - int sz; - if(translation){ - sz = sizeof(KeyFrameTrans); type |= KF_ROT | KF_TRANS; + if(compressed) + keyFramesCompressed = RwMalloc(sizeof(KeyFrameTrans) * numFrames); + else + keyFrames = RwMalloc(sizeof(KeyFrameTrans) * numFrames); }else{ - sz = sizeof(KeyFrame); type |= KF_ROT; + if(compressed) + keyFramesCompressed = RwMalloc(sizeof(KeyFrame) * numFrames); + else + keyFrames = RwMalloc(sizeof(KeyFrame) * numFrames); } - keyFrames = RwMalloc(sz * numFrames); this->numFrames = numFrames; } @@ -76,7 +79,7 @@ CAnimBlendSequence::Uncompress(void) float rotScale = 1.0f/4096.0f; float timeScale = 1.0f/60.0f; - float transScale = 1.0f/128.0f; + float transScale = 1.0f/1024.0f; if(type & KF_TRANS){ void *newKfs = RwMalloc(numFrames * sizeof(KeyFrameTrans)); KeyFrameTransCompressed *ckf = (KeyFrameTransCompressed*)keyFramesCompressed; @@ -129,7 +132,7 @@ CAnimBlendSequence::CompressKeyframes(void) float rotScale = 4096.0f; float timeScale = 60.0f; - float transScale = 128.0f; + float transScale = 1024.0f; if(type & KF_TRANS){ void *newKfs = RwMalloc(numFrames * sizeof(KeyFrameTransCompressed)); KeyFrameTransCompressed *ckf = (KeyFrameTransCompressed*)newKfs; @@ -197,4 +200,3 @@ CAnimBlendSequence::MoveMemory(void) return false; } #endif - |