From 14db96211bb917089ec811299ac391e10b039ead Mon Sep 17 00:00:00 2001 From: Denis Pauk Date: Sun, 6 Oct 2024 18:37:59 +0300 Subject: [PATCH] soft: fix texture lock Regression is introduced in 39d2c7dbb45d53678e82baa1e727d2647d5ee755 as sdl3 has changed logic of SDL_LockTexture function call. --- src/client/refresh/soft/sw_main.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/client/refresh/soft/sw_main.c b/src/client/refresh/soft/sw_main.c index 3de28d2f..a45f5ebd 100644 --- a/src/client/refresh/soft/sw_main.c +++ b/src/client/refresh/soft/sw_main.c @@ -2194,7 +2194,11 @@ RE_CleanFrame(void) memset(swap_buffers, 0, vid_buffer_height * vid_buffer_width * sizeof(pixel_t) * 2); +#ifdef USE_SDL3 if (!SDL_LockTexture(texture, NULL, (void**)&pixels, &pitch)) +#else + if (SDL_LockTexture(texture, NULL, (void**)&pixels, &pitch)) +#endif { Com_Printf("Can't lock texture: %s\n", SDL_GetError()); return; @@ -2214,7 +2218,11 @@ RE_FlushFrame(int vmin, int vmax) int pitch; Uint32 *pixels; +#ifdef USE_SDL3 if (!SDL_LockTexture(texture, NULL, (void**)&pixels, &pitch)) +#else + if (SDL_LockTexture(texture, NULL, (void**)&pixels, &pitch)) +#endif { Com_Printf("Can't lock texture: %s\n", SDL_GetError()); return;