Cull BSP behind a raised floor or lowered ceiling that covers the entire screen

https://git.do.srb2.org/KartKrew/RingRacers/-/commit/7b8a564f69688515319ccd425f2b88ffe8b7b120
This commit is contained in:
Alug committed 2024-05-25 02:02:06 +02:00
1 parent 0393588fe8
commit c1a9c58eb5
3 files changed
+29 -15

No files matched your search

+14 -4
View File
@@ -39,6 +39,10 @@ drawseg_t *ds_p = NULL;
// indicates doors closed wrt automap bugfix:
INT32 doorclosed;
// A wall was drawn covering the whole screen, which means we
// can block off the BSP across that seg.
boolean g_walloffscreen;
boolean R_NoEncore(sector_t *sector, boolean ceiling)
{
boolean invertencore = (GETSECSPECIAL(sector->special, 2) == 15);
@@ -84,7 +88,7 @@ void R_AllocClipSegMemory(void)
//
// Replaces the old R_Clip*WallSegment functions. It draws bits of walls in those
// columns which aren't solid, and updates the solidcol[] array appropriately
static void R_ClipWallSegment(INT32 first, INT32 last, boolean solid)
static void R_ClipWallSegment(INT32 first, INT32 last, boolean solid, boolean soliddontrender)
{
while (first < last)
{
@@ -108,7 +112,8 @@ static void R_ClipWallSegment(INT32 first, INT32 last, boolean solid)
else
to = p - solidcol;
R_StoreWallRange(first, to-1);
if (!soliddontrender)
R_StoreWallRange(first, to-1);
if (solid)
memset(solidcol+first, 1, to-first);
@@ -492,11 +497,16 @@ static void R_AddLine(seg_t *line)
return;
clippass:
R_ClipWallSegment(x1, x2, false);
g_walloffscreen = false;
if (g_walloffscreen)
R_ClipWallSegment(x1, x2, false , true);
else
R_ClipWallSegment(x1, x2, false , false);
return;
clipsolid:
R_ClipWallSegment(x1, x2, true);
g_walloffscreen = false;
R_ClipWallSegment(x1, x2, false , false);
}
//
+1
View File
@@ -32,6 +32,7 @@ extern INT32 checkcoord[12][4];
extern drawseg_t *drawsegs;
extern drawseg_t *ds_p;
extern INT32 doorclosed;
extern boolean g_walloffscreen;
extern UINT8 *solidcol;
+14 -11
View File
@@ -2577,23 +2577,26 @@ void R_StoreWallRange(INT32 start, INT32 stop)
if (toptexture)
{
pixhigh = (centeryfrac>>4) - FixedMul (worldhigh, rw_scale);
pixhighstep = -FixedMul (rw_scalestep,worldhigh);
fixed_t topfracend = (centeryfrac>>4) - FixedMul (worldhighslope, ds_p->scale2);
if (backsector->c_slope) {
fixed_t topfracend = (centeryfrac>>4) - FixedMul (worldhighslope, ds_p->scale2);
pixhighstep = (topfracend-pixhigh)/(range);
}
pixhigh = (centeryfrac>>4) - FixedMul (worldhigh, rw_scale);
pixhighstep = (topfracend-pixhigh)/(range);
// If the lowest part of a ceiling stretching down covers the entire screen
if (min(pixhigh, topfracend)>>HEIGHTBITS >= viewheight-1)
g_walloffscreen = true;
}
if (bottomtexture)
{
fixed_t bottomfracend = (centeryfrac>>4) - FixedMul (worldlowslope, ds_p->scale2);
pixlow = (centeryfrac>>4) - FixedMul (worldlow, rw_scale);
pixlowstep = -FixedMul (rw_scalestep,worldlow);
if (backsector->f_slope) {
fixed_t bottomfracend = (centeryfrac>>4) - FixedMul (worldlowslope, ds_p->scale2);
pixlowstep = (bottomfracend-pixlow)/(range);
}
pixlowstep = (bottomfracend-pixlow)/(range);
// If the highest part of a floor stretching up covers the entire screen
if ((max(pixlow, bottomfracend)+HEIGHTUNIT-1)>>HEIGHTBITS <= 0)
g_walloffscreen = true;
}
{