From 4fcb41f6596c08084cb482ab4ad7d42910b2f57e Mon Sep 17 00:00:00 2001 From: Alug Date: Sun, 17 Aug 2025 18:18:53 +0200 Subject: [PATCH 1/2] mark stuff for blitting loop as const and with register gives another 5-7fps or so for me --- src/sdl/i_video.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/sdl/i_video.c b/src/sdl/i_video.c index d95d0afe2..ad92d1c27 100644 --- a/src/sdl/i_video.c +++ b/src/sdl/i_video.c @@ -1477,12 +1477,12 @@ void I_FinishUpdate(void) if (rendermode == render_soft && vid.screens[0]) { - SDL_LockSurface(vidSurface); // copy pixels ourselves to the video surface (prevents a crash in libsdl) - UINT32 *dst = vidSurface->pixels; - UINT8 *src = vid.screens[0]; - for (int32_t i = 0; i < vid.width * vid.height; i++) + UINT32 *restrict dst = vidSurface->pixels; + const UINT8 *restrict src = vid.screens[0]; + const INT32 count = vid.width * vid.height; + for (INT32 i = 0; i < count; i++) *dst++ = localPalette[*src++]; SDL_UnlockSurface(vidSurface); // Fury -- there's no way around UpdateTexture, the GL backend uses it anyway From 684a43a95c863e09b94830b8ae587b314197d6ae Mon Sep 17 00:00:00 2001 From: Alug Date: Mon, 18 Aug 2025 16:35:28 +0200 Subject: [PATCH 2/2] fix software extra 3d floors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit lmao was a copy paste oopsie from ages ago shoutout to phoenix´s new map making me find this --- src/r_plane.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/r_plane.cpp b/src/r_plane.cpp index dd4813794..94fbcae4b 100644 --- a/src/r_plane.cpp +++ b/src/r_plane.cpp @@ -1072,15 +1072,15 @@ void R_DrawSinglePlane(drawspandata_t* ds, visplane_t *pl, boolean allow_paralle { if ((pl->ffloor->flags & FF_CUTEXTRA) && (rover->flags & FF_EXTRA)) { - if (!(rover->flags & FF_EXTRA)) - continue; - - // The plane is from an extra 3D floor... Check the flags so - // there are no undesired cuts. - if (((pl->ffloor->flags & (FF_FOG|FF_SWIMMABLE)) == (rover->flags & (FF_FOG|FF_SWIMMABLE))) - && pl->height < *rover->topheight - && pl->height > *rover->bottomheight) - return; + if (pl->ffloor->flags & FF_EXTRA) + { + // The plane is from an extra 3D floor... Check the flags so + // there are no undesired cuts. + if (((pl->ffloor->flags & (FF_FOG|FF_SWIMMABLE)) == (rover->flags & (FF_FOG|FF_SWIMMABLE))) + && pl->height < *rover->topheight + && pl->height > *rover->bottomheight) + return; + } } }