summaryrefslogtreecommitdiffstats
path: root/src/animation
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2020-06-21 14:52:19 +0200
committeraap <aap@papnet.eu>2020-06-21 14:52:19 +0200
commitb81bf1e1389728d42acf8de6128e57fc386d91b8 (patch)
treef6baf48d8f5a310794ab3477246033a8c2dd426c /src/animation
parentsynch with re3 (diff)
parentkilling peds increase chaos level (diff)
downloadre3-b81bf1e1389728d42acf8de6128e57fc386d91b8.tar
re3-b81bf1e1389728d42acf8de6128e57fc386d91b8.tar.gz
re3-b81bf1e1389728d42acf8de6128e57fc386d91b8.tar.bz2
re3-b81bf1e1389728d42acf8de6128e57fc386d91b8.tar.lz
re3-b81bf1e1389728d42acf8de6128e57fc386d91b8.tar.xz
re3-b81bf1e1389728d42acf8de6128e57fc386d91b8.tar.zst
re3-b81bf1e1389728d42acf8de6128e57fc386d91b8.zip
Diffstat (limited to 'src/animation')
-rw-r--r--src/animation/AnimBlendAssociation.cpp7
-rw-r--r--src/animation/AnimBlendNode.cpp6
-rw-r--r--src/animation/AnimManager.cpp5
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;