mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2024-12-27 04:41:23 +00:00
Slight optimization (don't get seg ends for slopes if there are no slopes)
This commit is contained in:
parent
c08253d796
commit
8ba5b66853
4 changed files with 25 additions and 1 deletions
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
@ -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 =
|
||||
|
|
|
@ -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)
|
||||
|
|
10
src/r_segs.c
10
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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue