From 42801eb92469f2cfcec999faf8c9efb4b30d390d Mon Sep 17 00:00:00 2001 From: Alug Date: Mon, 27 Oct 2025 18:16:33 +0100 Subject: [PATCH] make this stuff less stoopid lel --- src/hardware/hw_main.cpp | 23 ++++++++--------------- src/hardware/hw_main.h | 3 --- src/p_setup.c | 11 ----------- 3 files changed, 8 insertions(+), 29 deletions(-) diff --git a/src/hardware/hw_main.cpp b/src/hardware/hw_main.cpp index b2103dafe..ffde07768 100644 --- a/src/hardware/hw_main.cpp +++ b/src/hardware/hw_main.cpp @@ -93,7 +93,8 @@ sector_t *gl_backsector; static constexpr float clipping_distances[] = {1024.0f, 2048.0f, 4096.0f, 6144.0f, 8192.0f, 12288.0f, 16384.0f}; // values for bsp culling // slightly higher than the far clipping plane to compensate for impreciseness -static constexpr INT32 bsp_culling_distances[] = {(1024+512)*FRACUNIT, (2048+512)*FRACUNIT, (4096+512)*FRACUNIT, +static constexpr INT32 bsp_culling_distances[] = { + (1024+512)*FRACUNIT, (2048+512)*FRACUNIT, (4096+512)*FRACUNIT, (6144+512)*FRACUNIT, (8192+512)*FRACUNIT, (12288+512)*FRACUNIT, (16384+512)*FRACUNIT}; // Performance stats @@ -113,9 +114,6 @@ ps_metric_t ps_hw_numcolors = {}; ps_metric_t ps_hw_batchsorttime = {}; ps_metric_t ps_hw_batchdrawtime = {}; -// terrible optimization -boolean havesnakerpad = 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); @@ -691,20 +689,15 @@ static void HWR_RenderPlane(subsector_t *subsector, extrasubsector_t *xsub, bool if (slope) lightlevel = HWR_CalcSlopeLight(lightlevel, slope, gl_frontsector, (FOFsector != NULL)); - if (subsector && havesnakerpad && (lightlevel != 255) && (lumpnum != LUMPERROR)) + // sneaker panel patches are either 64x64 or 128x128 + if (lightlevel < 255 && (flatflag == 63 || flatflag == 127) + && GETSECSPECIAL(sec->special, 4) == 6) // check if it has sneaker panel special { - const sector_t *sec = subsector->sector; + const char *name = W_CheckNameForNum(lumpnum); - if (sec) + if (name && memcmp(name, "BOST", 4) == 0) // active panel patches { - const char *name = W_CheckNameForNum(lumpnum); - - if (name && memcmp(name, "BOST", 4) == 0) // kart sneakerpad - { - // check if it has sneaker panel special - if ((GETSECSPECIAL(sec->special, 4) == 6) || ((FOFsector != NULL) && (GETSECSPECIAL(FOFsector->special, 4) == 6))) // check the fof sector aswell - lightlevel = 255; - } + lightlevel = 255; } } diff --git a/src/hardware/hw_main.h b/src/hardware/hw_main.h index c2001caff..30906b611 100644 --- a/src/hardware/hw_main.h +++ b/src/hardware/hw_main.h @@ -84,9 +84,6 @@ extern ps_metric_t ps_hw_batchdrawtime; extern boolean gl_shadersavailable; -// terrible optimization lmao -extern boolean havesnakerpad; - // hw_draw.c void HWR_DrawStretchyFixedPatch(patch_t *gpatch, fixed_t x, fixed_t y, fixed_t pscale, fixed_t vscale, INT32 option, const UINT8 *colormap, INT32 bflags); void HWR_DrawCroppedPatch(patch_t *gpatch, fixed_t x, fixed_t y, fixed_t pscale, INT32 option, fixed_t sx, fixed_t sy, fixed_t w, fixed_t h); diff --git a/src/p_setup.c b/src/p_setup.c index 127f2b9b6..930adac45 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -686,13 +686,6 @@ INT32 P_AddLevelFlat(const char *flatname, levelflat_t *levelflat) levelflat->lumpnum = R_GetFlatNumForName(flatname); levelflat->baselumpnum = LUMPERROR; -#ifdef HWRENDER - if (!havesnakerpad && memcmp(levelflat->name, "BOST", 4) == 0) - { - havesnakerpad = true; - } -#endif - P_CheckCyanFlat(levelflat); #ifndef ZDEBUG @@ -803,10 +796,6 @@ static void P_LoadSectors(UINT8 *data) numlevelflats = 0; -#ifdef HWRENDER - havesnakerpad = false; -#endif - // 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++) {