crappy optimization

check first if any of those flats exist lel
This commit is contained in:
Alug committed 2024-12-26 20:50:56 +01:00
1 parent 0c58f66fd8
commit 75309ff21b
3 files changed
+48 -18

No files matched your search

+26 -18
View File
@@ -118,6 +118,11 @@ ps_metric_t ps_hw_numcolors = {0};
ps_metric_t ps_hw_batchsorttime = {0};
ps_metric_t ps_hw_batchdrawtime = {0};
// terrible optimization
boolean havesnakerpad = false;
boolean havepazrcst = false;
boolean havefaytpad = false;
static void HWR_SplitWall(sector_t *sector, FOutVector *wallVerts, INT32 texnum, boolean noencore, FSurfaceInfo* Surf, INT32 cutflag, ffloor_t *pfloor, FBITFIELD polyflags);
static void HWR_RenderWall(FOutVector *wallVerts, FSurfaceInfo *pSurf, FBITFIELD blend, boolean fogwall, INT32 lightlevel, extracolormap_t *wallcolormap);
@@ -692,28 +697,31 @@ static void HWR_RenderPlane(subsector_t *subsector, extrasubsector_t *xsub, bool
if (slope)
lightlevel = HWR_CalcSlopeLight(lightlevel, slope, gl_frontsector, (FOFsector != NULL));
if ((lightlevel != 255) && subsector && subsector->sector && (lumpnum != LUMPERROR))
if (havesnakerpad || havepazrcst || havefaytpad)
{
const char *name = W_CheckNameForNum(lumpnum);
if (name)
if ((lightlevel != 255) && subsector && subsector->sector && (lumpnum != LUMPERROR))
{
// kart sneakerpad
if (memcmp(name, "BOST", 4) == 0)
{
if (GETSECSPECIAL(subsector->sector->special, 4) == 6)
lightlevel = 255;
const char *name = W_CheckNameForNum(lumpnum);
// check the fof sector aswell
if (FOFsector != NULL)
{
if (GETSECSPECIAL(FOFsector->special, 4) == 6)
lightlevel = 255;
}
}
else if ((memcmp(name, "PAZRCST", 7) == 0) || (memcmp(name, "FSBOST", 6) == 0)) // fayt sneakerpads lel
if (name)
{
lightlevel = 255;
// kart sneakerpad
if (havesnakerpad && memcmp(name, "BOST", 4) == 0)
{
if (GETSECSPECIAL(subsector->sector->special, 4) == 6)
lightlevel = 255;
// check the fof sector aswell
if (FOFsector != NULL)
{
if (GETSECSPECIAL(FOFsector->special, 4) == 6)
lightlevel = 255;
}
}
else if ((havepazrcst && (memcmp(name, "PAZRCST", 7) == 0)) || (havefaytpad && (memcmp(name, "FSBOST", 6) == 0))) // fayt sneakerpads lel
{
lightlevel = 255;
}
}
}
}
+5
View File
@@ -82,6 +82,11 @@ extern ps_metric_t ps_hw_batchdrawtime;
extern boolean gl_shadersavailable;
// terrible optimization lmao
extern boolean havesnakerpad;
extern boolean havepazrcst;
extern boolean havefaytpad;
// hw_draw.c
void HWR_DrawPatch(GLPatch_t *gpatch, INT32 x, INT32 y, INT32 option);
void HWR_DrawStretchyFixedPatch(GLPatch_t *gpatch, fixed_t x, fixed_t y, fixed_t pscale, fixed_t vscale, INT32 option, const UINT8 *colormap);
+17
View File
@@ -686,6 +686,19 @@ INT32 P_AddLevelFlat(const char *flatname, levelflat_t *levelflat)
// store the flat lump number
levelflat->lumpnum = R_GetFlatNumForName(flatname);
if (!havesnakerpad && memcmp(levelflat->name, "BOST", 4) == 0)
{
havesnakerpad = true;
}
if (!havepazrcst && memcmp(levelflat->name, "PAZRCST", 7) == 0)
{
havepazrcst = true;
}
if (!havefaytpad && memcmp(levelflat->name, "FSBOST", 6) == 0)
{
havefaytpad= true;
}
#ifndef ZDEBUG
CONS_Debug(DBG_SETUP, "flat #%03d: %s\n", atoi(sizeu1(numlevelflats)), levelflat->name);
#endif
@@ -780,6 +793,10 @@ static void P_LoadRawSectors(UINT8 *data)
numlevelflats = 0;
havesnakerpad = false;
havepazrcst = false;
havefaytpad = false;
// For each counted sector, copy the sector raw data from our cache pointer ms, to the global table pointer ss.
for (i = 0; i < numsectors; i++, ss++, ms++)
{