1
0
Fork 0
mirror of https://git.coom.tech/drummyfish/raycastlib.git synced 2024-11-21 20:29:59 +01:00

Make render work

This commit is contained in:
Miloslav Číž 2018-09-01 09:55:35 +02:00
parent cc93dfcba8
commit c4b664714b

View file

@ -537,10 +537,13 @@ void _columnFunction(HitResult *hits, uint16_t hitCount, uint16_t x, Ray ray)
PixelInfo p; PixelInfo p;
p.position.x = x; p.position.x = x;
// draw floor until the wall
p.isWall = 0; p.isWall = 0;
// draw floor until the wall Unit zTop = z1Screen < z2Screen ? z1Screen : z2Screen;
for (int32_t i = y; i > z1Screen; --i)
for (int32_t i = y; i > zTop; --i)
{ {
p.position.y = i; p.position.y = i;
_pixelFunction(p); _pixelFunction(p);
@ -557,7 +560,7 @@ void _columnFunction(HitResult *hits, uint16_t hitCount, uint16_t x, Ray ray)
_pixelFunction(p); _pixelFunction(p);
} }
y = z2Screen; y = y > zTop ? zTop : y;
worldZPrev = worldZ2; worldZPrev = worldZ2;
} }
} }