diff --git a/Ports/scummvm/patches/0001-Prevent-call-to-glGetIntegerv-without-context.patch b/Ports/scummvm/patches/0001-Prevent-call-to-glGetIntegerv-without-context.patch index 7009294656..4993cc534f 100644 --- a/Ports/scummvm/patches/0001-Prevent-call-to-glGetIntegerv-without-context.patch +++ b/Ports/scummvm/patches/0001-Prevent-call-to-glGetIntegerv-without-context.patch @@ -1,7 +1,7 @@ -From c758a59b2b26e3ab22c4fbcba6c83e0b385b86ce Mon Sep 17 00:00:00 2001 +From 6c64e5bb63f9957ceddb82be5f9aafb73c14375c Mon Sep 17 00:00:00 2001 From: Jelle Raaijmakers Date: Wed, 12 Jan 2022 13:41:39 +0100 -Subject: [PATCH] Prevent call to `glGetIntegerv` without context +Subject: [PATCH 1/3] Prevent call to `glGetIntegerv` without context This call to `SDL_GL_GetAttribute` happens when switching from the launcher to the game, when no GL context may exist. This caused Grim @@ -26,5 +26,5 @@ index d5c034f..8a4e3ff 100644 // When rendering to a framebuffer, MSAA is enabled on that framebuffer, not on the screen -- -2.32.0 +2.36.1 diff --git a/Ports/scummvm/patches/configure.patch b/Ports/scummvm/patches/0002-Teach-configure-about-serenity.patch similarity index 62% rename from Ports/scummvm/patches/configure.patch rename to Ports/scummvm/patches/0002-Teach-configure-about-serenity.patch index 64a3e50221..d6e731056d 100644 --- a/Ports/scummvm/patches/configure.patch +++ b/Ports/scummvm/patches/0002-Teach-configure-about-serenity.patch @@ -1,6 +1,17 @@ ---- scummvm-2.5.1/configure 2021-12-24 22:19:28.000000000 +0000 -+++ scummvm-2.5.1-patched/configure 2022-01-09 21:55:40.753734211 +0000 -@@ -3998,7 +3998,7 @@ +From 65f374e0cdc9bb7255ad1aadbad1869d21ac7d82 Mon Sep 17 00:00:00 2001 +From: Jelle Raaijmakers +Date: Sun, 9 Jan 2022 23:01:32 +0100 +Subject: [PATCH 2/3] Teach configure about serenity + +--- + configure | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/configure b/configure +index 65e4731..39509f3 100755 +--- a/configure ++++ b/configure +@@ -3998,7 +3998,7 @@ case $_host_os in amigaos* | cygwin* | dreamcast | ds | gamecube | mingw* | morphos | n64 | ps3 | psp2 | psp | riscos | wii) _posix=no ;; @@ -9,7 +20,7 @@ _posix=yes ;; os2-emx*) -@@ -5538,6 +5538,9 @@ +@@ -5538,6 +5538,9 @@ EOF mingw*) OPENGL_LIBS="-lopengl32" ;; @@ -19,3 +30,6 @@ *) OPENGL_LIBS="-lGL" ;; +-- +2.36.1 + diff --git a/Ports/scummvm/patches/0003-Remove-SDL-timer-lock.patch b/Ports/scummvm/patches/0003-Remove-SDL-timer-lock.patch new file mode 100644 index 0000000000..8d512b8abf --- /dev/null +++ b/Ports/scummvm/patches/0003-Remove-SDL-timer-lock.patch @@ -0,0 +1,37 @@ +From ddb49b8e7be62501eeea15941b47b91902f697f8 Mon Sep 17 00:00:00 2001 +From: Jelle Raaijmakers +Date: Sun, 9 Jan 2022 23:18:02 +0100 +Subject: [PATCH 3/3] Remove SDL timer lock + +--- + backends/timer/sdl/sdl-timer.cpp | 6 ------ + 1 file changed, 6 deletions(-) + +diff --git a/backends/timer/sdl/sdl-timer.cpp b/backends/timer/sdl/sdl-timer.cpp +index f9d79ac..ce1af0e 100644 +--- a/backends/timer/sdl/sdl-timer.cpp ++++ b/backends/timer/sdl/sdl-timer.cpp +@@ -29,11 +29,7 @@ + + #include "common/textconsole.h" + +-OSystem::MutexRef timerMutex; +- + static Uint32 timer_handler(Uint32 interval, void *param) { +- Common::StackLock lock(timerMutex); +- + ((DefaultTimerManager *)param)->handler(); + return interval; + } +@@ -49,8 +45,6 @@ SdlTimerManager::SdlTimerManager() { + } + + SdlTimerManager::~SdlTimerManager() { +- Common::StackLock lock(timerMutex); +- + // Removes the timer callback + SDL_RemoveTimer(_timerID); + +-- +2.36.1 + diff --git a/Ports/scummvm/patches/ReadMe.md b/Ports/scummvm/patches/ReadMe.md new file mode 100644 index 0000000000..f52281615a --- /dev/null +++ b/Ports/scummvm/patches/ReadMe.md @@ -0,0 +1,22 @@ +# Patches for scummvm on SerenityOS + +## `0001-Prevent-call-to-glGetIntegerv-without-context.patch` + +Prevent call to `glGetIntegerv` without context + +This call to `SDL_GL_GetAttribute` happens when switching from the +launcher to the game, when no GL context may exist. This caused Grim +Fandango to crash almost immediately. + +Since this is for MSAA which we do not yet support, patch it out. + +## `0002-Teach-configure-about-serenity.patch` + +Teach configure about serenity + + +## `0003-Remove-SDL-timer-lock.patch` + +Remove SDL timer lock + + diff --git a/Ports/scummvm/patches/remove-sdl-timer-lock.patch b/Ports/scummvm/patches/remove-sdl-timer-lock.patch deleted file mode 100644 index 0fba134ea3..0000000000 --- a/Ports/scummvm/patches/remove-sdl-timer-lock.patch +++ /dev/null @@ -1,23 +0,0 @@ ---- scummvm-2.5.1/backends/timer/sdl/sdl-timer.cpp 2021-12-24 22:19:28.000000000 +0000 -+++ scummvm-2.5.1-patched/backends/timer/sdl/sdl-timer.cpp 2022-01-09 22:17:13.919057360 +0000 -@@ -29,11 +29,7 @@ - - #include "common/textconsole.h" - --OSystem::MutexRef timerMutex; -- - static Uint32 timer_handler(Uint32 interval, void *param) { -- Common::StackLock lock(timerMutex); -- - ((DefaultTimerManager *)param)->handler(); - return interval; - } -@@ -49,8 +45,6 @@ - } - - SdlTimerManager::~SdlTimerManager() { -- Common::StackLock lock(timerMutex); -- - // Removes the timer callback - SDL_RemoveTimer(_timerID); -