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

Simplify loops

This commit is contained in:
Miloslav Číž 2018-09-12 15:56:37 +02:00
parent 99a29e9d57
commit d9c571e13f

View file

@ -904,7 +904,7 @@ void _columnFunction(HitResult *hits, uint16_t hitCount, uint16_t x, Ray ray)
{ {
iTo = y2 < zTop ? zTop : y2; 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.position.y = i;
p.hit = hit; p.hit = hit;
@ -925,8 +925,7 @@ void _columnFunction(HitResult *hits, uint16_t hitCount, uint16_t x, Ray ray)
{ {
iTo = y > zBottomCeil ? zBottomCeil : y; iTo = y > zBottomCeil ? zBottomCeil : y;
for (int_maybe32_t i = z1ScreenCeil > y2 ? z1ScreenCeil : y2; i < iTo; for (int_maybe32_t i = y2; i < iTo; ++i)
++i)
{ {
p.position.y = i; p.position.y = i;
p.hit = hit; p.hit = hit;