From 561fc2d01a79730f98c4752d4cd023aa76170551 Mon Sep 17 00:00:00 2001 From: Alug Date: Wed, 10 Jul 2024 18:43:20 +0200 Subject: [PATCH] only interpolate pitch and roll when using 3d models sprites dont need this for now --- src/r_fps.c | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/src/r_fps.c b/src/r_fps.c index e6834ce4b..f360f301b 100644 --- a/src/r_fps.c +++ b/src/r_fps.c @@ -23,6 +23,7 @@ #include "r_state.h" #include "z_zone.h" #include "console.h" // con_startup_loadprogress + #ifdef HWRENDER #include "hardware/hw_main.h" // for cv_grshearing #endif @@ -340,19 +341,29 @@ void R_InterpolateMobjState(mobj_t *mobj, fixed_t frac, interpmobjstate_t *out) out->angle = mobj->resetinterp ? mobj->angle : R_LerpAngle(mobj->old_angle, mobj->angle, frac); } - // pitch roll stuff - IFCHANGED(pitch, old_pitch) - out->pitch = mobj->resetinterp ? mobj->pitch : R_LerpAngle(mobj->old_pitch, mobj->pitch, frac); + if (cv_grmdls.value) + { + // pitch roll stuff + IFCHANGED(pitch, old_pitch) + out->pitch = mobj->resetinterp ? mobj->pitch : R_LerpAngle(mobj->old_pitch, mobj->pitch, frac); - IFCHANGED(roll, old_roll) - out->roll = mobj->resetinterp ? mobj->roll : R_LerpAngle(mobj->old_roll, mobj->roll, frac); + IFCHANGED(roll, old_roll) + out->roll = mobj->resetinterp ? mobj->roll : R_LerpAngle(mobj->old_roll, mobj->roll, frac); - // and the slope stuff - IFCHANGED(slopepitch, old_slopepitch) - out->slopepitch = mobj->resetinterp ? mobj->slopepitch : R_LerpAngle(mobj->old_slopepitch, mobj->slopepitch, frac); + // and the slope stuff + IFCHANGED(slopepitch, old_slopepitch) + out->slopepitch = mobj->resetinterp ? mobj->slopepitch : R_LerpAngle(mobj->old_slopepitch, mobj->slopepitch, frac); - IFCHANGED(sloperoll, old_sloperoll) - out->sloperoll = mobj->resetinterp ? mobj->sloperoll : R_LerpAngle(mobj->old_sloperoll, mobj->sloperoll, frac); + IFCHANGED(sloperoll, old_sloperoll) + out->sloperoll = mobj->resetinterp ? mobj->sloperoll : R_LerpAngle(mobj->old_sloperoll, mobj->sloperoll, frac); + } + else + { + out->pitch = mobj->pitch; + out->roll = mobj->roll; + out->slopepitch = mobj->slopepitch; + out->sloperoll = mobj->sloperoll; + } } void R_InterpolatePrecipMobjState(precipmobj_t *mobj, fixed_t frac, interpmobjstate_t *out)