From cfbc6d7aebbbcc09f2059d55563f6cfce654897e81082c42d660b1bcefe3f24a Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Mon, 8 Aug 2022 14:22:45 +0000 Subject: [PATCH] - Add 0001-Use-SDL_PIXELFORMAT_RGB888-for-24-bit-surfaces.patch to rectify BGR order in older schismtracker. OBS-URL: https://build.opensuse.org/package/show/games/sdl12_compat?expand=0&rev=15 --- ...XELFORMAT_RGB888-for-24-bit-surfaces.patch | 31 +++++++++++++++++++ sdl12_compat.changes | 6 ++++ sdl12_compat.spec | 1 + 3 files changed, 38 insertions(+) create mode 100644 0001-Use-SDL_PIXELFORMAT_RGB888-for-24-bit-surfaces.patch diff --git a/0001-Use-SDL_PIXELFORMAT_RGB888-for-24-bit-surfaces.patch b/0001-Use-SDL_PIXELFORMAT_RGB888-for-24-bit-surfaces.patch new file mode 100644 index 0000000..1f21085 --- /dev/null +++ b/0001-Use-SDL_PIXELFORMAT_RGB888-for-24-bit-surfaces.patch @@ -0,0 +1,31 @@ +From 940352955ffef7ab4113bc28a2454a8f66b8e3f7 Mon Sep 17 00:00:00 2001 +From: David Gow +Date: Mon, 2 May 2022 17:43:36 +0800 +Subject: [PATCH] Use SDL_PIXELFORMAT_RGB888 for 24-bit surfaces + +We're currently using SDL_PIXELFORMAT_RGB24, which results in +schismtracker being blue when resized (#183). + +While it's possible that RGB888 is wrong on big-endian systems, it at +least matches what we do for 16-bit (RGB565) and 32-bit (XRGB8888) +formats, so if we're wrong, we'll at least be consistently wrong. +--- + src/SDL12_compat.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/SDL12_compat.c b/src/SDL12_compat.c +index db22c30..78e4d7e 100644 +--- a/src/SDL12_compat.c ++++ b/src/SDL12_compat.c +@@ -5231,7 +5231,7 @@ SDL_SetVideoMode(int width, int height, int bpp, Uint32 flags12) + switch (bpp) { + case 8: appfmt = SDL_PIXELFORMAT_INDEX8; break; + case 16: appfmt = SDL_PIXELFORMAT_RGB565; FIXME("bgr instead of rgb?"); break; +- case 24: appfmt = SDL_PIXELFORMAT_RGB24; FIXME("bgr instead of rgb?"); break; ++ case 24: appfmt = SDL_PIXELFORMAT_RGB888; FIXME("bgr instead of rgb?"); break; + case 32: appfmt = SDL_PIXELFORMAT_XRGB8888; FIXME("bgr instead of rgb?"); break; + default: SDL20_SetError("Unsupported bits-per-pixel"); return NULL; + } +-- +2.37.1 + diff --git a/sdl12_compat.changes b/sdl12_compat.changes index 86c7e19..7fbeac3 100644 --- a/sdl12_compat.changes +++ b/sdl12_compat.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Aug 8 14:18:26 UTC 2022 - Jan Engelhardt + +- Add 0001-Use-SDL_PIXELFORMAT_RGB888-for-24-bit-surfaces.patch + to rectify BGR order in older schismtracker. + ------------------------------------------------------------------- Wed Jun 15 12:12:01 UTC 2022 - Jan Engelhardt diff --git a/sdl12_compat.spec b/sdl12_compat.spec index 57771bf..7a06996 100644 --- a/sdl12_compat.spec +++ b/sdl12_compat.spec @@ -30,6 +30,7 @@ Source8: baselibs.conf Source9: %name-rpmlintrc Patch1: 0001-SDL_GetWMInfo-work-like-1.2-when-SDL_SetVideoMode-ha.patch Patch2: 0001-Set-pixels-in-SDL_CreateYUVOverlay-Fix-164.patch +Patch3: 0001-Use-SDL_PIXELFORMAT_RGB888-for-24-bit-surfaces.patch BuildRequires: cmake BuildRequires: pkg-config BuildRequires: pkgconfig(sdl2)