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 36696b1fbb
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.
/// \note Kind of problematic. If we decide to keep this on, we'll need serious map changes.
//#define NOCLIPCAM
#define NOCLIPCAM
#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)
#undef SLOPEPARAMS
if (viewsector != gr_backsector && viewsector != gr_frontsector)
{
// Closed door.
if ((backc1 <= frontf1 && backc2 <= frontf2)
|| (backf1 >= frontc1 && backf2 >= frontc2))
{
goto clipsolid;
}
}
// Window.
if (backc1 != frontc1 || backc2 != frontc2
@ -2829,11 +2832,14 @@ static void HWR_AddLine(seg_t * line)
}
else
#endif
{
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 ||

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
@ -502,6 +478,8 @@ 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 (viewsector != backsector && viewsector != frontsector)
{
if ((backc1 <= frontf1 && backc2 <= frontf2)
|| (backf1 >= frontc1 && backf2 >= frontc2))
{
@ -516,6 +494,7 @@ static void R_AddLine(seg_t *line)
if (doorclosed)
goto clipsolid;
}
// Window.
if (backc1 != frontc1 || backc2 != frontc2
@ -526,6 +505,8 @@ static void R_AddLine(seg_t *line)
}
else
#endif
{
if (viewsector != backsector && viewsector != frontsector)
{
if (backsector->ceilingheight <= frontsector->floorheight
|| 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
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;
}
// Window.
if (backsector->ceilingheight != frontsector->ceilingheight

View File

@ -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,6 +2113,8 @@ void R_StoreWallRange(INT32 start, INT32 stop)
// ds_p->sprtopclip = screenheightarray;
}
if (viewsector != frontsector && viewsector != backsector)
{
#ifdef ESLOPE
if (worldhigh <= worldbottom && worldhighslope <= worldbottomslope)
#else
@ -2160,6 +2162,7 @@ void R_StoreWallRange(INT32 start, INT32 stop)
ds_p->silhouette |= SIL_TOP;
}
}
}
if (worldlow != worldbottom
#ifdef ESLOPE