From 65b41cc59fb72b5e5e8b31dc6006df6ab30a2568 Mon Sep 17 00:00:00 2001 From: Alug Date: Fri, 10 Oct 2025 21:52:50 +0200 Subject: [PATCH] merge I_ReadScreen loops both did the same thing --- src/sdl/i_video.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/sdl/i_video.c b/src/sdl/i_video.c index cd0f6c837..054efe3db 100644 --- a/src/sdl/i_video.c +++ b/src/sdl/i_video.c @@ -1415,17 +1415,10 @@ void I_ReadScreen(UINT8 * restrict scr, INT32 scale) { if (rendermode != render_soft) I_Error("I_ReadScreen: called while in non-software mode"); - else if (scale == 1) - { - UINT8 *buffer = vid.screens[0]; - - for (int y = 0; y < vid.height; y++) - for (int x = 0; x < vid.width; x++) - scr[(y * vid.width) + x] = buffer[(x * vid.height) + y]; - } else { UINT8 * restrict source = vid.screens[0]; + uintptr_t w = vid.width/scale*scale, h = vid.height/scale*scale; // size_t saves a lea + movsxd over INT32. mind your types!