- 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
This commit is contained in:
Jan Engelhardt 2022-08-08 14:22:45 +00:00 committed by Git OBS Bridge
parent a654d10b0a
commit cfbc6d7aeb
3 changed files with 38 additions and 0 deletions

View File

@ -0,0 +1,31 @@
From 940352955ffef7ab4113bc28a2454a8f66b8e3f7 Mon Sep 17 00:00:00 2001
From: David Gow <david@ingeniumdigital.com>
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

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Mon Aug 8 14:18:26 UTC 2022 - Jan Engelhardt <jengelh@inai.de>
- 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 <jengelh@inai.de>

View File

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