From bd0b7829bb53319ac10fdc7a115a95585ab9f852 Mon Sep 17 00:00:00 2001 From: RedEnchilada Date: Thu, 14 May 2015 10:55:43 -0500 Subject: [PATCH] Fix rotated flats on slopes --- src/r_plane.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/r_plane.c b/src/r_plane.c index c0d26811..c39be11a 100644 --- a/src/r_plane.c +++ b/src/r_plane.c @@ -861,6 +861,9 @@ void R_DrawSinglePlane(visplane_t *pl) } else light = (pl->lightlevel >> LIGHTSEGSHIFT); +#ifdef ESLOPE + if (!pl->slope) // Don't mess with angle on slopes! We'll handle this ourselves later +#endif if (viewangle != pl->viewangle) { memset(cachedheight, 0, sizeof (cachedheight)); @@ -962,10 +965,8 @@ void R_DrawSinglePlane(visplane_t *pl) m.z = FIXED_TO_FLOAT(FINESINE(ang)); // n is the u direction vector in view space - ang += ANGLE_90>>ANGLETOFINESHIFT; - ang &= FINEMASK; - n.x = -FIXED_TO_FLOAT(FINECOSINE(ang)); - n.z = -FIXED_TO_FLOAT(FINESINE(ang)); + n.x = FIXED_TO_FLOAT(FINESINE(ang)); + n.z = -FIXED_TO_FLOAT(FINECOSINE(ang)); ang = pl->plangle>>ANGLETOFINESHIFT; m.y = FIXED_TO_FLOAT(P_GetZAt(pl->slope, viewx + FINESINE(ang), viewy + FINECOSINE(ang))) - zeroheight;