From 08bf08f297ae42395dce30a44bf50c4769104e8f Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Tue, 14 Feb 2017 12:33:27 +0200 Subject: [PATCH] Restored effect of negative horizontal texture scale in software renderer --- src/r_segs.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/r_segs.cpp b/src/r_segs.cpp index ccf6ccf20..0873cb373 100644 --- a/src/r_segs.cpp +++ b/src/r_segs.cpp @@ -2046,11 +2046,11 @@ void PrepWall(float *vstep, fixed_t *upos, double walxrepeat, int x1, int x2) float invZ = WallT.InvZorg + WallT.InvZstep * (float)(x1 + 0.5 - CenterX); float uGradient = WallT.UoverZstep; float zGradient = WallT.InvZstep; - float xrepeat = (float)walxrepeat; + float xrepeat = (float)fabs(walxrepeat); float depthScale = (float)(WallT.InvZstep * WallTMapScale2); float depthOrg = (float)(-WallT.UoverZstep * WallTMapScale2); - if (xrepeat < 0.0f) + if (walxrepeat < 0.0) { for (int x = x1; x < x2; x++) { @@ -2084,9 +2084,9 @@ void PrepLWall(fixed_t *upos, double walxrepeat, int x1, int x2) float invZ = WallT.InvZorg + WallT.InvZstep * (float)(x1 + 0.5 - CenterX); float uGradient = WallT.UoverZstep; float zGradient = WallT.InvZstep; - float xrepeat = (float)walxrepeat; + float xrepeat = (float)fabs(walxrepeat); - if (xrepeat < 0.0f) + if (walxrepeat < 0.0f) { for (int x = x1; x < x2; x++) {