Merge branch 'noclip-cam' into 'master'

Noclip cam

See merge request KartKrew/Kart!32
This commit is contained in:
Sal 2018-10-07 23:15:06 -04:00
commit 2f43e56774
4 changed files with 79 additions and 84 deletions

View file

@ -546,6 +546,6 @@ extern const char *compdate, *comptime, *comprevision, *compbranch;
/// SRB2Kart: Camera always has noclip. /// SRB2Kart: Camera always has noclip.
/// \note Kind of problematic. If we decide to keep this on, we'll need serious map changes. /// \note Kind of problematic. If we decide to keep this on, we'll need serious map changes.
//#define NOCLIPCAM #define NOCLIPCAM
#endif // __DOOMDEF__ #endif // __DOOMDEF__

View file

@ -2813,12 +2813,15 @@ static void HWR_AddLine(seg_t * line)
SLOPEPARAMS( gr_backsector->c_slope, backc1, backc2, gr_backsector->ceilingheight) SLOPEPARAMS( gr_backsector->c_slope, backc1, backc2, gr_backsector->ceilingheight)
#undef SLOPEPARAMS #undef SLOPEPARAMS
if (viewsector != gr_backsector && viewsector != gr_frontsector)
{
// Closed door. // Closed door.
if ((backc1 <= frontf1 && backc2 <= frontf2) if ((backc1 <= frontf1 && backc2 <= frontf2)
|| (backf1 >= frontc1 && backf2 >= frontc2)) || (backf1 >= frontc1 && backf2 >= frontc2))
{ {
goto clipsolid; goto clipsolid;
} }
}
// Window. // Window.
if (backc1 != frontc1 || backc2 != frontc2 if (backc1 != frontc1 || backc2 != frontc2
@ -2829,11 +2832,14 @@ static void HWR_AddLine(seg_t * line)
} }
else else
#endif #endif
{
if (viewsector != gr_backsector && viewsector != gr_frontsector)
{ {
// Closed door. // Closed door.
if (gr_backsector->ceilingheight <= gr_frontsector->floorheight || if (gr_backsector->ceilingheight <= gr_frontsector->floorheight ||
gr_backsector->floorheight >= gr_frontsector->ceilingheight) gr_backsector->floorheight >= gr_frontsector->ceilingheight)
goto clipsolid; goto clipsolid;
}
// Window. // Window.
if (gr_backsector->ceilingheight != gr_frontsector->ceilingheight || if (gr_backsector->ceilingheight != gr_frontsector->ceilingheight ||

View file

@ -222,30 +222,6 @@ void R_PortalClearClipSegs(INT32 start, INT32 end)
newend = solidsegs + 2; 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 // If player's view height is underneath fake floor, lower the
// drawn ceiling to be just under the floor height, and replace // drawn ceiling to be just under the floor height, and replace
@ -502,6 +478,8 @@ static void R_AddLine(seg_t *line)
SLOPEPARAMS( backsector->f_slope, backf1, backf2, backsector->floorheight) SLOPEPARAMS( backsector->f_slope, backf1, backf2, backsector->floorheight)
SLOPEPARAMS( backsector->c_slope, backc1, backc2, backsector->ceilingheight) SLOPEPARAMS( backsector->c_slope, backc1, backc2, backsector->ceilingheight)
#undef SLOPEPARAMS #undef SLOPEPARAMS
if (viewsector != backsector && viewsector != frontsector)
{
if ((backc1 <= frontf1 && backc2 <= frontf2) if ((backc1 <= frontf1 && backc2 <= frontf2)
|| (backf1 >= frontc1 && backf2 >= frontc2)) || (backf1 >= frontc1 && backf2 >= frontc2))
{ {
@ -516,6 +494,7 @@ static void R_AddLine(seg_t *line)
if (doorclosed) if (doorclosed)
goto clipsolid; goto clipsolid;
}
// Window. // Window.
if (backc1 != frontc1 || backc2 != frontc2 if (backc1 != frontc1 || backc2 != frontc2
@ -526,6 +505,8 @@ static void R_AddLine(seg_t *line)
} }
else else
#endif #endif
{
if (viewsector != backsector && viewsector != frontsector)
{ {
if (backsector->ceilingheight <= frontsector->floorheight if (backsector->ceilingheight <= frontsector->floorheight
|| backsector->floorheight >= frontsector->ceilingheight) || backsector->floorheight >= frontsector->ceilingheight)
@ -534,9 +515,14 @@ static void R_AddLine(seg_t *line)
} }
// Check for automap fix. Store in doorclosed for r_segs.c // 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) if (doorclosed)
goto clipsolid; goto clipsolid;
}
// Window. // Window.
if (backsector->ceilingheight != frontsector->ceilingheight if (backsector->ceilingheight != frontsector->ceilingheight

View file

@ -1365,7 +1365,7 @@ static void R_RenderSegLoop (void)
if (bottom >= floorclip[rw_x]) if (bottom >= floorclip[rw_x])
bottom = floorclip[rw_x]-1; bottom = floorclip[rw_x]-1;
if (top <= bottom) if (top <= bottom && ceilingplane)
{ {
ceilingplane->top[rw_x] = (INT16)top; ceilingplane->top[rw_x] = (INT16)top;
ceilingplane->bottom[rw_x] = (INT16)bottom; ceilingplane->bottom[rw_x] = (INT16)bottom;
@ -2113,6 +2113,8 @@ void R_StoreWallRange(INT32 start, INT32 stop)
// ds_p->sprtopclip = screenheightarray; // ds_p->sprtopclip = screenheightarray;
} }
if (viewsector != frontsector && viewsector != backsector)
{
#ifdef ESLOPE #ifdef ESLOPE
if (worldhigh <= worldbottom && worldhighslope <= worldbottomslope) if (worldhigh <= worldbottom && worldhighslope <= worldbottomslope)
#else #else
@ -2160,6 +2162,7 @@ void R_StoreWallRange(INT32 start, INT32 stop)
ds_p->silhouette |= SIL_TOP; ds_p->silhouette |= SIL_TOP;
} }
} }
}
if (worldlow != worldbottom if (worldlow != worldbottom
#ifdef ESLOPE #ifdef ESLOPE