mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2024-11-10 23:31:50 +00:00
welp no success in fixing the sky HOMs yet, committing progress anyway
This commit is contained in:
parent
a2aeece419
commit
eb90f4f50d
1 changed files with 40 additions and 18 deletions
58
src/r_segs.c
58
src/r_segs.c
|
@ -1487,10 +1487,20 @@ static void R_RenderSegLoop (void)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// note: don't use min/max macros here
|
// note: don't use min/max macros here
|
||||||
if (markceiling && yl >= 0)
|
if (markceiling)
|
||||||
ceilingclip[rw_x] = (yl-1 > viewheight) ? (INT16)viewheight : (INT16)((INT16)yl - 1);
|
{
|
||||||
if (markfloor && yh < viewheight)
|
if (yl >= 0)
|
||||||
|
ceilingclip[rw_x] = (yl > viewheight) ? (INT16)viewheight : (INT16)((INT16)yl - 1);
|
||||||
|
else
|
||||||
|
ceilingclip[rw_x] = -1;
|
||||||
|
}
|
||||||
|
else if (markfloor)
|
||||||
|
{
|
||||||
|
if (yh < viewheight)
|
||||||
floorclip[rw_x] = (yh < -1) ? -1 : (INT16)((INT16)yh + 1);
|
floorclip[rw_x] = (yh < -1) ? -1 : (INT16)((INT16)yh + 1);
|
||||||
|
else
|
||||||
|
floorclip[rw_x] = (INT16)viewheight;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -1505,9 +1515,7 @@ static void R_RenderSegLoop (void)
|
||||||
if (mid >= floorclip[rw_x])
|
if (mid >= floorclip[rw_x])
|
||||||
mid = floorclip[rw_x]-1;
|
mid = floorclip[rw_x]-1;
|
||||||
|
|
||||||
if (yl < 0)
|
if (mid >= yl && yl < viewheight)
|
||||||
; // do nothing, off-screen
|
|
||||||
else if (mid >= yl && yl < viewheight)
|
|
||||||
{
|
{
|
||||||
if (mid >= 0)
|
if (mid >= 0)
|
||||||
{
|
{
|
||||||
|
@ -1519,13 +1527,21 @@ static void R_RenderSegLoop (void)
|
||||||
colfunc();
|
colfunc();
|
||||||
ceilingclip[rw_x] = (INT16)mid;
|
ceilingclip[rw_x] = (INT16)mid;
|
||||||
}
|
}
|
||||||
// else do nothing, off-screen
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
ceilingclip[rw_x] = (yl > viewheight) ? (INT16)viewheight : (INT16)((INT16)yl - 1);
|
ceilingclip[rw_x] = -1;
|
||||||
}
|
}
|
||||||
else if (markceiling && yl >= 0) // no top wall
|
else if (yl >= 0)
|
||||||
ceilingclip[rw_x] = (yl > viewheight) ? (INT16)viewheight : (INT16)((INT16)yl - 1);
|
ceilingclip[rw_x] = (yl > viewheight) ? (INT16)viewheight : (INT16)((INT16)yl - 1);
|
||||||
|
else
|
||||||
|
ceilingclip[rw_x] = -1;
|
||||||
|
}
|
||||||
|
else if (markceiling) // no top wall
|
||||||
|
{
|
||||||
|
if (yl >= 0)
|
||||||
|
ceilingclip[rw_x] = (yl > viewheight) ? (INT16)viewheight : (INT16)((INT16)yl - 1);
|
||||||
|
else
|
||||||
|
ceilingclip[rw_x] = -1;
|
||||||
|
}
|
||||||
|
|
||||||
if (bottomtexture)
|
if (bottomtexture)
|
||||||
{
|
{
|
||||||
|
@ -1537,9 +1553,7 @@ static void R_RenderSegLoop (void)
|
||||||
if (mid <= ceilingclip[rw_x])
|
if (mid <= ceilingclip[rw_x])
|
||||||
mid = ceilingclip[rw_x]+1;
|
mid = ceilingclip[rw_x]+1;
|
||||||
|
|
||||||
if (yh >= viewheight)
|
if (mid <= yh && yh >= 0)
|
||||||
; // do nothing, off-screen
|
|
||||||
else if (mid <= yh && yh >= 0)
|
|
||||||
{
|
{
|
||||||
if (mid < viewheight)
|
if (mid < viewheight)
|
||||||
{
|
{
|
||||||
|
@ -1552,13 +1566,21 @@ static void R_RenderSegLoop (void)
|
||||||
colfunc();
|
colfunc();
|
||||||
floorclip[rw_x] = (INT16)mid;
|
floorclip[rw_x] = (INT16)mid;
|
||||||
}
|
}
|
||||||
// else do nothing, off-screen
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
floorclip[rw_x] = (yh < -1) ? -1 : (INT16)((INT16)yh + 1);
|
floorclip[rw_x] = (INT16)viewheight;
|
||||||
|
}
|
||||||
|
else if (yh < viewheight)
|
||||||
|
floorclip[rw_x] = (yh < -1) ? -1 : (INT16)((INT16)yh + 1);
|
||||||
|
else
|
||||||
|
floorclip[rw_x] = (INT16)viewheight;
|
||||||
|
}
|
||||||
|
else if (markfloor) // no bottom wall
|
||||||
|
{
|
||||||
|
if (yh < viewheight)
|
||||||
|
floorclip[rw_x] = (yh < -1) ? -1 : (INT16)((INT16)yh + 1);
|
||||||
|
else
|
||||||
|
floorclip[rw_x] = (INT16)viewheight;
|
||||||
}
|
}
|
||||||
else if (markfloor && yh < viewheight) // no bottom wall
|
|
||||||
floorclip[rw_x] = (yh < -1) ? -1 : (INT16)((INT16)yh + 1), -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (floorclip[rw_x] > viewheight)
|
if (floorclip[rw_x] > viewheight)
|
||||||
|
|
Loading…
Reference in a new issue