From 5f43e5b4ea50df3994da1c72777103d3eaa0831b Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Fri, 20 Feb 2015 22:52:30 -0600 Subject: [PATCH] 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. --- src/r_plane.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/r_plane.cpp b/src/r_plane.cpp index 8c01a1c3e..8cab34230 100644 --- a/src/r_plane.cpp +++ b/src/r_plane.cpp @@ -1512,11 +1512,11 @@ void R_DrawNormalPlane (visplane_t *pl, fixed_t alpha, bool additive, bool maske yscale = pl->yscale << (16 - ds_ybits); if (planeang != 0) { - fixed_t cosine = finecosine[planeang >> ANGLETOFINESHIFT]; - fixed_t sine = finesine[planeang >> ANGLETOFINESHIFT]; + double rad = bam2rad(planeang); + double cosine = cos(rad), sine = sin(rad); - pviewx = pl->xoffs + FixedMul (viewx, cosine) - FixedMul (viewy, sine); - pviewy = pl->yoffs - FixedMul (viewx, sine) - FixedMul (viewy, cosine); + pviewx = xs_RoundToInt(pl->xoffs + viewx * cosine - viewy * sine); + pviewy = xs_RoundToInt(pl->yoffs - viewx * sine - viewy * cosine); } else {