diff options
author | eray orçunus <erayorcunus@gmail.com> | 2020-06-20 20:26:27 +0300 |
---|---|---|
committer | eray orçunus <erayorcunus@gmail.com> | 2020-06-20 20:26:27 +0300 |
commit | cc60ad1946794bfa8cc8ae86e62829035ff6f360 (patch) | |
tree | 2710ee93888a29547e66887e3977a4fb2f375dc4 /src/animation | |
parent | 2d2833f2e4f038f37cf75025e98476a4f1ad9a13 (diff) |
ducking & anim fix
Diffstat (limited to 'src/animation')
-rw-r--r-- | src/animation/AnimBlendAssociation.cpp | 7 | ||||
-rw-r--r-- | src/animation/AnimBlendNode.cpp | 6 | ||||
-rw-r--r-- | src/animation/AnimManager.cpp | 5 |
3 files changed, 11 insertions, 7 deletions
diff --git a/src/animation/AnimBlendAssociation.cpp b/src/animation/AnimBlendAssociation.cpp index 9a29601b..a6c679eb 100644 --- a/src/animation/AnimBlendAssociation.cpp +++ b/src/animation/AnimBlendAssociation.cpp @@ -133,8 +133,11 @@ CAnimBlendAssociation::SetCurrentTime(float time) int i; for(currentTime = time; currentTime >= hierarchy->totalLength; currentTime -= hierarchy->totalLength) - if(!IsRepeating()) - return; + if (!IsRepeating()) { + currentTime = hierarchy->totalLength; + break; + } + CAnimManager::UncompressAnimation(hierarchy); if(hierarchy->compressed2){ for(i = 0; i < numNodes; i++) diff --git a/src/animation/AnimBlendNode.cpp b/src/animation/AnimBlendNode.cpp index 4186e994..860046e8 100644 --- a/src/animation/AnimBlendNode.cpp +++ b/src/animation/AnimBlendNode.cpp @@ -102,8 +102,8 @@ CAnimBlendNode::FindKeyFrame(float t) // advance until t is between frameB and frameA while(t > sequence->GetKeyFrame(frameA)->deltaTime){ t -= sequence->GetKeyFrame(frameA)->deltaTime; - frameB = frameA++; - if(frameA >= sequence->numFrames){ + frameA++; + if(frameA + 1 >= sequence->numFrames){ // reached end of animation if(!association->IsRepeating()){ CalcDeltas(); @@ -111,8 +111,8 @@ CAnimBlendNode::FindKeyFrame(float t) return false; } frameA = 0; - frameB = 0; } + frameB = frameA; } remainingTime = sequence->GetKeyFrame(frameA)->deltaTime - t; diff --git a/src/animation/AnimManager.cpp b/src/animation/AnimManager.cpp index c2f1c8bc..385f1f67 100644 --- a/src/animation/AnimManager.cpp +++ b/src/animation/AnimManager.cpp @@ -237,14 +237,14 @@ AnimAssocDesc aMeleeAnimDescs[] = { { ANIM_MELEE_ATTACK, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_MELEE_ATTACK_2ND, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_MELEE_ATTACK_START, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_NOWALK }, - { ANIM_WEAPON_CROUCHRELOAD, ASSOC_REPEAT }, // TODO(Miami): Overload that name for melee/swing + { ANIM_MELEE_IDLE_FIGHTMODE, ASSOC_REPEAT }, { ANIM_WEAPON_SPECIAL, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION }, // TODO(Miami): Overload that name for melee/swing }; AnimAssocDesc aSwingAnimDescs[] = { { ANIM_MELEE_ATTACK, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_MELEE_ATTACK_2ND, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_MELEE_ATTACK_START, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, - { ANIM_WEAPON_CROUCHRELOAD, ASSOC_REPEAT }, // TODO(Miami): Overload that name for melee/swing + { ANIM_MELEE_IDLE_FIGHTMODE, ASSOC_REPEAT }, { ANIM_WEAPON_SPECIAL, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, // TODO(Miami): Overload that name for melee/swing }; AnimAssocDesc aWeaponAnimDescs[] = { @@ -1006,6 +1006,7 @@ CAnimManager::UncompressAnimation(CAnimBlendHierarchy *hier) if(link == nil){ ms_animCache.tail.prev->item->RemoveUncompressedData(); ms_animCache.Remove(ms_animCache.tail.prev); + ms_animCache.tail.prev->item->linkPtr = nil; link = ms_animCache.Insert(hier); } hier->linkPtr = link; |