From 6b5cc9a6173785c82b15f770ede2ce0e26a10b0d9813ae4053d4fb99aaa1ec47 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Wed, 26 Oct 2022 17:13:08 +0000 Subject: [PATCH 1/2] - Update to release 1.2.60 OBS-URL: https://build.opensuse.org/package/show/games/sdl12_compat?expand=0&rev=17 --- ...rk-like-1.2-when-SDL_SetVideoMode-ha.patch | 70 ------------------- ...xels-in-SDL_CreateYUVOverlay-Fix-164.patch | 39 ----------- ...XELFORMAT_RGB888-for-24-bit-surfaces.patch | 31 -------- release-1.2.52.tar.gz | 3 - release-1.2.60.tar.gz | 3 + sdl12_compat.changes | 18 +++++ sdl12_compat.spec | 5 +- 7 files changed, 22 insertions(+), 147 deletions(-) delete mode 100644 0001-SDL_GetWMInfo-work-like-1.2-when-SDL_SetVideoMode-ha.patch delete mode 100644 0001-Set-pixels-in-SDL_CreateYUVOverlay-Fix-164.patch delete mode 100644 0001-Use-SDL_PIXELFORMAT_RGB888-for-24-bit-surfaces.patch delete mode 100644 release-1.2.52.tar.gz create mode 100644 release-1.2.60.tar.gz diff --git a/0001-SDL_GetWMInfo-work-like-1.2-when-SDL_SetVideoMode-ha.patch b/0001-SDL_GetWMInfo-work-like-1.2-when-SDL_SetVideoMode-ha.patch deleted file mode 100644 index 2c49fc2..0000000 --- a/0001-SDL_GetWMInfo-work-like-1.2-when-SDL_SetVideoMode-ha.patch +++ /dev/null @@ -1,70 +0,0 @@ -From 32bcfa763d90cd2391493a396f21b98716b52bda Mon Sep 17 00:00:00 2001 -From: "Ryan C. Gordon" -Date: Tue, 8 Mar 2022 15:19:41 -0500 -Subject: [PATCH] SDL_GetWMInfo: work like 1.2 when SDL_SetVideoMode() hasn't - been called yet. - -Fixes #163. ---- - src/SDL12_compat.c | 24 +++++++++++++++++++++--- - 1 file changed, 21 insertions(+), 3 deletions(-) - -diff --git a/src/SDL12_compat.c b/src/SDL12_compat.c -index b5a851b..ea99f2c 100644 ---- a/src/SDL12_compat.c -+++ b/src/SDL12_compat.c -@@ -6218,6 +6218,9 @@ DECLSPEC int SDLCALL - SDL_GetWMInfo(SDL12_SysWMinfo *info12) - { - SDL_SysWMinfo info20; -+ SDL_bool temp_window = SDL_FALSE; -+ SDL_Window *win20 = VideoWindow20; -+ int rc; - - if (info12->version.major > 1) { - SDL20_SetError("Requested version is unsupported"); -@@ -6227,15 +6230,30 @@ SDL_GetWMInfo(SDL12_SysWMinfo *info12) - return 0; /* some programs only test against 0, not -1 */ - } - -+ if (win20 == NULL) { -+ /* It was legal to call SDL_GetWMInfo without SDL_SetVideoMode() on X11 and Windows (and others...?) in 1.2. */ -+ win20 = SDL20_CreateWindow("SDL_GetWMInfo support window", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 128, 128, SDL_WINDOW_HIDDEN); -+ if (!win20) { -+ return 0; -+ } -+ temp_window = SDL_TRUE; -+ } -+ - SDL_zero(info20); - SDL_VERSION(&info20.version); -- if (!SDL20_GetWindowWMInfo(VideoWindow20, &info20)) { -+ rc = SDL20_GetWindowWMInfo(win20, &info20); -+ -+ if (temp_window) { -+ SDL20_DestroyWindow(win20); -+ } -+ -+ if (!rc) { - return 0; /* some programs only test against 0, not -1 */ - } - - #if defined(SDL_VIDEO_DRIVER_WINDOWS) - SDL_assert(info20.subsystem == SDL_SYSWM_WINDOWS); -- info12->window = info20.info.win.window; -+ info12->window = temp_window ? 0 : info20.info.win.window; - if (SDL_VERSIONNUM(info12->version.major, info12->version.minor, info12->version.patch) >= SDL_VERSIONNUM(1, 2, 5)) { - info12->hglrc = (HGLRC) VideoGLContext20; - } -@@ -6243,7 +6261,7 @@ SDL_GetWMInfo(SDL12_SysWMinfo *info12) - SDL_assert(info20.subsystem == SDL_SYSWM_X11); - info12->subsystem = SDL12_SYSWM_X11; - info12->info.x11.display = info20.info.x11.display; -- info12->info.x11.window = info20.info.x11.window; -+ info12->info.x11.window = temp_window ? 0 : info20.info.x11.window; - if (SDL_VERSIONNUM(info12->version.major, info12->version.minor, info12->version.patch) >= SDL_VERSIONNUM(1, 0, 2)) { - info12->info.x11.fswindow = 0; /* these don't exist in SDL2. */ - info12->info.x11.wmwindow = 0; --- -2.36.1 - diff --git a/0001-Set-pixels-in-SDL_CreateYUVOverlay-Fix-164.patch b/0001-Set-pixels-in-SDL_CreateYUVOverlay-Fix-164.patch deleted file mode 100644 index 3b73a88..0000000 --- a/0001-Set-pixels-in-SDL_CreateYUVOverlay-Fix-164.patch +++ /dev/null @@ -1,39 +0,0 @@ -From f4980108b0fbe59e04aaba6b18be760a607ab923 Mon Sep 17 00:00:00 2001 -From: David Gow -Date: Mon, 7 Mar 2022 16:01:50 +0800 -Subject: [PATCH] Set 'pixels' in SDL_CreateYUVOverlay() (Fix #164) - -Some applications, such as mplayer with -vo sdl will access the 'pixels' -member of an SDL_Overlay immediately after creating it, without ever -locking it. This works on (at least some backends for) SDL 1.2, but -crashed on sdl12-compat, as pixels remained unset until -SDL_LockYUVOverlay() is called. - -Set pixels in SDL_CreateYUVOverlay(), as well as hwdata->dirty, which -makes it possible to have a working YUV overlay without ever -locking/unlocking it. This is required for mplayer's sdl vo backend to -function. - -Fixes issue #164 ---- - src/SDL12_compat.c | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/src/SDL12_compat.c b/src/SDL12_compat.c -index b3a411e..b5a851b 100644 ---- a/src/SDL12_compat.c -+++ b/src/SDL12_compat.c -@@ -6337,6 +6337,10 @@ SDL_CreateYUVOverlay(int w, int h, Uint32 format12, SDL12_Surface *display12) - retval->hw_overlay = 1; - retval->pitches = hwdata->pitches; - -+ /* Some programs (e.g. mplayer) access pixels without locking. */ -+ retval->pixels = hwdata->pixels; -+ hwdata->dirty = SDL_TRUE; -+ - return retval; - } - --- -2.36.1 - diff --git a/0001-Use-SDL_PIXELFORMAT_RGB888-for-24-bit-surfaces.patch b/0001-Use-SDL_PIXELFORMAT_RGB888-for-24-bit-surfaces.patch deleted file mode 100644 index 1f21085..0000000 --- a/0001-Use-SDL_PIXELFORMAT_RGB888-for-24-bit-surfaces.patch +++ /dev/null @@ -1,31 +0,0 @@ -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/release-1.2.52.tar.gz b/release-1.2.52.tar.gz deleted file mode 100644 index 0019dc9..0000000 --- a/release-1.2.52.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:5bd7942703575554670a8767ae030f7921a0ac3c5e2fd173a537b7c7a8599014 -size 421046 diff --git a/release-1.2.60.tar.gz b/release-1.2.60.tar.gz new file mode 100644 index 0000000..abb9077 --- /dev/null +++ b/release-1.2.60.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:029fa24fe9e0d6a15b94f4737a2d3ed3144c5ef920eb82b4c6b30248eb94518b +size 438381 diff --git a/sdl12_compat.changes b/sdl12_compat.changes index 7fbeac3..100983c 100644 --- a/sdl12_compat.changes +++ b/sdl12_compat.changes @@ -1,3 +1,21 @@ +------------------------------------------------------------------- +Wed Oct 26 16:54:07 UTC 2022 - Jan Engelhardt + +- Update to release 1.2.60 + * SDL_GetWMInfo() now works with SDL2 builds from the 2.0.xx + revisions. + * SDL_GetWMInfo() no longer asserts if used on Wayland. + * SDL_WM_SetIcon() no longer crashes on NULL icons, to match + SDL-1.2. + * Make SDL2's OpenGL 2D renderer work with apps that update + their screen surface from background threads + * SDL_ANYFORMAT is now supported + * SDL2 game controllers can optionally be used with the 1.2 + Joystick API. + * Check for specific X11 symbols in the process at startup and + force SDL2 to use X11 if so (fixes startup failures on + Wayland). + ------------------------------------------------------------------- Mon Aug 8 14:18:26 UTC 2022 - Jan Engelhardt diff --git a/sdl12_compat.spec b/sdl12_compat.spec index 7a06996..7db410d 100644 --- a/sdl12_compat.spec +++ b/sdl12_compat.spec @@ -19,7 +19,7 @@ Name: sdl12_compat %define lname libSDL-1_2-0 %global _lto_cflags %_lto_cflags -ffat-lto-objects -Version: 1.2.52 +Version: 1.2.60 Release: 0 Summary: SDL-1.2 Compatibility Layer for Simple DirectMedia Layer 2.0 License: MIT @@ -28,9 +28,6 @@ URL: https://github.com/libsdl-org/sdl12-compat Source: https://github.com/libsdl-org/sdl12-compat/archive/refs/tags/release-%version.tar.gz 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) From 19d0b8af10ba0b95249afe866f90ca80d0ac5977cd10b296fb70cae6656b459d Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Thu, 24 Nov 2022 13:23:33 +0000 Subject: [PATCH 2/2] - Delete 0001-Use-SDL_PIXELFORMAT_RGB888-for-24-bit-surfaces.patch, 0001-Set-pixels-in-SDL_CreateYUVOverlay-Fix-164.patch, 0001-SDL_GetWMInfo-work-like-1.2-when-SDL_SetVideoMode-ha.patch OBS-URL: https://build.opensuse.org/package/show/games/sdl12_compat?expand=0&rev=18 --- sdl12_compat.changes | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sdl12_compat.changes b/sdl12_compat.changes index 100983c..ea9a2cc 100644 --- a/sdl12_compat.changes +++ b/sdl12_compat.changes @@ -15,6 +15,9 @@ Wed Oct 26 16:54:07 UTC 2022 - Jan Engelhardt * Check for specific X11 symbols in the process at startup and force SDL2 to use X11 if so (fixes startup failures on Wayland). +- Delete 0001-Use-SDL_PIXELFORMAT_RGB888-for-24-bit-surfaces.patch, + 0001-Set-pixels-in-SDL_CreateYUVOverlay-Fix-164.patch, + 0001-SDL_GetWMInfo-work-like-1.2-when-SDL_SetVideoMode-ha.patch ------------------------------------------------------------------- Mon Aug 8 14:18:26 UTC 2022 - Jan Engelhardt