From 9fe3af370b89f2cacbf28e4459111c4263bc143b Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Sat, 25 Jul 2020 15:29:10 +1000 Subject: [PATCH] - call `renderSetRollAngle()` with full precision for Duke. --- source/games/duke/src/render.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/source/games/duke/src/render.cpp b/source/games/duke/src/render.cpp index 9756673da..71c10cbaa 100644 --- a/source/games/duke/src/render.cpp +++ b/source/games/duke/src/render.cpp @@ -537,12 +537,10 @@ void displayrooms(int snum, int smoothratio) } if (!synchronized_input) - renderSetRollAngle(p->getrotscrnang()); + renderSetRollAngle(p->q16rotscrnang / (float)(FRACUNIT)); else { - // The fixed point fuckery at play here means we cannot do the interpolation at full precision. - auto oa = p->oq16rotscrnang >> FRACBITS; - renderSetRollAngle(oa + mulscale16(((p->getrotscrnang() - oa + 1024) & 2047) - 1024, smoothratio)); + renderSetRollAngle((p->oq16rotscrnang + mulscale16(((p->q16rotscrnang - p->oq16rotscrnang + (1024 << FRACBITS)) & 0x7FFFFFF) - (1024 << FRACBITS), smoothratio)) / (float)(FRACUNIT)); p->oq16rotscrnang = p->q16rotscrnang; // JBF: save it for next time }