More sky fixes for software:

* Thok barriers with slopes now render fine in software
* The solid "sky walls" between different-height thok barriers adjacent to each other are gone. Forever.
This commit is contained in:
Monster Iestyn 2018-01-28 22:08:58 +00:00
parent 5c70d6e6ca
commit 7d150485c9
2 changed files with 103 additions and 69 deletions

View File

@ -508,6 +508,9 @@ static void R_AddLine(seg_t *line)
SLOPEPARAMS( backsector->f_slope, backf1, backf2, backsector->floorheight)
SLOPEPARAMS( backsector->c_slope, backc1, backc2, backsector->ceilingheight)
#undef SLOPEPARAMS
// if both ceilings are skies, consider it always "open"
if (backsector->ceilingpic != skyflatnum || frontsector->ceilingpic != skyflatnum)
{
if ((backc1 <= frontf1 && backc2 <= frontf2)
|| (backf1 >= frontc1 && backf2 >= frontc2))
{
@ -518,10 +521,12 @@ static void R_AddLine(seg_t *line)
doorclosed = (backc1 <= backf1 && backc2 <= backf2
&& ((backc1 >= frontc1 && backc2 >= frontc2) || curline->sidedef->toptexture)
&& ((backf1 <= frontf1 && backf2 >= frontf2) || curline->sidedef->bottomtexture)
&& (backsector->ceilingpic != skyflatnum || frontsector->ceilingpic != skyflatnum));
//&& (backsector->ceilingpic != skyflatnum || frontsector->ceilingpic != skyflatnum)
);
if (doorclosed)
goto clipsolid;
}
// Window.
if (backc1 != frontc1 || backc2 != frontc2
@ -532,6 +537,9 @@ static void R_AddLine(seg_t *line)
}
else
#endif
{
// if both ceilings are skies, consider it always "open"
if (backsector->ceilingpic != skyflatnum || frontsector->ceilingpic != skyflatnum)
{
if (backsector->ceilingheight <= frontsector->floorheight
|| backsector->floorheight >= frontsector->ceilingheight)
@ -543,6 +551,7 @@ static void R_AddLine(seg_t *line)
doorclosed = R_DoorClosed();
if (doorclosed)
goto clipsolid;
}
// Window.
if (backsector->ceilingheight != frontsector->ceilingheight

View File

@ -2032,6 +2032,7 @@ void R_StoreWallRange(INT32 start, INT32 stop)
else
{
// two sided line
boolean bothceilingssky = false; // turned on if both back and front ceilings are sky
#ifdef ESLOPE
if (backsector->c_slope) {
@ -2063,10 +2064,11 @@ void R_StoreWallRange(INT32 start, INT32 stop)
if (frontsector->ceilingpic == skyflatnum
&& backsector->ceilingpic == skyflatnum)
{
bothceilingssky = true;
#ifdef ESLOPE
worldtopslope = worldhighslope =
//worldtopslope = worldhighslope;
#endif
worldtop = worldhigh;
//worldtop = worldhigh;
}
ds_p->sprtopclip = ds_p->sprbottomclip = NULL;
@ -2099,6 +2101,8 @@ void R_StoreWallRange(INT32 start, INT32 stop)
// ds_p->sprbottomclip = negonearray;
}
if (!bothceilingssky)
{
if (
#ifdef ESLOPE
worldtopslope < worldhighslope ||
@ -2125,7 +2129,10 @@ void R_StoreWallRange(INT32 start, INT32 stop)
ds_p->tsilheight = INT32_MIN;
// ds_p->sprtopclip = screenheightarray;
}
}
if (!bothceilingssky)
{
#ifdef ESLOPE
if (worldhigh <= worldbottom && worldhighslope <= worldbottomslope)
#else
@ -2147,10 +2154,12 @@ void R_StoreWallRange(INT32 start, INT32 stop)
ds_p->tsilheight = INT32_MIN;
ds_p->silhouette |= SIL_TOP;
}
}
//SoM: 3/25/2000: This code fixes an automap bug that didn't check
// frontsector->ceiling and backsector->floor to see if a door was closed.
// Without the following code, sprites get displayed behind closed doors.
if (!bothceilingssky)
{
#ifdef ESLOPE
if (doorclosed || (worldhigh <= worldbottom && worldhighslope <= worldbottomslope))
@ -2200,7 +2209,14 @@ void R_StoreWallRange(INT32 start, INT32 stop)
markfloor = false;
}
if (worldhigh != worldtop
if (bothceilingssky)
{
// double ceiling skies are special
// we don't want to lower the ceiling clipping, (no new plane is drawn anyway)
// so we can see the floor of thok barriers always regardless of sector properties
markceiling = false;
}
else if (worldhigh != worldtop
#ifdef ESLOPE
|| worldhighslope != worldtopslope
|| backsector->c_slope != frontsector->c_slope
@ -2226,19 +2242,28 @@ void R_StoreWallRange(INT32 start, INT32 stop)
markceiling = false;
}
if (backsector->ceilingheight <= frontsector->floorheight ||
backsector->floorheight >= frontsector->ceilingheight)
if (!bothceilingssky)
{
#ifdef ESLOPE
if ((worldhigh <= worldbottom && worldhighslope <= worldbottomslope)
|| (worldlow >= worldtop && worldlowslope >= worldtopslope))
#else
if (backsector->ceilingheight <= frontsector->floorheight
|| backsector->floorheight >= frontsector->ceilingheight)
#endif
{
// closed door
markceiling = markfloor = true;
}
}
// check TOP TEXTURE
if (worldhigh < worldtop
if (!bothceilingssky // never draw the top texture if on
&& (worldhigh < worldtop
#ifdef ESLOPE
|| worldhighslope < worldtopslope
#endif
)
))
{
fixed_t texheight;
// top texture
@ -2687,12 +2712,12 @@ void R_StoreWallRange(INT32 start, INT32 stop)
markfloor = false;
}
if ((
if (frontsector->ceilingpic != skyflatnum
&& (
#ifdef ESLOPE
frontsector->c_slope ? P_GetZAt(frontsector->c_slope, viewx, viewy) :
#endif
frontsector->ceilingheight) <= viewz &&
frontsector->ceilingpic != skyflatnum)
frontsector->ceilingheight) <= viewz)
{
// below view plane
markceiling = false;