From 6dad3f48fa09e6148b7cfb83cfc65bedc91c6feb Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Mon, 7 Aug 2023 22:47:57 -0700
Subject: [PATCH] Fixed testautomation --filter pixels_getPixelFormatName
---
src/sdl2_compat.c | 13 +++++++++++++
src/sdl3_syms.h | 2 +-
2 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/src/sdl2_compat.c b/src/sdl2_compat.c
index 3991dfa..e698ce3 100644
--- a/src/sdl2_compat.c
+++ b/src/sdl2_compat.c
@@ -5378,6 +5378,19 @@ SDL_SetCursor(SDL_Cursor * cursor)
SDL3_SetCursor(cursor);
}
+DECLSPEC const char *
+SDL_GetPixelFormatName(Uint32 format)
+{
+ switch (format) {
+ case SDL_PIXELFORMAT_XRGB8888:
+ return "SDL_PIXELFORMAT_RGB888";
+ case SDL_PIXELFORMAT_XBGR8888:
+ return "SDL_PIXELFORMAT_BGR888";
+ default:
+ return SDL3_GetPixelFormatName(format);
+ }
+}
+
DECLSPEC void SDLCALL
SDL_FreeFormat(SDL_PixelFormat *format)
{
diff --git a/src/sdl3_syms.h b/src/sdl3_syms.h
index 6077884..bf0cd77 100644
--- a/src/sdl3_syms.h
+++ b/src/sdl3_syms.h
@@ -255,7 +255,7 @@ SDL3_SYM_RENAMED(int,CondSignal,SignalCondition,(SDL_Condition *a),(a),return)
SDL3_SYM_RENAMED(int,CondBroadcast,BroadcastCondition,(SDL_Condition *a),(a),return)
SDL3_SYM_RENAMED(int,CondWait,WaitCondition,(SDL_Condition *a, SDL_Mutex *b),(a,b),return)
SDL3_SYM(int,WaitConditionTimeout,(SDL_Condition *a, SDL_Mutex *b, Sint32 c),(a,b,c),return)
-SDL3_SYM_PASSTHROUGH(const char*,GetPixelFormatName,(Uint32 a),(a),return)
+SDL3_SYM(const char*,GetPixelFormatName,(Uint32 a),(a),return)
SDL3_SYM_RENAMED(SDL_bool,PixelFormatEnumToMasks,GetMasksForPixelFormatEnum,(Uint32 a, int *b, Uint32 *c, Uint32 *d, Uint32 *e, Uint32 *f),(a,b,c,d,e,f),return)
SDL3_SYM_RENAMED(Uint32,MasksToPixelFormatEnum,GetPixelFormatEnumForMasks,(int a, Uint32 b, Uint32 c, Uint32 d, Uint32 e),(a,b,c,d,e),return)
SDL3_SYM_RENAMED(SDL_PixelFormat*,AllocFormat,CreatePixelFormat,(Uint32 a),(a),return)