libsdl: Add patches to fix 24 bit screen mode support.

This commit is contained in:
Michael Lotz
2015-10-27 21:55:46 +00:00
parent f3b90892db
commit fb50a8bd90
2 changed files with 116 additions and 25 deletions

View File

@@ -5,7 +5,7 @@ joystick, and graphics via OpenGL."
HOMEPAGE="http://www.libsdl.org/" HOMEPAGE="http://www.libsdl.org/"
COPYRIGHT="1997-2012 Sam Lantinga" COPYRIGHT="1997-2012 Sam Lantinga"
LICENSE="GNU LGPL v2.1" LICENSE="GNU LGPL v2.1"
REVISION="8" REVISION="9"
SOURCE_URI="http://www.libsdl.org/release/SDL-1.2.15.tar.gz" SOURCE_URI="http://www.libsdl.org/release/SDL-1.2.15.tar.gz"
CHECKSUM_SHA256="d6d316a793e5e348155f0dd93b979798933fb98aa1edebcc108829d6474aad00" CHECKSUM_SHA256="d6d316a793e5e348155f0dd93b979798933fb98aa1edebcc108829d6474aad00"
SOURCE_DIR="SDL-$portVersion" SOURCE_DIR="SDL-$portVersion"

View File

@@ -1,9 +1,12 @@
From 115505e17228751511a628f80164c72c526a6331 Mon Sep 17 00:00:00 2001 From 5a1a0f841aaffdd2d50dd61b9b77f79038293977 Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@pulkomandy.tk> From: Adrien Destugues <pulkomandy@pulkomandy.tk>
Date: Fri, 22 Nov 2013 23:38:56 +0100 Date: Fri, 22 Nov 2013 23:38:56 +0100
Subject: Remove Alsa and ESD detection Subject: [PATCH 01/10] Remove Alsa and ESD detection
These will fail on Haiku, and we don't need them anyway. These will fail on Haiku, and we don't need them anyway.
---
configure.in | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/configure.in b/configure.in diff --git a/configure.in b/configure.in
index 08c8e1e..84d9a55 100644 index 08c8e1e..84d9a55 100644
@@ -33,17 +36,20 @@ index 08c8e1e..84d9a55 100644
]) ])
+AC_CONFIG_MACRO_DIR([acinclude]) +AC_CONFIG_MACRO_DIR([acinclude])
-- --
1.8.3.4 2.2.2
From 6faa61b9acc255a387effb5c681c13eb491aae0d Mon Sep 17 00:00:00 2001 From cd6e938bfdbe60b75fb483ae185437e7dabeb440 Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@pulkomandy.tk> From: Adrien Destugues <pulkomandy@pulkomandy.tk>
Date: Fri, 22 Nov 2013 23:39:26 +0100 Date: Fri, 22 Nov 2013 23:39:26 +0100
Subject: Fix samples vs bytes issues Subject: [PATCH 02/10] Fix samples vs bytes issues
This was particularly noticeable in Milkytracker (SDL version) and This was particularly noticeable in Milkytracker (SDL version) and
Hivelytracker, where all the audio timing relies on the buffer being Hivelytracker, where all the audio timing relies on the buffer being
played during the right time. played during the right time.
---
src/audio/baudio/SDL_beaudio.cc | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/audio/baudio/SDL_beaudio.cc b/src/audio/baudio/SDL_beaudio.cc diff --git a/src/audio/baudio/SDL_beaudio.cc b/src/audio/baudio/SDL_beaudio.cc
index de635f8..7faf571 100644 index de635f8..7faf571 100644
@@ -64,17 +70,20 @@ index de635f8..7faf571 100644
{ sigset_t omask; { sigset_t omask;
SDL_MaskSignals(&omask); SDL_MaskSignals(&omask);
-- --
1.8.3.4 2.2.2
From 6e1c58184451e2bc594dfe06ac20b414dc1901db Mon Sep 17 00:00:00 2001 From 9f21694189fca33ec9c63dd647275100bbe77a4b Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@pulkomandy.tk> From: Adrien Destugues <pulkomandy@pulkomandy.tk>
Date: Fri, 22 Nov 2013 23:40:12 +0100 Date: Fri, 22 Nov 2013 23:40:12 +0100
Subject: Various fixes to the video code Subject: [PATCH 03/10] Various fixes to the video code
* Do not center the window each time it is resized * Do not center the window each time it is resized
* Do not reset video mode if we didn't enter fullscreen * Do not reset video mode if we didn't enter fullscreen
* remove annoying debug print * remove annoying debug print
---
src/video/bwindow/SDL_sysvideo.cc | 26 +++++++++++++++-----------
1 file changed, 15 insertions(+), 11 deletions(-)
diff --git a/src/video/bwindow/SDL_sysvideo.cc b/src/video/bwindow/SDL_sysvideo.cc diff --git a/src/video/bwindow/SDL_sysvideo.cc b/src/video/bwindow/SDL_sysvideo.cc
index c32b661..a26f18b 100644 index c32b661..a26f18b 100644
@@ -144,14 +153,18 @@ index c32b661..a26f18b 100644
SDL_Win->SetXYOffset(cx, cy); SDL_Win->SetXYOffset(cx, cy);
} }
-- --
1.8.3.4 2.2.2
From b23618466a5eb0185d3305a2013182f9798f4677 Mon Sep 17 00:00:00 2001 From 16b05a5bb44c626afabe4802637e74eb046968d0 Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@pulkomandy.tk> From: Adrien Destugues <pulkomandy@pulkomandy.tk>
Date: Sat, 23 Nov 2013 11:59:00 +0100 Date: Sat, 23 Nov 2013 11:59:00 +0100
Subject: Actually fix the sample vs bytes problem in audio driver. Subject: [PATCH 04/10] Actually fix the sample vs bytes problem in audio
driver.
---
src/audio/baudio/SDL_beaudio.cc | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/audio/baudio/SDL_beaudio.cc b/src/audio/baudio/SDL_beaudio.cc diff --git a/src/audio/baudio/SDL_beaudio.cc b/src/audio/baudio/SDL_beaudio.cc
index 7faf571..300bf03 100644 index 7faf571..300bf03 100644
@@ -198,14 +211,17 @@ index 7faf571..300bf03 100644
/* Subscribe to the audio stream (creates a new thread) */ /* Subscribe to the audio stream (creates a new thread) */
{ sigset_t omask; { sigset_t omask;
-- --
1.8.3.4 2.2.2
From 997f4ae84c40328a42fe8daadca0c49e33a650e4 Mon Sep 17 00:00:00 2001 From 7707d4eb70a7caf8b6ca6114ea2a0b191c04fd60 Mon Sep 17 00:00:00 2001
From: Chris Roberts <cpr420@gmail.com> From: Chris Roberts <cpr420@gmail.com>
Date: Sun, 22 Dec 2013 18:37:30 -0700 Date: Sun, 22 Dec 2013 18:37:30 -0700
Subject: Remove Haiku from specialized DECLSPEC definition Subject: [PATCH 05/10] Remove Haiku from specialized DECLSPEC definition
---
include/begin_code.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/begin_code.h b/include/begin_code.h diff --git a/include/begin_code.h b/include/begin_code.h
index 27e2f7b..d5e2f1f 100644 index 27e2f7b..d5e2f1f 100644
@@ -221,15 +237,18 @@ index 27e2f7b..d5e2f1f 100644
# define DECLSPEC # define DECLSPEC
# else # else
-- --
1.8.3.4 2.2.2
From 6d189890324b05880651ceef3854c0443cb0aa33 Mon Sep 17 00:00:00 2001 From d1f9c6c01ef5bea92c15e4255deede177aba0508 Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@pulkomandy.tk> From: Adrien Destugues <pulkomandy@pulkomandy.tk>
Date: Sun, 5 Jan 2014 17:22:10 +0100 Date: Sun, 5 Jan 2014 17:22:10 +0100
Subject: Change prefix from "be" to "os" for OpenGL includes Subject: [PATCH 06/10] Change prefix from "be" to "os" for OpenGL includes
Accomodate the new OpenGL kit that doesn't have the "be" symlink. Accomodate the new OpenGL kit that doesn't have the "be" symlink.
---
src/video/bwindow/SDL_BWin.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/video/bwindow/SDL_BWin.h b/src/video/bwindow/SDL_BWin.h diff --git a/src/video/bwindow/SDL_BWin.h b/src/video/bwindow/SDL_BWin.h
index f2b19a2..2cb94ee 100644 index f2b19a2..2cb94ee 100644
@@ -245,15 +264,21 @@ index f2b19a2..2cb94ee 100644
#include <support/UTF8.h> #include <support/UTF8.h>
-- --
1.8.3.4 2.2.2
From fa40bd88fd254203afedf3a74a449f9d485ef0da Mon Sep 17 00:00:00 2001 From 0023dd96fedd8f29f83578cc6916f1ba31bbb062 Mon Sep 17 00:00:00 2001
From: Jonathan Schleifer <js@webkeks.org> From: Jonathan Schleifer <js@webkeks.org>
Date: Fri, 28 Mar 2014 18:04:12 +0100 Date: Fri, 28 Mar 2014 18:04:12 +0100
Subject: Fix compilation on x86_64 Subject: [PATCH 07/10] Fix compilation on x86_64
Also cleans up and fixes warnings. Also cleans up and fixes warnings.
---
src/video/SDL_sysvideo.h | 8 ++++++++
src/video/SDL_video.c | 2 +-
src/video/bwindow/SDL_sysvideo.cc | 22 +++++++++-------------
src/video/bwindow/SDL_sysyuv.cc | 3 ++-
4 files changed, 20 insertions(+), 15 deletions(-)
diff --git a/src/video/SDL_sysvideo.h b/src/video/SDL_sysvideo.h diff --git a/src/video/SDL_sysvideo.h b/src/video/SDL_sysvideo.h
index 436450e..b45a8a9 100644 index 436450e..b45a8a9 100644
@@ -380,19 +405,22 @@ index 7c71b00..f2fef10 100644
return 0; return 0;
} }
-- --
1.8.3.4 2.2.2
From 2fe875387acc77af6bea3527544098c62b172643 Mon Sep 17 00:00:00 2001 From 67fa278e22614bc0e74c0b94af802272a0604c6f Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@gmail.com> From: Adrien Destugues <pulkomandy@gmail.com>
Date: Mon, 20 Oct 2014 13:33:55 +0200 Date: Mon, 20 Oct 2014 13:33:55 +0200
Subject: Fix problem with GL viewport Subject: [PATCH 08/10] Fix problem with GL viewport
Make sure the window has the correct size before the GL view is created. Make sure the window has the correct size before the GL view is created.
Otherwise the view doesn't use the resized window size and things render Otherwise the view doesn't use the resized window size and things render
in an awfully small area in the corner of the window. in an awfully small area in the corner of the window.
Fixes Dragon Memory, for example (also seen in other games using SDL+GL). Fixes Dragon Memory, for example (also seen in other games using SDL+GL).
---
src/video/bwindow/SDL_sysvideo.cc | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/video/bwindow/SDL_sysvideo.cc b/src/video/bwindow/SDL_sysvideo.cc diff --git a/src/video/bwindow/SDL_sysvideo.cc b/src/video/bwindow/SDL_sysvideo.cc
index 5d4077f..7e1bd38 100644 index 5d4077f..7e1bd38 100644
@@ -408,5 +436,68 @@ index 5d4077f..7e1bd38 100644
gl_flags = BGL_RGB; gl_flags = BGL_RGB;
if (_this->gl_config.double_buffer) if (_this->gl_config.double_buffer)
-- --
1.8.3.4 2.2.2
From 87943f6278adeb8c2a76995c03ea84d1269b7257 Mon Sep 17 00:00:00 2001
From: Michael Lotz <mmlr@mlotz.ch>
Date: Tue, 27 Oct 2015 21:39:24 +0000
Subject: [PATCH 09/10] Avoid crashing on quit when SDL_Win was never
initialized.
This can happen when an unknown screen mode is detected and video init
fails because of it.
---
src/video/bwindow/SDL_sysvideo.cc | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/video/bwindow/SDL_sysvideo.cc b/src/video/bwindow/SDL_sysvideo.cc
index 7e1bd38..818d1a0 100644
--- a/src/video/bwindow/SDL_sysvideo.cc
+++ b/src/video/bwindow/SDL_sysvideo.cc
@@ -807,8 +807,10 @@ void BE_VideoQuit(_THIS)
{
int i, j;
- SDL_Win->Quit();
- SDL_Win = NULL;
+ if ( SDL_Win != NULL ) {
+ SDL_Win->Quit();
+ SDL_Win = NULL;
+ }
if ( SDL_BlankCursor != NULL ) {
BE_FreeWMCursor(_this, SDL_BlankCursor);
--
2.2.2
From 612dcf5da6b7bb799edc7a3f66255791bca465ff Mon Sep 17 00:00:00 2001
From: Michael Lotz <mmlr@mlotz.ch>
Date: Tue, 27 Oct 2015 21:40:36 +0000
Subject: [PATCH 10/10] Add 24 bit color spaces to ColorSpaceToBitsPerPixel().
This allows initializing the native video mode when running with a 24
bit screen color depth.
---
src/video/bwindow/SDL_sysvideo.cc | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/video/bwindow/SDL_sysvideo.cc b/src/video/bwindow/SDL_sysvideo.cc
index 818d1a0..0100f3b 100644
--- a/src/video/bwindow/SDL_sysvideo.cc
+++ b/src/video/bwindow/SDL_sysvideo.cc
@@ -179,6 +179,10 @@ static inline int ColorSpaceToBitsPerPixel(uint32 colorspace)
case B_RGB16_BIG:
bitsperpixel = 16;
break;
+ case B_RGB24:
+ case B_RGB24_BIG:
+ bitsperpixel = 24;
+ break;
case B_RGB32:
case B_RGBA32:
case B_RGB32_BIG:
--
2.2.2