diff --git a/src/p_slopes.c b/src/p_slopes.c index 9cd22f35..60bd1087 100644 --- a/src/p_slopes.c +++ b/src/p_slopes.c @@ -204,6 +204,8 @@ void P_SpawnSlope_Line(int linenum) // For FOF slopes, make a special function to copy to the xy origin & direction relative to the position of the FOF on the map! if(frontfloor || frontceil) { + line->frontsector->hasslope = true; // Tell the software renderer that we're sloped + origin.z = line->backsector->floorheight; direction.x = nx; direction.y = ny; @@ -327,6 +329,8 @@ void P_SpawnSlope_Line(int linenum) } if(backfloor || backceil) { + line->backsector->hasslope = true; // Tell the software renderer that we're sloped + origin.z = line->frontsector->floorheight; // Backsector direction.x = -nx; @@ -459,6 +463,8 @@ void P_CopySectorSlope(line_t *line) fsec->c_slope = srcsec->c_slope; //P_CopySlope(srcsec->c_slope); } + fsec->hasslope = true; + line->special = 0; // Linedef was use to set slopes, it finished its job, so now make it a normal linedef } diff --git a/src/r_bsp.c b/src/r_bsp.c index 283029ca..8907ff42 100644 --- a/src/r_bsp.c +++ b/src/r_bsp.c @@ -946,6 +946,10 @@ static void R_Subsector(size_t num) #ifdef ESLOPE ffloor[numffloors].slope = *rover->b_slope; + + // Tell the renderer this sector has slopes in it. + if (ffloor[numffloors].slope) + frontsector->hasslope = true; #endif ffloor[numffloors].height = @@ -983,6 +987,10 @@ static void R_Subsector(size_t num) #ifdef ESLOPE ffloor[numffloors].slope = *rover->t_slope; + + // Tell the renderer this sector has slopes in it. + if (ffloor[numffloors].slope) + frontsector->hasslope = true; #endif ffloor[numffloors].height = diff --git a/src/r_defs.h b/src/r_defs.h index b3667c05..b5b589e7 100644 --- a/src/r_defs.h +++ b/src/r_defs.h @@ -391,7 +391,9 @@ typedef struct sector_s // Eternity engine slope pslope_t *f_slope; // floor slope pslope_t *c_slope; // ceiling slope + boolean hasslope; // The sector, or one of its visible FOFs, contains a slope #endif + // these are saved for netgames, so do not let Lua touch these! // offsets sector spawned with (via linedef type 7) diff --git a/src/r_segs.c b/src/r_segs.c index 5d434b9a..a9d6c302 100644 --- a/src/r_segs.c +++ b/src/r_segs.c @@ -1602,7 +1602,7 @@ void R_StoreWallRange(INT32 start, INT32 stop) // and decide if floor / ceiling marks are needed #ifdef ESLOPE // Figure out map coordinates of where start and end are mapping to on seg, so we can clip right for slope bullshit - //if (frontsector->c_slope || frontsector->f_slope || (backsector && (backsector->c_slope || backsector->f_slope))) // Commenting this out for FOFslop. -Red + if (frontsector->hasslope || (backsector && backsector->hasslope)) // Commenting this out for FOFslop. -Red { angle_t temp; @@ -2589,6 +2589,10 @@ void R_StoreWallRange(INT32 start, INT32 stop) continue; #ifdef ESLOPE + // Let the renderer know this sector is sloped. + if (*rover->b_slope || *rover->t_slope) + backsector->hasslope = true; + rovertest = (*rover->b_slope ? P_GetZAt(*rover->b_slope, segleft.x, segleft.y) : *rover->bottomheight) - viewz; planevistest = (*rover->b_slope ? P_GetZAt(*rover->b_slope, viewx, viewy) : *rover->bottomheight); @@ -2670,6 +2674,10 @@ void R_StoreWallRange(INT32 start, INT32 stop) #ifdef ESLOPE + // Let the renderer know this sector is sloped. + if (*rover->b_slope || *rover->t_slope) + frontsector->hasslope = true; + rovertest = (*rover->b_slope ? P_GetZAt(*rover->b_slope, segleft.x, segleft.y) : *rover->bottomheight) - viewz; planevistest = (*rover->b_slope ? P_GetZAt(*rover->b_slope, viewx, viewy) : *rover->bottomheight);