summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNikolay Korolev <nickvnuk@gmail.com>2019-06-29 20:38:47 +0200
committerNikolay Korolev <nickvnuk@gmail.com>2019-06-29 20:38:47 +0200
commit647db5cf3414e352e8565040f144782183cf47c8 (patch)
tree60507a8bec6311ad779a97a315c73451a25eec4a /src
parentfix (diff)
downloadre3-647db5cf3414e352e8565040f144782183cf47c8.tar
re3-647db5cf3414e352e8565040f144782183cf47c8.tar.gz
re3-647db5cf3414e352e8565040f144782183cf47c8.tar.bz2
re3-647db5cf3414e352e8565040f144782183cf47c8.tar.lz
re3-647db5cf3414e352e8565040f144782183cf47c8.tar.xz
re3-647db5cf3414e352e8565040f144782183cf47c8.tar.zst
re3-647db5cf3414e352e8565040f144782183cf47c8.zip
Diffstat (limited to '')
-rw-r--r--src/control/Replay.cpp40
-rw-r--r--src/control/Replay.h3
-rw-r--r--src/entities/Ped.cpp2
3 files changed, 38 insertions, 7 deletions
diff --git a/src/control/Replay.cpp b/src/control/Replay.cpp
index e80d8746..f3435ece 100644
--- a/src/control/Replay.cpp
+++ b/src/control/Replay.cpp
@@ -83,10 +83,8 @@ float &CReplay::LoadSceneX = *(float*)0x880F9C;
float &CReplay::LoadSceneY = *(float*)0x880F98;
float &CReplay::LoadSceneZ = *(float*)0x880F94;
-#if 1
static void(*(&CBArray)[30])(CAnimBlendAssociation*, void*) = *(void(*(*)[30])(CAnimBlendAssociation*, void*))*(uintptr*)0x61052C;
-#else
-static void(*CBArray[])(CAnimBlendAssociation*, void*) =
+static void(*CBArray_RE3[])(CAnimBlendAssociation*, void*) =
{
nil, &CPed::PedGetupCB, &CPed::PedStaggerCB, &CPed::PedEvadeCB, &CPed::FinishDieAnimCB,
&CPed::FinishedWaitCB, &CPed::FinishLaunchCB, &CPed::FinishHitHeadCB, &CPed::PedAnimGetInCB, &CPed::PedAnimDoorOpenCB,
@@ -95,7 +93,6 @@ static void(*CBArray[])(CAnimBlendAssociation*, void*) =
&CPed::FinishFightMoveCB, &PhonePutDownCB, &PhonePickUpCB, &CPed::PedAnimDoorCloseRollingCB, &CPed::FinishJumpCB,
&CPed::PedLandCB, &FinishFuckUCB, &CPed::RestoreHeadingRateCB, &CPed::PedSetQuickDraggedOutCarPositionCB, &CPed::PedSetDraggedOutCarPositionCB
};
-#endif
#if 0
WRAPPER uint8 FindCBFunctionID(void(*f)(CAnimBlendAssociation*, void*)) { EAXJMP(0x584E70); }
@@ -106,13 +103,17 @@ static uint8 FindCBFunctionID(void(*f)(CAnimBlendAssociation*, void*))
if (CBArray[i] == f)
return i;
}
+ for (int i = 0; i < sizeof(CBArray_RE3) / sizeof(*CBArray_RE3); i++) {
+ if (CBArray_RE3[i] == f)
+ return i;
+ }
return 0;
}
#endif
static void(*FindCBFunction(uint8 id))(CAnimBlendAssociation*, void*)
{
- return CBArray[id];
+ return CBArray_RE3[id];
}
WRAPPER static void ApplyPanelDamageToCar(uint32, CAutomobile*, bool) { EAXJMP(0x584EA0); }
@@ -533,7 +534,35 @@ void CReplay::RetrieveDetailedPedAnimation(CPed *ped, CStoredDetailedAnimationSt
}
}
#endif
+
+#if 0
WRAPPER void CReplay::PlaybackThisFrame(void) { EAXJMP(0x5946B0); }
+#else
+void CReplay::PlaybackThisFrame(void)
+{
+ static int SlowMotionCounter = 0;
+ CAddressInReplayBuffer buf = Playback;
+ if (PlayBackThisFrameInterpolation(&buf, 1.0f, nil)){
+ DMAudio.SetEffectsFadeVol(127);
+ DMAudio.SetMusicFadeVol(127);
+ return;
+ }
+ if (SlowMotionCounter){
+ CAddressInReplayBuffer buf_sm = buf;
+ if (PlayBackThisFrameInterpolation(&buf_sm, SlowMotionCounter * 1.0f / SlowMotion, nil)){
+ DMAudio.SetEffectsFadeVol(127);
+ DMAudio.SetMusicFadeVol(127);
+ return;
+ }
+ }
+ SlowMotionCounter = (SlowMotionCounter + 1) % SlowMotion;
+ if (SlowMotionCounter == 0)
+ Playback = buf;
+ ProcessLookAroundCam();
+ DMAudio.SetEffectsFadeVol(0);
+ DMAudio.SetMusicFadeVol(0);
+}
+#endif
#if 0
WRAPPER void CReplay::StoreCarUpdate(CVehicle *vehicle, int id) { EAXJMP(0x5947F0); }
@@ -883,6 +912,7 @@ InjectHook(0x593150, CReplay::DisableReplays, PATCH_JUMP);
InjectHook(0x593160, CReplay::EnableReplays, PATCH_JUMP);
InjectHook(0x593170, CReplay::Update, PATCH_JUMP);
InjectHook(0x594050, CReplay::ProcessPedUpdate, PATCH_JUMP);
+InjectHook(0x593BB0, CReplay::StoreDetailedPedAnimation, PATCH_JUMP);
InjectHook(0x5944B0, CReplay::RetrieveDetailedPedAnimation, PATCH_JUMP);
//InjectHook(0x5966E0, CReplay::RestoreStuffFromMem, PATCH_JUMP);
ENDPATCHES
diff --git a/src/control/Replay.h b/src/control/Replay.h
index 125dfef4..0448a829 100644
--- a/src/control/Replay.h
+++ b/src/control/Replay.h
@@ -261,8 +261,9 @@ private:
static void RecordThisFrame(void);
static void StorePedUpdate(CPed *ped, int id);
static void StorePedAnimation(CPed *ped, CStoredAnimationState *state);
- static void StoreDetailedPedAnimation(CPed *ped, CStoredDetailedAnimationState *state);
public:
+ static void StoreDetailedPedAnimation(CPed *ped, CStoredDetailedAnimationState *state);
+
static void ProcessPedUpdate(CPed *ped, float interpolation, CAddressInReplayBuffer *buffer);
static void RetrievePedAnimation(CPed *ped, CStoredAnimationState *state);
static void RetrieveDetailedPedAnimation(CPed *ped, CStoredDetailedAnimationState *state);
diff --git a/src/entities/Ped.cpp b/src/entities/Ped.cpp
index 7f83ea84..04157f4e 100644
--- a/src/entities/Ped.cpp
+++ b/src/entities/Ped.cpp
@@ -1621,7 +1621,7 @@ WRAPPER void CPed::FinishFightMoveCB(CAnimBlendAssociation *assoc, void *arg) {
WRAPPER void CPed::PedAnimDoorCloseRollingCB(CAnimBlendAssociation *assoc, void *arg) { EAXJMP(0x4E4B90); }
WRAPPER void CPed::FinishJumpCB(CAnimBlendAssociation *assoc, void *arg) { EAXJMP(0x4D7A50); }
WRAPPER void CPed::PedLandCB(CAnimBlendAssociation *assoc, void *arg) { EAXJMP(0x4CE8A0); }
-WRAPPER void FinishFuckUCB(CAnimBlendAssociation *assoc, void *arg) { EAXJMP(0x4C6620); }
+WRAPPER void FinishFuckUCB(CAnimBlendAssociation *assoc, void *arg) { EAXJMP(0x4C6580); }
WRAPPER void CPed::RestoreHeadingRateCB(CAnimBlendAssociation *assoc, void *arg) { EAXJMP(0x4D6550); }
STARTPATCHES