Remove R_DoorClosed

This function has caused me, so much unexpected pain because of just how out of the way it is, and NOTHING else uses it
This commit is contained in:
TehRealSalt 2018-10-06 15:13:57 -04:00
parent 376656343a
commit ea6bdca949
1 changed files with 5 additions and 25 deletions

View File

@ -222,30 +222,6 @@ void R_PortalClearClipSegs(INT32 start, INT32 end)
newend = solidsegs + 2;
}
// R_DoorClosed
//
// This function is used to fix the automap bug which
// showed lines behind closed doors simply because the door had a dropoff.
//
// It assumes that Doom has already ruled out a door being closed because
// of front-back closure (e.g. front floor is taller than back ceiling).
static INT32 R_DoorClosed(void)
{
return
// if door is closed because back is shut:
backsector->ceilingheight <= backsector->floorheight
// preserve a kind of transparent door/lift special effect:
&& (backsector->ceilingheight >= frontsector->ceilingheight || curline->sidedef->toptexture)
&& (backsector->floorheight <= frontsector->floorheight || curline->sidedef->bottomtexture)
// properly render skies (consider door "open" if both ceilings are sky):
&& (backsector->ceilingpic != skyflatnum || frontsector->ceilingpic != skyflatnum);
}
//
// If player's view height is underneath fake floor, lower the
// drawn ceiling to be just under the floor height, and replace
@ -534,7 +510,11 @@ static void R_AddLine(seg_t *line)
}
// Check for automap fix. Store in doorclosed for r_segs.c
doorclosed = R_DoorClosed();
doorclosed = (backsector->ceilingheight <= backsector->floorheight
&& (backsector->ceilingheight >= frontsector->ceilingheight || curline->sidedef->toptexture)
&& (backsector->floorheight <= frontsector->floorheight || curline->sidedef->bottomtexture)
&& (backsector->ceilingpic != skyflatnum || frontsector->ceilingpic != skyflatnum));
if (doorclosed)
goto clipsolid;