From 62fc4ab7c76ba667fa7d596b2e10ec7dd813530f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miloslav=20=C4=8C=C3=AD=C5=BE?= Date: Thu, 13 Sep 2018 19:00:28 +0200 Subject: [PATCH] Fix texturing --- raycastlib.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/raycastlib.h b/raycastlib.h index 3df8282..5e6273a 100644 --- a/raycastlib.h +++ b/raycastlib.h @@ -28,7 +28,7 @@ serves the purpose of a fixed-point arithmetic. */ #define UNIT_INFINITY 5000000; #else - #define UNITS_PER_SQUARE 64 + #define UNITS_PER_SQUARE 128 typedef int16_t Unit; #define UNIT_INFINITY 32767; #endif @@ -873,7 +873,7 @@ void _columnFunction(HitResult *hits, uint16_t hitCount, uint16_t x, Ray ray) limit = clamp(pref##Z2Screen,l1,l2);\ Unit wallLength = pref##Z2Screen - pref##Z1Screen - 1;\ wallLength = wallLength != 0 ? wallLength : 1;\ - Unit wallPosition = absVal(pref##Z1Screen - pref##PosY) + 1;\ + Unit wallPosition = absVal(pref##Z1Screen - pref##PosY) inc (-1);\ for (i = pref##PosY inc 1; i comp##= limit; inc##inc i)\ {\ p.position.y = i;\