From 3991e25de5c150e9ff9199680e043f817b77bb79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miloslav=20=C4=8C=C3=AD=C5=BE?= Date: Sat, 22 Sep 2018 15:52:43 +0200 Subject: [PATCH] Fix sky --- demo3.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/demo3.cpp b/demo3.cpp index a694500..7c65434 100644 --- a/demo3.cpp +++ b/demo3.cpp @@ -481,15 +481,13 @@ inline void pixelFunc(RCL_PixelInfo *pixel) } else { - if (previousColumn == pixel->position.x) - { - color = imageBackground[2 + backgroundColumn * 44 + RCL_clamp(pixel->position.y - player.mCamera.shear,0,43)]; - } - else + if (previousColumn != pixel->position.x) { backgroundColumn = RCL_absVal(pixel->position.x + (110 * player.mCamera.direction) / RCL_UNITS_PER_SQUARE) % 110; previousColumn = pixel->position.x; } + + color = imageBackground[2 + backgroundColumn * 44 + RCL_clamp(pixel->position.y - player.mCamera.shear,0,43)]; } if (intensity != 0)