Don't use finesine table when offseting for plane rotation

- This table isn't precise enough, so the result is noticeably off if
  you're far enough from the origin.
This commit is contained in:
Randy Heit 2015-02-20 22:52:30 -06:00
parent a5f8c4ead2
commit 5f43e5b4ea

View file

@ -1512,11 +1512,11 @@ void R_DrawNormalPlane (visplane_t *pl, fixed_t alpha, bool additive, bool maske
yscale = pl->yscale << (16 - ds_ybits); yscale = pl->yscale << (16 - ds_ybits);
if (planeang != 0) if (planeang != 0)
{ {
fixed_t cosine = finecosine[planeang >> ANGLETOFINESHIFT]; double rad = bam2rad(planeang);
fixed_t sine = finesine[planeang >> ANGLETOFINESHIFT]; double cosine = cos(rad), sine = sin(rad);
pviewx = pl->xoffs + FixedMul (viewx, cosine) - FixedMul (viewy, sine); pviewx = xs_RoundToInt(pl->xoffs + viewx * cosine - viewy * sine);
pviewy = pl->yoffs - FixedMul (viewx, sine) - FixedMul (viewy, cosine); pviewy = xs_RoundToInt(pl->yoffs - viewx * sine - viewy * cosine);
} }
else else
{ {