From f64083bda992695a19b3b7c0c987021d776faff8 Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Wed, 29 Jul 2020 06:57:01 +1000 Subject: [PATCH] - backport camera interpolation from DukeGDX. Fixes #63. --- source/games/duke/src/player_d.cpp | 1 + source/games/duke/src/render.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/source/games/duke/src/player_d.cpp b/source/games/duke/src/player_d.cpp index 5d1bef657..90ad8f451 100644 --- a/source/games/duke/src/player_d.cpp +++ b/source/games/duke/src/player_d.cpp @@ -2710,6 +2710,7 @@ void processinput_d(int snum) if (p->newowner >= 0) { i = p->newowner; + hittype[i].tempang = p->getang(); p->posx = sprite[i].x; p->posy = sprite[i].y; p->posz = sprite[i].z; diff --git a/source/games/duke/src/render.cpp b/source/games/duke/src/render.cpp index cdaa34f3d..efd644b2f 100644 --- a/source/games/duke/src/render.cpp +++ b/source/games/duke/src/render.cpp @@ -586,7 +586,7 @@ void displayrooms(int snum, int smoothratio) if (p->newowner >= 0) { - cang = q16ang(p->q16ang + p->q16look_ang); + cang = q16ang((hittype[p->newowner].tempang << FRACBITS) + mulscale16(((p->q16ang + (1024 << FRACBITS) - (hittype[p->newowner].tempang << FRACBITS)) & 0x7FFFFFF) - (1024 << FRACBITS), smoothratio)); choriz = q16horiz(p->q16horiz + p->q16horizoff); cposx = p->posx; cposy = p->posy;