From d9c571e13fa3c393cb56372ec9eadd73c722930a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miloslav=20=C4=8C=C3=AD=C5=BE?= Date: Wed, 12 Sep 2018 15:56:37 +0200 Subject: [PATCH] Simplify loops --- raycastlib.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/raycastlib.h b/raycastlib.h index c5e59f2..fc19861 100644 --- a/raycastlib.h +++ b/raycastlib.h @@ -904,7 +904,7 @@ void _columnFunction(HitResult *hits, uint16_t hitCount, uint16_t x, Ray ray) { iTo = y2 < zTop ? zTop : y2; - for (int_maybe32_t i = z1Screen < y ? z1Screen : y; i >= iTo; --i) + for (int_maybe32_t i = y; i >= iTo; --i) { p.position.y = i; p.hit = hit; @@ -925,8 +925,7 @@ void _columnFunction(HitResult *hits, uint16_t hitCount, uint16_t x, Ray ray) { iTo = y > zBottomCeil ? zBottomCeil : y; - for (int_maybe32_t i = z1ScreenCeil > y2 ? z1ScreenCeil : y2; i < iTo; - ++i) + for (int_maybe32_t i = y2; i < iTo; ++i) { p.position.y = i; p.hit = hit;