soft: fix texture lock

Regression is introduced in 39d2c7dbb4
as sdl3 has changed logic of SDL_LockTexture function call.
This commit is contained in:
Denis Pauk 2024-10-06 18:37:59 +03:00
parent 6408cc7099
commit 14db96211b

View file

@ -2194,7 +2194,11 @@ RE_CleanFrame(void)
memset(swap_buffers, 0, memset(swap_buffers, 0,
vid_buffer_height * vid_buffer_width * sizeof(pixel_t) * 2); vid_buffer_height * vid_buffer_width * sizeof(pixel_t) * 2);
#ifdef USE_SDL3
if (!SDL_LockTexture(texture, NULL, (void**)&pixels, &pitch)) 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()); Com_Printf("Can't lock texture: %s\n", SDL_GetError());
return; return;
@ -2214,7 +2218,11 @@ RE_FlushFrame(int vmin, int vmax)
int pitch; int pitch;
Uint32 *pixels; Uint32 *pixels;
#ifdef USE_SDL3
if (!SDL_LockTexture(texture, NULL, (void**)&pixels, &pitch)) 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()); Com_Printf("Can't lock texture: %s\n", SDL_GetError());
return; return;