1
0
Fork 0
mirror of https://git.coom.tech/drummyfish/raycastlib.git synced 2024-12-28 02:16:18 +01:00

Fix horizon bug

This commit is contained in:
Miloslav Číž 2018-09-10 14:36:09 +02:00
parent 615f142c3f
commit 1105264305

View file

@ -883,6 +883,7 @@ void _columnFunction(HitResult *hits, uint16_t hitCount, uint16_t x, Ray ray)
Unit floorCameraDiff = absVal(worldZPrev) * VERTICAL_DEPTH_MULTIPLY;
Unit horizon = (y2 < _middleRow || _ceilFunction == 0) ? _middleRow : y2;
horizon = clamp(horizon,0,_camera.resolution.y);
for (int_maybe32_t i = y; i >= horizon + (horizon > y2 ? 0 : 1); --i)
{
@ -900,6 +901,7 @@ void _columnFunction(HitResult *hits, uint16_t hitCount, uint16_t x, Ray ray)
absVal(worldZPrevCeil) * VERTICAL_DEPTH_MULTIPLY : UNITS_PER_SQUARE;
horizon = y > _middleRow ? _middleRow : y;
horizon = clamp(horizon,0,_camera.resolution.y);
for (int_maybe32_t i = y2; i < horizon; ++i)
{