- SW: Make a bit more use of the calculated smooth ratio.

This commit is contained in:
Mitchell Richters 2020-08-25 22:13:02 +10:00 committed by Christoph Oelckers
parent 386661f1ba
commit c888bc802d

View file

@ -1695,21 +1695,21 @@ drawscreen(PLAYERp pp, double smoothratio)
else else
camerapp = pp; camerapp = pp;
tx = camerapp->oposx + mulscale16(camerapp->posx - camerapp->oposx, smoothratio); tx = camerapp->oposx + xs_CRoundToInt(fmulscale16(camerapp->posx - camerapp->oposx, smoothratio));
ty = camerapp->oposy + mulscale16(camerapp->posy - camerapp->oposy, smoothratio); ty = camerapp->oposy + xs_CRoundToInt(fmulscale16(camerapp->posy - camerapp->oposy, smoothratio));
tz = camerapp->oposz + mulscale16(camerapp->posz - camerapp->oposz, smoothratio); tz = camerapp->oposz + xs_CRoundToInt(fmulscale16(camerapp->posz - camerapp->oposz, smoothratio));
// TODO: It'd be better to check pp->input.q16angvel instead, problem is that // TODO: It'd be better to check pp->input.q16angvel instead, problem is that
// it's been repurposed for the q16ang diff while tying input to framerate // it's been repurposed for the q16ang diff while tying input to framerate
if (PedanticMode || (pp != Player+myconnectindex) || if (PedanticMode || (pp != Player+myconnectindex) ||
(TEST(pp->Flags, PF_DEAD) && (loc.q16angvel == 0))) (TEST(pp->Flags, PF_DEAD) && (loc.q16angvel == 0)))
{ {
tq16ang = camerapp->oq16ang + mulscale16(NORM_Q16ANGLE(camerapp->q16ang + fix16_from_int(1024) - camerapp->oq16ang) - fix16_from_int(1024), smoothratio); tq16ang = camerapp->oq16ang + xs_CRoundToInt(fmulscale16(NORM_Q16ANGLE(camerapp->q16ang + fix16_from_int(1024) - camerapp->oq16ang) - fix16_from_int(1024), smoothratio));
tq16horiz = camerapp->oq16horiz + mulscale16(camerapp->q16horiz - camerapp->oq16horiz, smoothratio); tq16horiz = camerapp->oq16horiz + xs_CRoundToInt(fmulscale16(camerapp->q16horiz - camerapp->oq16horiz, smoothratio));
} }
else if (cl_sointerpolation && !CommEnabled) else if (cl_sointerpolation && !CommEnabled)
{ {
tq16ang = camerapp->oq16ang + mulscale16(((pp->camq16ang + fix16_from_int(1024) - camerapp->oq16ang) & 0x7FFFFFF) - fix16_from_int(1024), smoothratio); tq16ang = camerapp->oq16ang + xs_CRoundToInt(fmulscale16(((pp->camq16ang + fix16_from_int(1024) - camerapp->oq16ang) & 0x7FFFFFF) - fix16_from_int(1024), smoothratio));
tq16horiz = camerapp->oq16horiz + mulscale16(pp->camq16horiz - camerapp->oq16horiz, smoothratio); tq16horiz = camerapp->oq16horiz + xs_CRoundToInt(fmulscale16(pp->camq16horiz - camerapp->oq16horiz, smoothratio));
} }
else else
{ {
@ -1782,7 +1782,7 @@ drawscreen(PLAYERp pp, double smoothratio)
{ {
tz += bob_amt; tz += bob_amt;
tz += PedanticMode ? camerapp->bob_z : tz += PedanticMode ? camerapp->bob_z :
pp->obob_z + mulscale16(pp->bob_z - pp->obob_z, smoothratio); pp->obob_z + xs_CRoundToInt(fmulscale16(pp->bob_z - pp->obob_z, smoothratio));
// recoil only when not in camera // recoil only when not in camera
tq16horiz = tq16horiz + fix16_from_int(pp->recoil_horizoff); tq16horiz = tq16horiz + fix16_from_int(pp->recoil_horizoff);