From 4551052174bbfcf9aca5690eee7ed93547d31057 Mon Sep 17 00:00:00 2001 From: Magnus Norddahl Date: Thu, 22 Dec 2016 03:02:58 +0100 Subject: [PATCH] Fix dynamic light calculations to be unaffected by wall clipping --- src/r_walldraw.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/r_walldraw.cpp b/src/r_walldraw.cpp index 8645477a37..ad73c1fa58 100644 --- a/src/r_walldraw.cpp +++ b/src/r_walldraw.cpp @@ -545,10 +545,8 @@ static void Draw1Column(int x, int y1, int y2, WallSampler &sampler, void(*draw1 float t = (x - WallC.sx1 + 0.5f) / (WallC.sx2 - WallC.sx1); float wcol = w1 * (1.0f - t) + w2 * t; float zcol = 1.0f / wcol; - float xcol = (WallC.tleft.X * w1 * (1.0f - t) + WallC.tright.X * w2 * t) * zcol; - float ycol = (WallC.tleft.Y * w1 * (1.0f - t) + WallC.tright.Y * w2 * t) * zcol; - dc_viewpos.X = xcol; - dc_viewpos.Y = ycol; + dc_viewpos.X = (float)((x + 0.5 - CenterX) / CenterX * zcol); + dc_viewpos.Y = zcol; dc_viewpos.Z = (float)((CenterY - y1 - 0.5) / InvZtoScale * zcol); dc_viewpos_step.Z = (float)(-zcol / InvZtoScale);