diff options
author | aap <aap@papnet.eu> | 2020-11-16 22:43:15 +0100 |
---|---|---|
committer | aap <aap@papnet.eu> | 2020-11-16 22:43:15 +0100 |
commit | 3564b85b4e354272cea8a8217f9e27827a043d7a (patch) | |
tree | 9b2486481cbd4b226c5430bb8f7f8e61e8a81ce6 /src/animation/AnimBlendHierarchy.cpp | |
parent | 5335b46cbb83e80e88d99f6963670050920e5f3e (diff) |
animation compression from PS2
Diffstat (limited to 'src/animation/AnimBlendHierarchy.cpp')
-rw-r--r-- | src/animation/AnimBlendHierarchy.cpp | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/animation/AnimBlendHierarchy.cpp b/src/animation/AnimBlendHierarchy.cpp index feeaca3d..67b19019 100644 --- a/src/animation/AnimBlendHierarchy.cpp +++ b/src/animation/AnimBlendHierarchy.cpp @@ -30,15 +30,14 @@ void CAnimBlendHierarchy::CalcTotalTime(void) { int i, j; - float totalTime = 0.0f; + totalLength = 0.0f; for(i = 0; i < numSequences; i++){ float seqTime = 0.0f; for(j = 0; j < sequences[i].numFrames; j++) seqTime += sequences[i].GetKeyFrame(j)->deltaTime; - totalTime = Max(totalTime, seqTime); + totalLength = Max(totalLength, seqTime); } - totalLength = totalTime; } void @@ -61,6 +60,12 @@ CAnimBlendHierarchy::RemoveAnimSequences(void) void CAnimBlendHierarchy::Uncompress(void) { +#ifdef ANIM_COMPRESSION + int i; + assert(compressed); + for(i = 0; i < numSequences; i++) + sequences[i].Uncompress(); +#endif if(totalLength == 0.0f) CalcTotalTime(); compressed = 0; @@ -69,6 +74,11 @@ CAnimBlendHierarchy::Uncompress(void) void CAnimBlendHierarchy::RemoveUncompressedData(void) { - // useless +#ifdef ANIM_COMPRESSION + int i; + assert(!compressed); + for(i = 0; i < numSequences; i++) + sequences[i].RemoveUncompressedData(); +#endif compressed = 1; } |