summaryrefslogtreecommitdiffstats
path: root/src/animation
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2020-06-25 15:15:01 +0200
committerGitHub <noreply@github.com>2020-06-25 15:15:01 +0200
commit592a6aef0bb336f1364e6bf38230f3793ec35c4d (patch)
tree3b8df6abb470acc7b9b55d0e8476e1478ba626c0 /src/animation
parentrename attractor flag to type (diff)
parentCWanted, anim fix, ped objs renaming, remove III beta features (diff)
downloadre3-592a6aef0bb336f1364e6bf38230f3793ec35c4d.tar
re3-592a6aef0bb336f1364e6bf38230f3793ec35c4d.tar.gz
re3-592a6aef0bb336f1364e6bf38230f3793ec35c4d.tar.bz2
re3-592a6aef0bb336f1364e6bf38230f3793ec35c4d.tar.lz
re3-592a6aef0bb336f1364e6bf38230f3793ec35c4d.tar.xz
re3-592a6aef0bb336f1364e6bf38230f3793ec35c4d.tar.zst
re3-592a6aef0bb336f1364e6bf38230f3793ec35c4d.zip
Diffstat (limited to 'src/animation')
-rw-r--r--src/animation/AnimBlendHierarchy.cpp4
-rw-r--r--src/animation/AnimBlendNode.cpp4
-rw-r--r--src/animation/AnimManager.cpp5
3 files changed, 6 insertions, 7 deletions
diff --git a/src/animation/AnimBlendHierarchy.cpp b/src/animation/AnimBlendHierarchy.cpp
index 7388352f..d3d6287a 100644
--- a/src/animation/AnimBlendHierarchy.cpp
+++ b/src/animation/AnimBlendHierarchy.cpp
@@ -44,7 +44,7 @@ CAnimBlendHierarchy::CalcTotalTime(void)
#endif
totalLength = Max(totalLength, sequences[i].GetKeyFrame(sequences[i].numFrames-1)->deltaTime);
- for(j = sequences[i].numFrames-1; j > 0; j--){
+ for(j = sequences[i].numFrames-1; j >= 1; j--){
KeyFrame *kf1 = sequences[i].GetKeyFrame(j);
KeyFrame *kf2 = sequences[i].GetKeyFrame(j-1);
kf1->deltaTime -= kf2->deltaTime;
@@ -66,7 +66,7 @@ CAnimBlendHierarchy::CalcTotalTimeCompressed(void)
#endif
totalLength = Max(totalLength, sequences[i].GetKeyFrameCompressed(sequences[i].numFrames-1)->deltaTime/60.0f);
- for(j = sequences[i].numFrames-1; j > 0; j--){
+ for(j = sequences[i].numFrames-1; j >= 1; j--){
KeyFrame *kf1 = sequences[i].GetKeyFrameCompressed(j);
KeyFrame *kf2 = sequences[i].GetKeyFrameCompressed(j-1);
kf1->deltaTime -= kf2->deltaTime;
diff --git a/src/animation/AnimBlendNode.cpp b/src/animation/AnimBlendNode.cpp
index 63665873..c54b5718 100644
--- a/src/animation/AnimBlendNode.cpp
+++ b/src/animation/AnimBlendNode.cpp
@@ -97,10 +97,8 @@ CAnimBlendNode::FindKeyFrame(float t)
if(sequence->numFrames == 1){
remainingTime = 0.0f;
}else{
- frameA++;
-
// advance until t is between frameB and frameA
- while(t > sequence->GetKeyFrame(frameA)->deltaTime){
+ while(t > sequence->GetKeyFrame(++frameA)->deltaTime){
t -= sequence->GetKeyFrame(frameA)->deltaTime;
if(frameA + 1 >= sequence->numFrames){
// reached end of animation
diff --git a/src/animation/AnimManager.cpp b/src/animation/AnimManager.cpp
index 385f1f67..4694920a 100644
--- a/src/animation/AnimManager.cpp
+++ b/src/animation/AnimManager.cpp
@@ -1004,9 +1004,10 @@ CAnimManager::UncompressAnimation(CAnimBlendHierarchy *hier)
}else{
CLink<CAnimBlendHierarchy*> *link = ms_animCache.Insert(hier);
if(link == nil){
- ms_animCache.tail.prev->item->RemoveUncompressedData();
+ CAnimBlendHierarchy *lastHier = ms_animCache.tail.prev->item;
+ lastHier->RemoveUncompressedData();
ms_animCache.Remove(ms_animCache.tail.prev);
- ms_animCache.tail.prev->item->linkPtr = nil;
+ lastHier->linkPtr = nil;
link = ms_animCache.Insert(hier);
}
hier->linkPtr = link;