From 93fae3e43dc0e1e16d608a2579b4f5aec4eb74b7 Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Fri, 24 Jul 2020 22:20:04 +1000 Subject: [PATCH] - fix a few remnant ang interpolation issues. --- source/games/duke/src/animatesprites_d.cpp | 4 +--- source/games/duke/src/game_misc.cpp | 8 +++----- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/source/games/duke/src/animatesprites_d.cpp b/source/games/duke/src/animatesprites_d.cpp index acae1515f..d3e979a18 100644 --- a/source/games/duke/src/animatesprites_d.cpp +++ b/source/games/duke/src/animatesprites_d.cpp @@ -325,9 +325,7 @@ void animatesprites_d(int x,int y,int a,int smoothratio) t->x = omyx + mulscale16((int)(myx - omyx), smoothratio); t->y = omyy + mulscale16((int)(myy - omyy), smoothratio); t->z = omyz + mulscale16((int)(myz - omyz), smoothratio) + (40 << 8); - int omyang = fix16_to_int(oq16myang); - int myang = fix16_to_int(q16myang); - t->ang = omyang + mulscale16((int)(((myang + 1024 - omyang) & 2047) - 1024), smoothratio); + t->ang = (oq16myang + mulscale16((int)(((q16myang + (1024 << FRACBITS) - oq16myang) & 0x7FFFFFF) - (1024 << FRACBITS)), smoothratio)) >> FRACBITS; t->sectnum = mycursectnum; } } diff --git a/source/games/duke/src/game_misc.cpp b/source/games/duke/src/game_misc.cpp index 927153290..32122ebba 100644 --- a/source/games/duke/src/game_misc.cpp +++ b/source/games/duke/src/game_misc.cpp @@ -306,22 +306,20 @@ void displayrest(int smoothratio) { cposx = omyx + mulscale16(myx - omyx, smoothratio); cposy = omyy + mulscale16(myy - omyy, smoothratio); - int omyang = fix16_to_int(oq16myang); - int myang = fix16_to_int(q16myang); - cang = fix16_to_int(omyang) + mulscale16((fix16_to_int(myang + F16(1024) - omyang) & 2047) - 1024, smoothratio); + cang = (oq16myang + mulscale16(((q16myang + (1024 << FRACBITS) - oq16myang) & 0x7FFFFFF) - (1024 << FRACBITS), smoothratio)) >> FRACBITS; } else { cposx = pp->oposx + mulscale16(pp->posx - pp->oposx, smoothratio); cposy = pp->oposy + mulscale16(pp->posy - pp->oposy, smoothratio); - cang = pp->getang();// + mulscale16((fix16_to_int(pp->q16ang+F16(1024)-pp->oq16ang)&2047)-1024, smoothratio); + cang = pp->getoang() + mulscale16(((pp->getang() + 1024 - pp->getoang()) & 2047) - 1024, smoothratio); } } else { cposx = pp->oposx; cposy = pp->oposy; - cang = fix16_to_int(pp->oq16ang); + cang = pp->getoang(); } } else