From 6570366a97db0d842fda4759b84b0bcf421ecb25 Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Wed, 9 Sep 2020 20:31:07 +1000 Subject: [PATCH] - Duke: Fix camera interpolations following uplift in 9615308fb3e3c5319843d373629144dde6a69e7e. --- source/games/duke/src/render.cpp | 21 +++++++-------------- source/games/duke/src/types.h | 2 +- 2 files changed, 8 insertions(+), 15 deletions(-) diff --git a/source/games/duke/src/render.cpp b/source/games/duke/src/render.cpp index 1f0e90bb7..f455fa8c5 100644 --- a/source/games/duke/src/render.cpp +++ b/source/games/duke/src/render.cpp @@ -581,26 +581,20 @@ void displayrooms(int snum, double smoothratio) if (p->newowner >= 0) { - fixed_t a = IntToFixed(sprite[p->newowner].ang); + fixed_t& oang = hittype[p->newowner].oq16ang; + fixed_t& ang = p->q16ang; + if (p->newowner != p->oldowner) { + oang = ang = IntToFixed(sprite[p->newowner].ang); + cang = q16ang(ang); p->oldowner = p->newowner; - hittype[p->newowner].oq16ang = a; - cang = q16ang(a); - p->camchangecnt = 3; - } - else if (p->camchangecnt > 0) - { - hittype[p->newowner].oq16ang = a; - cang = q16ang(a); - p->camchangecnt--; } else { - fixed_t oang = hittype[p->newowner].oq16ang; - cang = q16ang(oang + xs_CRoundToInt(fmulscale16(((a + dang - oang) & 0x7FFFFFF) - dang, smoothratio))); + cang = q16ang(oang + xs_CRoundToInt(fmulscale16(((ang + dang - oang) & 0x7FFFFFF) - dang, smoothratio))); } - cang = q16ang(a); + choriz = q16horiz(p->q16horiz + p->q16horizoff); cposx = sprite[p->newowner].pos.x; cposy = sprite[p->newowner].pos.y; @@ -610,7 +604,6 @@ void displayrooms(int snum, double smoothratio) } else if (p->over_shoulder_on == 0) { - p->camchangecnt = 0; p->oldowner = -1; if (cl_viewbob) cposz += p->opyoff + xs_CRoundToInt(fmulscale16(p->pyoff - p->opyoff, smoothratio)); } diff --git a/source/games/duke/src/types.h b/source/games/duke/src/types.h index 34b4bc265..8e2226308 100644 --- a/source/games/duke/src/types.h +++ b/source/games/duke/src/types.h @@ -137,7 +137,7 @@ struct player_struct short ammo_amount[MAX_WEAPONS], wackedbyactor, frag, fraggedself; short curr_weapon, last_weapon, tipincs, wantweaponfire; - short holoduke_amount, newowner, oldowner, camchangecnt, hurt_delay, hbomb_hold_delay; + short holoduke_amount, newowner, oldowner, hurt_delay, hbomb_hold_delay; short jumping_counter, airleft, knee_incs, access_incs; short ftq, access_wallnum, access_spritenum; short got_access, weapon_ang, firstaid_amount;