diff options
Diffstat (limited to 'src/animation/AnimBlendSequence.cpp')
-rw-r--r-- | src/animation/AnimBlendSequence.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/animation/AnimBlendSequence.cpp b/src/animation/AnimBlendSequence.cpp index 2ae150c1..36ac9495 100644 --- a/src/animation/AnimBlendSequence.cpp +++ b/src/animation/AnimBlendSequence.cpp @@ -9,9 +9,7 @@ CAnimBlendSequence::CAnimBlendSequence(void) numFrames = 0; keyFrames = nil; keyFramesCompressed = nil; -#ifdef PED_SKIN boneTag = -1; -#endif } CAnimBlendSequence::~CAnimBlendSequence(void) @@ -29,18 +27,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 +77,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 +130,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 +198,3 @@ CAnimBlendSequence::MoveMemory(void) return false; } #endif - |