diff --git a/src/r_bsp.cpp b/src/r_bsp.cpp index 87b880c27..74b78397d 100644 --- a/src/r_bsp.cpp +++ b/src/r_bsp.cpp @@ -569,16 +569,12 @@ static void R_AddLine(seg_t *line) // same for floors if (!bothceilingssky && !bothfloorssky) { - if ((backc1 <= frontf1 && backc2 <= frontf2) - || (backf1 >= frontc1 && backf2 >= frontc2)) - { - goto clipsolid; - } - + doorclosed = (backc1 <= frontf1 && backc2 <= frontf2) + || (backf1 >= frontc1 && backf2 >= frontc2) // Check for automap fix. Store in doorclosed for r_segs.c - doorclosed = (backc1 <= backf1 && backc2 <= backf2 - && ((backc1 >= frontc1 && backc2 >= frontc2) || curline->sidedef->toptexture) - && ((backf1 <= frontf1 && backf2 >= frontf2) || curline->sidedef->bottomtexture)); + || (backc1 <= backf1 && backc2 <= backf2 + && ((backc1 >= frontc1 && backc2 >= frontc2) || curline->sidedef->toptexture) + && ((backf1 <= frontf1 && backf2 >= frontf2) || curline->sidedef->bottomtexture)); if (doorclosed) goto clipsolid; @@ -598,12 +594,8 @@ static void R_AddLine(seg_t *line) // same for floors if (!bothceilingssky && !bothfloorssky) { - if (backsector->ceilingheight <= frontsector->floorheight - || backsector->floorheight >= frontsector->ceilingheight) - { - goto clipsolid; - } - + doorclosed = backsector->ceilingheight <= frontsector->floorheight + || backsector->floorheight >= frontsector->ceilingheight // Check for automap fix. Store in doorclosed for r_segs.c // // This is used to fix the automap bug which @@ -613,10 +605,10 @@ static void R_AddLine(seg_t *line) // of front-back closure (e.g. front floor is taller than back ceiling). // // if door is closed because back is shut: - doorclosed = 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); + || (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)); if (doorclosed) goto clipsolid; diff --git a/src/r_segs.cpp b/src/r_segs.cpp index 6f6fb37a9..d5d66a04d 100644 --- a/src/r_segs.cpp +++ b/src/r_segs.cpp @@ -2061,59 +2061,18 @@ void R_StoreWallRange(INT32 start, INT32 stop) } } - if (!bothceilingssky && !bothfloorssky) - { - if (worldhigh <= worldbottom && worldhighslope <= worldbottomslope) - { - ds_p->sprbottomclip = negonearray; - ds_p->bsilheight = INT32_MAX; - ds_p->silhouette |= SIL_BOTTOM; - } - - if (worldlow >= worldtop && worldlowslope >= worldtopslope) - { - ds_p->sprtopclip = screenheightarray; - 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 && !bothfloorssky) + if (doorclosed) { - if (doorclosed || (worldhigh <= worldbottom && worldhighslope <= worldbottomslope)) - { - ds_p->sprbottomclip = negonearray; - ds_p->bsilheight = INT32_MAX; - ds_p->silhouette |= SIL_BOTTOM; - } + ds_p->sprbottomclip = negonearray; + ds_p->bsilheight = INT32_MAX; + ds_p->silhouette |= SIL_BOTTOM; - if (doorclosed || (worldlow >= worldtop && worldlowslope >= worldtopslope)) - { // killough 1/17/98, 2/8/98 - ds_p->sprtopclip = screenheightarray; - 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 (doorclosed || (worldhigh <= worldbottom && worldhighslope <= worldbottomslope)) - { - ds_p->sprbottomclip = negonearray; - ds_p->bsilheight = INT32_MAX; - ds_p->silhouette |= SIL_BOTTOM; - } - if (doorclosed || (worldlow >= worldtop && worldlowslope >= worldtopslope)) - { // killough 1/17/98, 2/8/98 - ds_p->sprtopclip = screenheightarray; - ds_p->tsilheight = INT32_MIN; - ds_p->silhouette |= SIL_TOP; - } - } + ds_p->sprtopclip = screenheightarray; + ds_p->tsilheight = INT32_MIN; + ds_p->silhouette |= SIL_TOP; } if (bothfloorssky) @@ -2122,7 +2081,8 @@ void R_StoreWallRange(INT32 start, INT32 stop) // this is the same but for upside down thok barriers where the floor is sky and the ceiling is normal markfloor = false; } - else if (worldlow != worldbottom + else if (doorclosed + || worldlow != worldbottom || worldlowslope != worldbottomslope || backsector->f_slope != frontsector->f_slope || backsector->floorpic != frontsector->floorpic @@ -2157,7 +2117,8 @@ void R_StoreWallRange(INT32 start, INT32 stop) // so we can see the floor of thok barriers always regardless of sector properties markceiling = false; } - else if (worldhigh != worldtop + else if (doorclosed + || worldhigh != worldtop || worldhighslope != worldtopslope || backsector->c_slope != frontsector->c_slope || backsector->ceilingpic != frontsector->ceilingpic @@ -2185,16 +2146,6 @@ void R_StoreWallRange(INT32 start, INT32 stop) markceiling = false; } - if (!bothceilingssky && !bothfloorssky) - { - if ((worldhigh <= worldbottom && worldhighslope <= worldbottomslope) - || (worldlow >= worldtop && worldlowslope >= worldtopslope)) - { - // closed door - markceiling = markfloor = true; - } - } - // check TOP TEXTURE if (!bothceilingssky // never draw the top texture if on && (worldhigh < worldtop || worldhighslope < worldtopslope))