Skip to content

Commit 5e4e88b

Browse files
committed
Flatten compatibility version checks for SDL_pixels.h.
1 parent 3cc519b commit 5e4e88b

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/SDLmzx.h

+8-8
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,14 @@ static inline void SDL_SetJoystickEventsEnabled(boolean enabled)
313313
/**
314314
* SDL_pixels.h
315315
*/
316+
#if !SDL_VERSION_ATLEAST(2,0,5)
317+
/* Convenience macros added in 2.0.5. */
318+
#if SDL_BYTEORDER == SDL_BIG_ENDIAN
319+
#define SDL_PIXELFORMAT_RGBA32 SDL_PIXELFORMAT_RGBA8888
320+
#else
321+
#define SDL_PIXELFORMAT_RGBA32 SDL_PIXELFORMAT_ABGR8888
322+
#endif
323+
#endif
316324
#if !SDL_VERSION_ATLEAST(2,0,14)
317325
/* Added in 2.0.14 with the old names remaining; old names removed in SDL3. */
318326
#define SDL_PIXELFORMAT_XRGB4444 SDL_PIXELFORMAT_RGB444
@@ -328,14 +336,6 @@ static inline void SDL_SetJoystickEventsEnabled(boolean enabled)
328336
#define SDL_DestroyPalette(p) SDL_FreePalette(p)
329337
#define SDL_GetMasksForPixelFormat(f,b,R,G,B,A) SDL_PixelFormatEnumToMasks(f,b,R,G,B,A)
330338

331-
#if !SDL_VERSION_ATLEAST(2,0,5)
332-
#if SDL_BYTEORDER == SDL_BIG_ENDIAN
333-
#define SDL_PIXELFORMAT_RGBA32 SDL_PIXELFORMAT_RGBA8888
334-
#else
335-
#define SDL_PIXELFORMAT_RGBA32 SDL_PIXELFORMAT_ABGR8888
336-
#endif
337-
#endif
338-
339339
static inline Uint32 SDL_MapSurfaceRGBA(SDL_Surface *surface,
340340
Uint8 r, Uint8 g, Uint8 b, Uint8 a)
341341
{

0 commit comments

Comments
 (0)