From 284135bcaedfa85555d32726344fc5963f2f23fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miloslav=20=C4=8C=C3=AD=C5=BE?= Date: Thu, 13 Sep 2018 16:13:59 +0200 Subject: [PATCH] Fix raycast tiny --- raycastlib.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/raycastlib.h b/raycastlib.h index 7a4fd66..205500e 100644 --- a/raycastlib.h +++ b/raycastlib.h @@ -448,9 +448,9 @@ uint16_t sqrtInt(Unit value) Unit a = value; #ifdef RAYCAST_TINY - Unit b = 1u << 14; + uint32_t b = 1u << 14; #else - Unit b = 1u << 30; + uint32_t b = 1u << 30; #endif while (b > a) @@ -740,7 +740,11 @@ Unit _floorCeilFunction(int16_t x, int16_t y) Unit c = _ceilFunction(x,y); +#ifndef RAYCAST_TINY return ((f & 0x0000ffff) << 16) | (c & 0x0000ffff); +#else + return ((f & 0x00ff) << 8) | (c & 0x00ff); +#endif } Unit adjustDistance(Unit distance, Camera *camera, Ray *ray)