summaryrefslogtreecommitdiffstats
path: root/src/control
diff options
context:
space:
mode:
authorNikolay Korolev <nickvnuk@gmail.com>2019-06-29 14:19:31 +0200
committerNikolay Korolev <nickvnuk@gmail.com>2019-06-29 14:19:31 +0200
commit62cfcd5b2709e926d4a53b20bbc366ab5bb5b5ff (patch)
tree10c2d49b33c423dee1d87d7be0f9d98e1f16e05c /src/control
parentProcessPedUpdate (diff)
downloadre3-62cfcd5b2709e926d4a53b20bbc366ab5bb5b5ff.tar
re3-62cfcd5b2709e926d4a53b20bbc366ab5bb5b5ff.tar.gz
re3-62cfcd5b2709e926d4a53b20bbc366ab5bb5b5ff.tar.bz2
re3-62cfcd5b2709e926d4a53b20bbc366ab5bb5b5ff.tar.lz
re3-62cfcd5b2709e926d4a53b20bbc366ab5bb5b5ff.tar.xz
re3-62cfcd5b2709e926d4a53b20bbc366ab5bb5b5ff.tar.zst
re3-62cfcd5b2709e926d4a53b20bbc366ab5bb5b5ff.zip
Diffstat (limited to 'src/control')
-rw-r--r--src/control/Replay.cpp41
1 files changed, 41 insertions, 0 deletions
diff --git a/src/control/Replay.cpp b/src/control/Replay.cpp
index a2a47295..25fab615 100644
--- a/src/control/Replay.cpp
+++ b/src/control/Replay.cpp
@@ -444,7 +444,48 @@ void CReplay::ProcessPedUpdate(CPed *ped, float interpolation, CAddressInReplayB
buffer->m_nOffset += sizeof(tPedUpdatePacket);
}
#endif
+
+#if 0
WRAPPER void CReplay::RetrievePedAnimation(CPed *ped, CStoredAnimationState *state) { EAXJMP(0x5942A0); }
+#else
+void CReplay::RetrievePedAnimation(CPed *ped, CStoredAnimationState *state)
+{
+ CAnimBlendAssociation* anim1 = CAnimManager::BlendAnimation(
+ (RpClump*)ped->m_rwObject,
+ (state->animId > 3) ? ped->m_animGroup : ASSOCGRP_STD,
+ (AnimationId)state->animId, 100.0f);
+ anim1->SetCurrentTime(state->time * 4.0f / 255.0f);
+ anim1->speed = state->speed * 3.0f / 255.0f;
+ anim1->SetBlend(1.0f, 1.0f);
+ anim1->callbackType = CAnimBlendAssociation::CB_NONE;
+ if (state->blendAmount && state->secAnimId){
+ float time = state->secTime * 4.0f / 255.0f;
+ float speed = state->secSpeed * 3.0f / 255.0f;
+ float blend = state->blendAmount * 2.0f / 255.0f;
+ CAnimBlendAssociation* anim2 = CAnimManager::BlendAnimation(
+ (RpClump*)ped->m_rwObject,
+ (state->secAnimId > 3) ? ped->m_animGroup : ASSOCGRP_STD,
+ (AnimationId)state->secAnimId, 100.0f);
+ anim2->SetCurrentTime(time);
+ anim2->speed = speed;
+ anim2->SetBlend(blend, 1.0f);
+ anim2->callbackType = CAnimBlendAssociation::CB_NONE;
+ }
+ RpAnimBlendClumpRemoveAssociations((RpClump*)ped->m_rwObject, 0x10);
+ if (state->partAnimId){
+ float time = state->partAnimTime * 4.0f / 255.0f;
+ float speed = state->partAnimSpeed * 3.0f / 255.0f;
+ float blend = state->partBlendAmount * 2.0f / 255.0f;
+ if (blend > 0.0f && state->partAnimId != ANIM_IDLE_STANCE){
+ CAnimBlendAssociation* anim3 = CAnimManager::BlendAnimation(
+ (RpClump*)ped->m_rwObject, ASSOCGRP_STD, (AnimationId)state->partAnimId, 1000.0f);
+ anim3->SetCurrentTime(time);
+ anim3->speed = speed;
+ anim3->blendDelta = 0.0f; // is it correct?
+ }
+ }
+}
+#endif
WRAPPER void CReplay::RetrieveDetailedPedAnimation(CPed *ped, CStoredDetailedAnimationState *state) { EAXJMP(0x5944B0); }
WRAPPER void CReplay::PlaybackThisFrame(void) { EAXJMP(0x5946B0); }