mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-20 16:31:03 +00:00
Fix software splats breaking and crashing in skyboxes
This commit is contained in:
parent
93512ae9f9
commit
f72f45d93a
1 changed files with 13 additions and 1 deletions
|
@ -3001,13 +3001,25 @@ void R_ClipVisSprite(vissprite_t *spr, INT32 x1, INT32 x2, drawseg_t* dsstart, p
|
|||
|
||||
if (portal)
|
||||
{
|
||||
for (x = x1; x <= x2; x++)
|
||||
INT32 start_index = max(portal->start, x1);
|
||||
INT32 end_index = min(portal->start + portal->end - portal->start, x2);
|
||||
for (x = x1; x < start_index; x++)
|
||||
{
|
||||
spr->clipbot[x] = -1;
|
||||
spr->cliptop[x] = -1;
|
||||
}
|
||||
for (x = start_index; x <= end_index; x++)
|
||||
{
|
||||
if (spr->clipbot[x] > portal->floorclip[x - portal->start])
|
||||
spr->clipbot[x] = portal->floorclip[x - portal->start];
|
||||
if (spr->cliptop[x] < portal->ceilingclip[x - portal->start])
|
||||
spr->cliptop[x] = portal->ceilingclip[x - portal->start];
|
||||
}
|
||||
for (x = end_index + 1; x <= x2; x++)
|
||||
{
|
||||
spr->clipbot[x] = -1;
|
||||
spr->cliptop[x] = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue