HWR_ProcessSeg: port softwares code to skip rendering inner sides that are "joined" to other fofs
This seems to improve performance on maps with moderate to lots of fofs quite a bit. On maps with only a few fofs, this makes no difference or has very very little regression Need to test and check if there are any visual errors, but so far everything seems good
This commit is contained in:
1 parent
decaa79d20
commit
cb27730622
1 file changed
+78
-26
+78
-26
@@ -1881,6 +1881,7 @@ void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
|
||||
|
||||
// Used for height comparisons and etc across FOFs and slopes
|
||||
fixed_t high1, highslope1, low1, lowslope1;
|
||||
fixed_t high2, highslope2, low2, lowslope2;
|
||||
|
||||
INT32 texnum;
|
||||
|
||||
@@ -1893,19 +1894,6 @@ void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
|
||||
{
|
||||
for (rover = gl_backsector->ffloors; rover; rover = rover->next)
|
||||
{
|
||||
boolean bothsides = false;
|
||||
// Skip if it exists on both sectors.
|
||||
ffloor_t * r2;
|
||||
for (r2 = gl_frontsector->ffloors; r2; r2 = r2->next)
|
||||
if (rover->master == r2->master)
|
||||
{
|
||||
bothsides = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if (bothsides)
|
||||
continue;
|
||||
|
||||
const ffloortype_e roverflags = rover->flags;
|
||||
|
||||
if (!(roverflags & FF_EXISTS) || !(roverflags & FF_RENDERSIDES) || (roverflags & FF_INVERTSIDES))
|
||||
@@ -1917,6 +1905,45 @@ void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
|
||||
if ((high1 < lowcut || highslope1 < lowcutslope) || (low1 > highcut || lowslope1 > highcutslope))
|
||||
continue;
|
||||
|
||||
ffloor_t * r2;
|
||||
for (r2 = gl_frontsector->ffloors; r2; r2 = r2->next)
|
||||
{
|
||||
if (r2->master == rover->master) // Skip if same control line.
|
||||
break;
|
||||
|
||||
const ffloortype_e r2flags = r2->flags;
|
||||
|
||||
if (!(r2flags & FF_EXISTS) || !(r2flags & FF_RENDERSIDES))
|
||||
continue;
|
||||
|
||||
if (rover->flags & FF_EXTRA)
|
||||
{
|
||||
if (!(r2flags & FF_CUTEXTRA))
|
||||
continue;
|
||||
|
||||
if (r2flags & FF_EXTRA && (r2flags & (FF_TRANSLUCENT|FF_FOG)) != (rover->flags & (FF_TRANSLUCENT|FF_FOG)))
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!(r2flags & FF_CUTSOLIDS))
|
||||
continue;
|
||||
}
|
||||
|
||||
SLOPEPARAMS(*r2->t_slope, high2, highslope2, *r2->topheight)
|
||||
SLOPEPARAMS(*r2->b_slope, low2, lowslope2, *r2->bottomheight)
|
||||
|
||||
if ((high2 < lowcut || highslope2 < lowcutslope) || (low2 > highcut || lowslope2 > highcutslope))
|
||||
continue;
|
||||
if ((high1 > high2 || highslope1 > highslope2) || (low1 < low2 || lowslope1 < lowslope2))
|
||||
continue;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
if (r2)
|
||||
continue;
|
||||
|
||||
side_t *side = R_GetFFloorSide(gl_curline->linedef, rover, gl_backsector);
|
||||
|
||||
boolean do_texture_skew;
|
||||
@@ -2053,19 +2080,6 @@ void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
|
||||
{
|
||||
for (rover = gl_frontsector->ffloors; rover; rover = rover->next)
|
||||
{
|
||||
boolean bothsides = false;
|
||||
// Skip if it exists on both sectors.
|
||||
ffloor_t * r2;
|
||||
for (r2 = gl_backsector->ffloors; r2; r2 = r2->next)
|
||||
if (rover->master == r2->master)
|
||||
{
|
||||
bothsides = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if (bothsides)
|
||||
continue;
|
||||
|
||||
const ffloortype_e roverflags = rover->flags;
|
||||
|
||||
if (!(roverflags & FF_EXISTS) || !(roverflags & FF_RENDERSIDES) || !(roverflags & FF_ALLSIDES))
|
||||
@@ -2077,6 +2091,44 @@ void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
|
||||
if ((high1 < lowcut || highslope1 < lowcutslope) || (low1 > highcut || lowslope1 > highcutslope))
|
||||
continue;
|
||||
|
||||
ffloor_t * r2;
|
||||
for (r2 = gl_backsector->ffloors; r2; r2 = r2->next)
|
||||
{
|
||||
if (r2->master == rover->master) // Skip if same control line.
|
||||
break;
|
||||
|
||||
const ffloortype_e r2flags = r2->flags;
|
||||
|
||||
if (!(r2flags & FF_EXISTS) || !(r2flags & FF_RENDERSIDES))
|
||||
continue;
|
||||
|
||||
if (rover->flags & FF_EXTRA)
|
||||
{
|
||||
if (!(r2flags & FF_CUTEXTRA))
|
||||
continue;
|
||||
|
||||
if (r2flags & FF_EXTRA && (r2flags & (FF_TRANSLUCENT|FF_FOG)) != (rover->flags & (FF_TRANSLUCENT|FF_FOG)))
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!(r2flags & FF_CUTSOLIDS))
|
||||
continue;
|
||||
}
|
||||
|
||||
SLOPEPARAMS(*r2->t_slope, high2, highslope2, *r2->topheight)
|
||||
SLOPEPARAMS(*r2->b_slope, low2, lowslope2, *r2->bottomheight)
|
||||
|
||||
if ((high2 < lowcut || highslope2 < lowcutslope) || (low2 > highcut || lowslope2 > highcutslope))
|
||||
continue;
|
||||
if ((high1 > high2 || highslope1 > highslope2) || (low1 < low2 || lowslope1 < lowslope2))
|
||||
continue;
|
||||
|
||||
break;
|
||||
}
|
||||
if (r2)
|
||||
continue;
|
||||
|
||||
side_t *side = R_GetFFloorSide(gl_curline->linedef, rover, gl_backsector);
|
||||
|
||||
boolean do_texture_skew;
|
||||
|
||||
Reference in new issue
Block a user