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)