- fix a few remnant ang interpolation issues.

This commit is contained in:
Mitchell Richters 2020-07-24 22:20:04 +10:00
parent d0f839060e
commit 93fae3e43d
2 changed files with 4 additions and 8 deletions

View file

@ -325,9 +325,7 @@ void animatesprites_d(int x,int y,int a,int smoothratio)
t->x = omyx + mulscale16((int)(myx - omyx), smoothratio); t->x = omyx + mulscale16((int)(myx - omyx), smoothratio);
t->y = omyy + mulscale16((int)(myy - omyy), smoothratio); t->y = omyy + mulscale16((int)(myy - omyy), smoothratio);
t->z = omyz + mulscale16((int)(myz - omyz), smoothratio) + (40 << 8); t->z = omyz + mulscale16((int)(myz - omyz), smoothratio) + (40 << 8);
int omyang = fix16_to_int(oq16myang); t->ang = (oq16myang + mulscale16((int)(((q16myang + (1024 << FRACBITS) - oq16myang) & 0x7FFFFFF) - (1024 << FRACBITS)), smoothratio)) >> FRACBITS;
int myang = fix16_to_int(q16myang);
t->ang = omyang + mulscale16((int)(((myang + 1024 - omyang) & 2047) - 1024), smoothratio);
t->sectnum = mycursectnum; t->sectnum = mycursectnum;
} }
} }

View file

@ -306,22 +306,20 @@ void displayrest(int smoothratio)
{ {
cposx = omyx + mulscale16(myx - omyx, smoothratio); cposx = omyx + mulscale16(myx - omyx, smoothratio);
cposy = omyy + mulscale16(myy - omyy, smoothratio); cposy = omyy + mulscale16(myy - omyy, smoothratio);
int omyang = fix16_to_int(oq16myang); cang = (oq16myang + mulscale16(((q16myang + (1024 << FRACBITS) - oq16myang) & 0x7FFFFFF) - (1024 << FRACBITS), smoothratio)) >> FRACBITS;
int myang = fix16_to_int(q16myang);
cang = fix16_to_int(omyang) + mulscale16((fix16_to_int(myang + F16(1024) - omyang) & 2047) - 1024, smoothratio);
} }
else else
{ {
cposx = pp->oposx + mulscale16(pp->posx - pp->oposx, smoothratio); cposx = pp->oposx + mulscale16(pp->posx - pp->oposx, smoothratio);
cposy = pp->oposy + mulscale16(pp->posy - pp->oposy, 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 else
{ {
cposx = pp->oposx; cposx = pp->oposx;
cposy = pp->oposy; cposy = pp->oposy;
cang = fix16_to_int(pp->oq16ang); cang = pp->getoang();
} }
} }
else else