From 79ec8fbf2949e646310f9eb692d9bd8f85365e79 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Thu, 30 Mar 2017 21:57:36 +0100 Subject: [PATCH] Minor refactor. --- src/r_plane.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/src/r_plane.c b/src/r_plane.c index 534e78c26..8d24c2f7d 100644 --- a/src/r_plane.c +++ b/src/r_plane.c @@ -445,20 +445,18 @@ visplane_t *R_FindPlane(fixed_t height, INT32 picnum, INT32 lightlevel, #ifdef ESLOPE if (slope); else // Don't mess with this right now if a slope is involved #endif - if (plangle != 0) - { - // Add the view offset, rotated by the plane angle. - fixed_t cosinecomponent = FINECOSINE(plangle>>ANGLETOFINESHIFT); - fixed_t sinecomponent = FINESINE(plangle>>ANGLETOFINESHIFT); - fixed_t interxoff = xoff + viewx; - fixed_t interyoff = yoff + viewy; - xoff = FixedMul(interxoff,cosinecomponent)-FixedMul(interyoff,sinecomponent); - yoff = -FixedMul(interxoff,sinecomponent)-FixedMul(interyoff,cosinecomponent); - } - else { xoff += viewx; yoff -= viewy; + if (plangle != 0) + { + // Add the view offset, rotated by the plane angle. + fixed_t cosinecomponent = FINECOSINE(plangle>>ANGLETOFINESHIFT); + fixed_t sinecomponent = FINESINE(plangle>>ANGLETOFINESHIFT); + fixed_t oldxoff = xoff; + xoff = FixedMul(xoff,cosinecomponent)+FixedMul(yoff,sinecomponent); + yoff = -FixedMul(oldxoff,sinecomponent)+FixedMul(yoff,cosinecomponent); + } } // This appears to fix the Nimbus Ruins sky bug.