From c888bc802deb80dcb4695360872d2656a87627ce Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Tue, 25 Aug 2020 22:13:02 +1000 Subject: [PATCH] - SW: Make a bit more use of the calculated smooth ratio. --- source/sw/src/draw.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/source/sw/src/draw.cpp b/source/sw/src/draw.cpp index be3f00c08..8749dc56f 100644 --- a/source/sw/src/draw.cpp +++ b/source/sw/src/draw.cpp @@ -1695,21 +1695,21 @@ drawscreen(PLAYERp pp, double smoothratio) else camerapp = pp; - tx = camerapp->oposx + mulscale16(camerapp->posx - camerapp->oposx, smoothratio); - ty = camerapp->oposy + mulscale16(camerapp->posy - camerapp->oposy, smoothratio); - tz = camerapp->oposz + mulscale16(camerapp->posz - camerapp->oposz, smoothratio); + tx = camerapp->oposx + xs_CRoundToInt(fmulscale16(camerapp->posx - camerapp->oposx, smoothratio)); + ty = camerapp->oposy + xs_CRoundToInt(fmulscale16(camerapp->posy - camerapp->oposy, 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 // it's been repurposed for the q16ang diff while tying input to framerate if (PedanticMode || (pp != Player+myconnectindex) || (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); - tq16horiz = camerapp->oq16horiz + mulscale16(camerapp->q16horiz - camerapp->oq16horiz, 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 + xs_CRoundToInt(fmulscale16(camerapp->q16horiz - camerapp->oq16horiz, smoothratio)); } else if (cl_sointerpolation && !CommEnabled) { - tq16ang = camerapp->oq16ang + mulscale16(((pp->camq16ang + fix16_from_int(1024) - camerapp->oq16ang) & 0x7FFFFFF) - fix16_from_int(1024), smoothratio); - tq16horiz = camerapp->oq16horiz + mulscale16(pp->camq16horiz - camerapp->oq16horiz, smoothratio); + tq16ang = camerapp->oq16ang + xs_CRoundToInt(fmulscale16(((pp->camq16ang + fix16_from_int(1024) - camerapp->oq16ang) & 0x7FFFFFF) - fix16_from_int(1024), smoothratio)); + tq16horiz = camerapp->oq16horiz + xs_CRoundToInt(fmulscale16(pp->camq16horiz - camerapp->oq16horiz, smoothratio)); } else { @@ -1782,7 +1782,7 @@ drawscreen(PLAYERp pp, double smoothratio) { tz += bob_amt; 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 tq16horiz = tq16horiz + fix16_from_int(pp->recoil_horizoff);