Accepting request 1037902 from games

- Update to release 1.2.60

OBS-URL: https://build.opensuse.org/request/show/1037902
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/sdl12_compat?expand=0&rev=4
This commit is contained in:
Dominique Leuenberger 2022-11-25 12:11:27 +00:00 committed by Git OBS Bridge
commit 295ca81b7c
7 changed files with 25 additions and 147 deletions

View File

@ -1,70 +0,0 @@
From 32bcfa763d90cd2391493a396f21b98716b52bda Mon Sep 17 00:00:00 2001
From: "Ryan C. Gordon" <icculus@icculus.org>
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

View File

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

View File

@ -1,31 +0,0 @@
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 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:5bd7942703575554670a8767ae030f7921a0ac3c5e2fd173a537b7c7a8599014
size 421046

BIN
release-1.2.60.tar.gz (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -1,3 +1,24 @@
-------------------------------------------------------------------
Wed Oct 26 16:54:07 UTC 2022 - Jan Engelhardt <jengelh@inai.de>
- 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).
- 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 <jengelh@inai.de>

View File

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