From ab5fac59b4dfc3e834e0f67afc1b95c288c4e8fa Mon Sep 17 00:00:00 2001 From: Kylie C Date: Fri, 5 Sep 2025 01:27:21 -0400 Subject: [PATCH] bool conversion forgot these --- 3rdparty/sdl3-shim/SDL3/SDL.h | 8 ++++---- 3rdparty/sdl3-shim/SDL3/SDL_audio.h | 2 +- 3rdparty/sdl3-shim/SDL3/SDL_surface.h | 4 +--- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/3rdparty/sdl3-shim/SDL3/SDL.h b/3rdparty/sdl3-shim/SDL3/SDL.h index e62d2e05..548b3b6b 100644 --- a/3rdparty/sdl3-shim/SDL3/SDL.h +++ b/3rdparty/sdl3-shim/SDL3/SDL.h @@ -94,7 +94,7 @@ inline SDL_DisplayMode* SDL_GetCurrentDisplayMode(SDL_DisplayID displayID) // hardcode -1 as all uses are NULL or -1 (hacks out failure) #define SDL_CreateRenderer(window, name) SDL_CreateRenderer(window, -1, 0) -#define SDL_RenderTexture SDL_RenderCopyF +#define SDL_RenderTexture(...) (SDL_RenderCopyF(__VA_ARGS__) == 0) // https://wiki.libsdl.org/SDL3/README-migration#sdl_haptich // SDL_MouseID/SDL_KeyboardID are new @@ -109,8 +109,8 @@ typedef int SDL_HapticID; #define SDL_OpenHaptic SDL_HapticOpen #define SDL_OpenHapticFromJoystick SDL_HapticOpenFromJoystick #define SDL_OpenHapticFromMouse SDL_HapticOpenFromMouse -#define SDL_InitHapticRumble SDL_HapticRumbleInit -#define SDL_PlayHapticRumble SDL_HapticRumblePlay +#define SDL_InitHapticRumble(...) (SDL_HapticRumbleInit(__VA_ARGS__) == 0) +#define SDL_PlayHapticRumble(...) (SDL_HapticRumblePlay(__VA_ARGS__) == 0) #define SDL_GetHapticID SDL_HapticIndex @@ -143,7 +143,7 @@ inline SDL_HapticID* SDL_GetHaptics(int *count) // https://wiki.libsdl.org/SDL3/README-migration#sdl_videoh #define SDL_GetDisplayForWindow SDL_GetWindowDisplayIndex -#define SDL_SetWindowFullscreenMode SDL_SetWindowDisplayMode +#define SDL_SetWindowFullscreenMode(...) (SDL_SetWindowDisplayMode(__VA_ARGS__) == 0) // #define SDL_GetClosestFullscreenDisplayMode SDL_GetClosestDisplayMode inline bool SDL_GetClosestFullscreenDisplayMode(SDL_DisplayID displayID, int w, int h, float refresh_rate, bool include_high_density_modes, SDL_DisplayMode *closest) { diff --git a/3rdparty/sdl3-shim/SDL3/SDL_audio.h b/3rdparty/sdl3-shim/SDL3/SDL_audio.h index 397f356e..43178147 100644 --- a/3rdparty/sdl3-shim/SDL3/SDL_audio.h +++ b/3rdparty/sdl3-shim/SDL3/SDL_audio.h @@ -54,7 +54,7 @@ static void SDLCALL shim_audio_callback(void *userdata, Uint8 *stream, int len) } #define SDL_ResumeAudioDevice(device) SDL_PauseAudioDevice(device, 0) -#define SDL_PutAudioStreamData SDL_AudioStreamPut +#define SDL_PutAudioStreamData(...) (SDL_AudioStreamPut(__VA_ARGS__) == 0) inline SDL_AudioDeviceID SDL_GetAudioStreamDevice(SDL_AudioStream* stream) { diff --git a/3rdparty/sdl3-shim/SDL3/SDL_surface.h b/3rdparty/sdl3-shim/SDL3/SDL_surface.h index d943eee4..eaf2241a 100644 --- a/3rdparty/sdl3-shim/SDL3/SDL_surface.h +++ b/3rdparty/sdl3-shim/SDL3/SDL_surface.h @@ -14,8 +14,6 @@ struct SDL_SurfaceShim : SDL_Surface { #define SDL_FillSurfaceRect(...) (SDL_FillRect(__VA_ARGS__) == 0) -// #define SDL_ConvertSurface(...) SDL_ConvertSurface(__VA_ARGS__, 0) - #define SDL_DestroySurface SDL_FreeSurface #define SDL_CreateSurface(width, height, format) (SDL_Surface*)SDL_CreateRGBSurfaceWithFormat(0 , width, height, SDL_BITSPERPIXEL(format) ,format) @@ -30,7 +28,7 @@ inline SDL_Surface* SDL_ConvertSurface(SDL_Surface* surface, SDL_PixelFormat for #define SDL_SCALEMODE_NEAREST SDL_ScaleModeNearest #define SDL_BlitSurfaceScaled(surface, rect, destSurface, destRect, scaleMode) (SDL_BlitScaled(surface, rect, destSurface, destRect) == 0) -#define SDL_SetSurfaceColorKey SDL_SetColorKey +#define SDL_SetSurfaceColorKey(...) (SDL_SetColorKey(__VA_ARGS__) == 0) #define SDL_LoadBMP_IO (SDL_Surface*)SDL_LoadBMP_RW #define SDL_LoadBMP(file) (SDL_Surface*)SDL_LoadBMP_RW(SDL_RWFromFile(file, "rb"), 1) //yoinked the existing SDL_LoadBMP macro so it could be cast