From 1c2dcad36e6b2d568225884f46f3257b820a73da Mon Sep 17 00:00:00 2001 From: Magnus Norddahl Date: Thu, 20 Oct 2016 15:16:02 +0200 Subject: [PATCH] Fix linear skies --- src/r_plane.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/r_plane.cpp b/src/r_plane.cpp index be8247d26..3ba6feaf7 100644 --- a/src/r_plane.cpp +++ b/src/r_plane.cpp @@ -1098,7 +1098,15 @@ static void R_DrawSkyColumnStripe(int start_x, int y1, int y2, int columns, doub DWORD ang, angle1, angle2; - ang = (skyangle + xtoviewangle[x]) ^ skyflip; + if (r_linearsky) + { + angle_t xangle = (angle_t)((0.5 - x / (double)viewwidth) * FocalTangent * ANGLE_90); + ang = (skyangle + xangle) ^ skyflip; + } + else + { + ang = (skyangle + xtoviewangle[x]) ^ skyflip; + } angle1 = (DWORD)((UMulScale16(ang, frontcyl) + frontpos) >> FRACBITS); angle2 = (DWORD)((UMulScale16(ang, backcyl) + backpos) >> FRACBITS);