From 53fbbecbcdc6cafaeff13aee3db9821ee58df48f Mon Sep 17 00:00:00 2001 From: Alug Date: Tue, 14 Jul 2026 01:32:51 +0200 Subject: [PATCH 1/7] fix incrementing garbage in Portal_AddSkyboxPortals --- src/r_portal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/r_portal.c b/src/r_portal.c index 00baad528..f403c17c7 100644 --- a/src/r_portal.c +++ b/src/r_portal.c @@ -333,7 +333,7 @@ void Portal_AddSkyboxPortals(void) INT32 i; UINT16 count = 0; - for (i = 0; i < MAXVISPLANES; i++, pl++) + for (i = 0; i < MAXVISPLANES; i++) { for (pl = visplanes[i]; pl; pl = pl->next) { From d0f02f15308e1a5ebfc7a25d281f00be6f889a77 Mon Sep 17 00:00:00 2001 From: Alug Date: Tue, 14 Jul 2026 09:40:20 +0200 Subject: [PATCH 2/7] remove pointless skybox check here if skybox then newview->sky will be false there which R_DrawSkyPlanes will check for --- src/r_main.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/r_main.cpp b/src/r_main.cpp index d6fe70c2d..ad8f1aa0a 100644 --- a/src/r_main.cpp +++ b/src/r_main.cpp @@ -1525,8 +1525,7 @@ void R_RenderPlayerView(player_t *player) R_SetColumnContext(COLUMNCONTEXT_DIRECT); PS_START_TIMING(ps_sw_planetime); - if (!skybox) - R_DrawSkyPlanes(); + R_DrawSkyPlanes(); R_DrawPlanes(); PS_STOP_TIMING(ps_sw_planetime); // draw mid texture and sprite From 28c4061a26f067c6a70b13c4acddc1856bd45740 Mon Sep 17 00:00:00 2001 From: Alug Date: Tue, 14 Jul 2026 09:39:14 +0200 Subject: [PATCH 3/7] remove viewsky which doesent exist lol --- src/r_state.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/r_state.h b/src/r_state.h index 0431525e7..5e226103b 100644 --- a/src/r_state.h +++ b/src/r_state.h @@ -90,7 +90,7 @@ extern side_t *sides; extern fixed_t viewx, viewy, viewz; extern angle_t viewangle, aimingangle, viewroll; extern UINT8 viewssnum; // splitscreen view number -extern boolean viewsky, skyVisible; +extern boolean skyVisible; extern boolean skyVisiblePerPlayer[MAXSPLITSCREENPLAYERS]; // saved values of skyVisible of each splitscreen player extern sector_t *viewsector; extern player_t *viewplayer; From ee9c9e283945e4cd461c2f06da337688e6dd890b Mon Sep 17 00:00:00 2001 From: Alug Date: Tue, 14 Jul 2026 11:28:40 +0200 Subject: [PATCH 4/7] hack: fix paletterender stuff not applying to screenshots/gifs when using downsampling fbo this sucks but the final screen texture with the palette render postprocess step will not be in the downsample fbo so we have to redraw it there with the postprocess step...... this is still better than drawing another screen texture when using paletterender which costs perf --- src/hardware/r_opengl/r_opengl.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/hardware/r_opengl/r_opengl.c b/src/hardware/r_opengl/r_opengl.c index aff722773..0c04beb09 100644 --- a/src/hardware/r_opengl/r_opengl.c +++ b/src/hardware/r_opengl/r_opengl.c @@ -1465,6 +1465,19 @@ void GL_ReadScreenTexture(int tex, UINT8 *restrict dest, INT32 scale) if (tex != HWD_SCREENTEXTURE_GENERIC2) GL_DrawScreenTexture(tex, NULL, 0); +#ifdef USE_FBO_OGL + // FIXME: this is incredibly stupid + // but the final screen texture will NOT be drawn in the downsample fbo + if (tex == HWD_SCREENTEXTURE_GENERIC2 && + UseScreenFBO() && HWR_ShouldUsePaletteRendering()) + { + GL_SetShader(HWR_GetShaderFromTarget(SHADER_PALETTE_POSTPROCESS)); + GL_EnableShader(); + GL_DrawScreenTexture(HWD_SCREENTEXTURE_GENERIC2, NULL, 0); + GL_UnSetShader(); + } +#endif + image = malloc(screen_width*screen_height*3); pglPixelStorei(GL_PACK_ALIGNMENT, 1); pglReadPixels(0, 0, screen_width, screen_height, GL_RGB, GL_UNSIGNED_BYTE, image); From 7ee93d889eb41f16dc4c7670ca1b8c1332cb8fdb Mon Sep 17 00:00:00 2001 From: Alug Date: Thu, 16 Jul 2026 20:16:33 +0200 Subject: [PATCH 5/7] remove this from polyvertex_t was used for optimization but not used anymore --- src/hardware/hw_defs.h | 1 - 1 file changed, 1 deletion(-) diff --git a/src/hardware/hw_defs.h b/src/hardware/hw_defs.h index 6a8649099..ed4bff5a2 100644 --- a/src/hardware/hw_defs.h +++ b/src/hardware/hw_defs.h @@ -96,7 +96,6 @@ typedef struct typedef struct { float x, y, z; - fixed_t x2, y2, z2; } polyvertex_t; // a convex 'plane' polygon, clockwise order From a1127068df439077a6ad3cc8a86db78008d29503 Mon Sep 17 00:00:00 2001 From: Alug Date: Fri, 17 Jul 2026 22:42:24 +0200 Subject: [PATCH 6/7] fix wireframe potentially not disabling on toggle netupdate sucks ass --- src/hardware/hw_main.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/hardware/hw_main.cpp b/src/hardware/hw_main.cpp index fbd9702ce..562be50bb 100644 --- a/src/hardware/hw_main.cpp +++ b/src/hardware/hw_main.cpp @@ -3483,6 +3483,8 @@ static void HWR_SplitSprite(gl_vissprite_t *spr, const boolean papersprite) fixed_t v1x, v1y, v2x, v2y; INT32 shader = SHADER_NONE; + const boolean billboarding = (cv_glspritebillboarding.value && !cv_glshearing.value && !papersprite); + gpatch = spr->gpatch; // cache the patch in the graphics card memory @@ -3680,7 +3682,7 @@ static void HWR_SplitSprite(gl_vissprite_t *spr, const boolean papersprite) wallVerts[1].y = endbot; // The x and y only need to be adjusted in the case that it's not a papersprite - if (cv_glspritebillboarding.value && !cv_glshearing.value && !papersprite) + if (billboarding) { // Get the x and z of the vertices so billboarding draws correctly realheight = realbot - realtop; @@ -5451,6 +5453,8 @@ static void HWR_RenderViewpoint(gl_portal_t *rootportal, int stencil_level, bool { gl_portallist_t portallist; + const boolean wireframe = HWR_IsWireframeMode(); + player_t *viewplayer = &players[displayplayers[viewssnum]]; const float fpov = FixedToFloat(R_GetPlayerFov(viewplayer)); @@ -5511,7 +5515,7 @@ static void HWR_RenderViewpoint(gl_portal_t *rootportal, int stencil_level, bool } } - if (HWR_IsWireframeMode()) + if (wireframe) GL_SetSpecialState(HWD_SET_WIREFRAME, 1); // FIXME: perfstats does not account for portal rendering! @@ -5597,7 +5601,7 @@ static void HWR_RenderViewpoint(gl_portal_t *rootportal, int stencil_level, bool HWR_RenderDrawNodes(); - if (HWR_IsWireframeMode()) + if (wireframe) GL_SetSpecialState(HWD_SET_WIREFRAME, 0); HWR_FreePortalList(portallist); // always call this just in case From 6892c212d1483b1fb5a151480d0b571f6585315d Mon Sep 17 00:00:00 2001 From: Indev Date: Sun, 19 Jul 2026 03:31:09 +0300 Subject: [PATCH 7/7] Comment out stairjank particles for now, since spawning mobjs during P_TryMove may mess up some global variables --- src/p_map.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/p_map.c b/src/p_map.c index ce43c2235..646e88708 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -2613,7 +2613,9 @@ boolean P_TryMove(mobj_t *thing, fixed_t x, fixed_t y, boolean allowdropoff) if (cv_stairjanksfx.value) S_StartSoundAtVolume(thing, (thing->player->stairjank >= 8 ? sfx_s23b : sfx_s268), 192); // dont blast this at full volume lul - //if (!thing->player->stairjank) + // Can't spawn things during P_TryMove, because global variables :) + // TODO - move this elsewhere later, should probably be safe in K_KartPlayerThink or something + /*if (!thing->player->stairjank) { // 90 degrees to direction you're facing fixed_t dirx = -FINESINE(thing->angle>>ANGLETOFINESHIFT); @@ -2639,7 +2641,7 @@ boolean P_TryMove(mobj_t *thing, fixed_t x, fixed_t y, boolean allowdropoff) P_SetTarget(&spark->target, thing); //P_SetTarget(&spark->owner, thing); //spark->renderflags |= RF_REDUCEVFX; - } + }*/ thing->player->stairjank = 9; //thing->player->stairjank = 17;