bool conversion

forgot these
This commit is contained in:
Kylie C 2025-09-05 01:27:21 -04:00
parent 6ac4693c0b
commit ab5fac59b4
3 changed files with 6 additions and 8 deletions

View File

@ -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)
{

View File

@ -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)
{

View File

@ -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