From 2eee4c51764d0d73986f2aae64fbaf4c0beeb9c1 Mon Sep 17 00:00:00 2001 From: aap Date: Fri, 8 May 2020 15:59:57 +0200 Subject: most of animation system done; little stuff here and there --- src/animation/AnimBlendSequence.cpp | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'src/animation/AnimBlendSequence.cpp') diff --git a/src/animation/AnimBlendSequence.cpp b/src/animation/AnimBlendSequence.cpp index 4578ec50..b04d6b41 100644 --- a/src/animation/AnimBlendSequence.cpp +++ b/src/animation/AnimBlendSequence.cpp @@ -2,6 +2,8 @@ #include "AnimBlendSequence.h" +//--MIAMI: file done + CAnimBlendSequence::CAnimBlendSequence(void) { type = 0; @@ -17,6 +19,8 @@ CAnimBlendSequence::~CAnimBlendSequence(void) { if(keyFrames) RwFree(keyFrames); + if(keyFramesCompressed) + RwFree(keyFramesCompressed); } void @@ -26,18 +30,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; } -- cgit v1.2.3