diff --git a/src/doomdef.h b/src/doomdef.h index c051a58b..0d98c31e 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -546,6 +546,6 @@ extern const char *compdate, *comptime, *comprevision, *compbranch; /// SRB2Kart: Camera always has noclip. /// \note Kind of problematic. If we decide to keep this on, we'll need serious map changes. -//#define NOCLIPCAM +#define NOCLIPCAM #endif // __DOOMDEF__ diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index 54362762..420efa17 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -2813,11 +2813,14 @@ static void HWR_AddLine(seg_t * line) SLOPEPARAMS( gr_backsector->c_slope, backc1, backc2, gr_backsector->ceilingheight) #undef SLOPEPARAMS - // Closed door. - if ((backc1 <= frontf1 && backc2 <= frontf2) - || (backf1 >= frontc1 && backf2 >= frontc2)) + if (viewsector != gr_backsector && viewsector != gr_frontsector) { - goto clipsolid; + // Closed door. + if ((backc1 <= frontf1 && backc2 <= frontf2) + || (backf1 >= frontc1 && backf2 >= frontc2)) + { + goto clipsolid; + } } // Window. @@ -2830,10 +2833,13 @@ static void HWR_AddLine(seg_t * line) else #endif { - // Closed door. - if (gr_backsector->ceilingheight <= gr_frontsector->floorheight || - gr_backsector->floorheight >= gr_frontsector->ceilingheight) - goto clipsolid; + if (viewsector != gr_backsector && viewsector != gr_frontsector) + { + // Closed door. + if (gr_backsector->ceilingheight <= gr_frontsector->floorheight || + gr_backsector->floorheight >= gr_frontsector->ceilingheight) + goto clipsolid; + } // Window. if (gr_backsector->ceilingheight != gr_frontsector->ceilingheight || diff --git a/src/r_bsp.c b/src/r_bsp.c index 82a7624b..c06c48dd 100644 --- a/src/r_bsp.c +++ b/src/r_bsp.c @@ -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 @@ -502,21 +478,24 @@ 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 ((backc1 <= frontf1 && backc2 <= frontf2) - || (backf1 >= frontc1 && backf2 >= frontc2)) + if (viewsector != backsector && viewsector != frontsector) { - goto clipsolid; + if ((backc1 <= frontf1 && backc2 <= frontf2) + || (backf1 >= frontc1 && backf2 >= frontc2)) + { + goto clipsolid; + } + + // 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) + && (backsector->ceilingpic != skyflatnum || frontsector->ceilingpic != skyflatnum)); + + if (doorclosed) + goto clipsolid; } - // 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) - && (backsector->ceilingpic != skyflatnum || frontsector->ceilingpic != skyflatnum)); - - if (doorclosed) - goto clipsolid; - // Window. if (backc1 != frontc1 || backc2 != frontc2 || backf1 != frontf1 || backf2 != frontf2) @@ -527,16 +506,23 @@ static void R_AddLine(seg_t *line) else #endif { - if (backsector->ceilingheight <= frontsector->floorheight - || backsector->floorheight >= frontsector->ceilingheight) + if (viewsector != backsector && viewsector != frontsector) { - goto clipsolid; - } + if (backsector->ceilingheight <= frontsector->floorheight + || backsector->floorheight >= frontsector->ceilingheight) + { + goto clipsolid; + } - // Check for automap fix. Store in doorclosed for r_segs.c - doorclosed = R_DoorClosed(); - if (doorclosed) - goto clipsolid; + // Check for automap fix. Store in doorclosed for r_segs.c + 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; + } // Window. if (backsector->ceilingheight != frontsector->ceilingheight diff --git a/src/r_segs.c b/src/r_segs.c index 11287f16..231a84f7 100644 --- a/src/r_segs.c +++ b/src/r_segs.c @@ -1365,7 +1365,7 @@ static void R_RenderSegLoop (void) if (bottom >= floorclip[rw_x]) bottom = floorclip[rw_x]-1; - if (top <= bottom) + if (top <= bottom && ceilingplane) { ceilingplane->top[rw_x] = (INT16)top; ceilingplane->bottom[rw_x] = (INT16)bottom; @@ -2113,52 +2113,55 @@ void R_StoreWallRange(INT32 start, INT32 stop) // ds_p->sprtopclip = screenheightarray; } -#ifdef ESLOPE - if (worldhigh <= worldbottom && worldhighslope <= worldbottomslope) -#else - if (worldhigh <= worldbottom) -#endif - { - ds_p->sprbottomclip = negonearray; - ds_p->bsilheight = INT32_MAX; - ds_p->silhouette |= SIL_BOTTOM; - } - -#ifdef ESLOPE - if (worldlow >= worldtop && worldlowslope >= worldtopslope) -#else - if (worldlow >= worldtop) -#endif - { - 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 (viewsector != frontsector && viewsector != backsector) { #ifdef ESLOPE - if (doorclosed || (worldhigh <= worldbottom && worldhighslope <= worldbottomslope)) + if (worldhigh <= worldbottom && worldhighslope <= worldbottomslope) #else - if (doorclosed || backsector->ceilingheight <= frontsector->floorheight) + if (worldhigh <= worldbottom) #endif { ds_p->sprbottomclip = negonearray; ds_p->bsilheight = INT32_MAX; ds_p->silhouette |= SIL_BOTTOM; } + #ifdef ESLOPE - if (doorclosed || (worldlow >= worldtop && worldlowslope >= worldtopslope)) + if (worldlow >= worldtop && worldlowslope >= worldtopslope) #else - if (doorclosed || backsector->floorheight >= frontsector->ceilingheight) + if (worldlow >= worldtop) #endif - { // 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. + { +#ifdef ESLOPE + if (doorclosed || (worldhigh <= worldbottom && worldhighslope <= worldbottomslope)) +#else + if (doorclosed || backsector->ceilingheight <= frontsector->floorheight) +#endif + { + ds_p->sprbottomclip = negonearray; + ds_p->bsilheight = INT32_MAX; + ds_p->silhouette |= SIL_BOTTOM; + } +#ifdef ESLOPE + if (doorclosed || (worldlow >= worldtop && worldlowslope >= worldtopslope)) +#else + if (doorclosed || backsector->floorheight >= frontsector->ceilingheight) +#endif + { // killough 1/17/98, 2/8/98 + ds_p->sprtopclip = screenheightarray; + ds_p->tsilheight = INT32_MIN; + ds_p->silhouette |= SIL_TOP; + } + } } if (worldlow != worldbottom