diff --git a/Ports/dungeonrush/patches/0001-chdir-to-the-resource-install-path-at-program-startu.patch b/Ports/dungeonrush/patches/0001-chdir-to-the-resource-install-path-at-program-startu.patch new file mode 100644 index 0000000000..54aeab30af --- /dev/null +++ b/Ports/dungeonrush/patches/0001-chdir-to-the-resource-install-path-at-program-startu.patch @@ -0,0 +1,27 @@ +From 9aeccfdc1257204b18e0c8efa1f18f9a24cdab75 Mon Sep 17 00:00:00 2001 +From: Gunnar Beutner +Date: Wed, 16 Jun 2021 11:23:34 +0200 +Subject: [PATCH 1/2] chdir() to the resource install path at program startup + +The game tries to open its resource files using relative paths, and we +install them into /opt, so chdr() there. +--- + src/main.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/src/main.c b/src/main.c +index 8fa842f..e16c35e 100644 +--- a/src/main.c ++++ b/src/main.c +@@ -12,6 +12,8 @@ + #endif + + int main(int argc, char** args) { ++ // The game tries to open its resource files using relative paths ++ chdir("/opt/DungeonRush"); + prngSrand(time(NULL)); + // Start up SDL and create window + if (!init()) { +-- +2.36.1 + diff --git a/Ports/dungeonrush/patches/0002-Make-it-use-software-rendering.patch b/Ports/dungeonrush/patches/0002-Make-it-use-software-rendering.patch new file mode 100644 index 0000000000..ff374dd1b0 --- /dev/null +++ b/Ports/dungeonrush/patches/0002-Make-it-use-software-rendering.patch @@ -0,0 +1,25 @@ +From 2837d8fc8be4d4bd3d03866cfd139152506f4e31 Mon Sep 17 00:00:00 2001 +From: Gunnar Beutner +Date: Wed, 16 Jun 2021 11:23:34 +0200 +Subject: [PATCH 2/2] Make it use software rendering + +--- + src/res.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/src/res.c b/src/res.c +index ef4945a..6c46184 100644 +--- a/src/res.c ++++ b/src/res.c +@@ -89,6 +89,8 @@ Mix_Music *bgms[AUDIO_BGM_SIZE]; + int soundsCount; + Mix_Chunk *sounds[AUDIO_SOUND_SIZE]; + ++#define SOFTWARE_ACC ++ + bool init() { + // Initialization flag + bool success = true; +-- +2.36.1 + diff --git a/Ports/dungeonrush/patches/ReadMe.md b/Ports/dungeonrush/patches/ReadMe.md index b0f4b905c7..b5de758da6 100644 --- a/Ports/dungeonrush/patches/ReadMe.md +++ b/Ports/dungeonrush/patches/ReadMe.md @@ -1,9 +1,14 @@ -# Patches for dungeonrush +# Patches for dungeonrush on SerenityOS -## `sw-renderer.patch` +## `0001-chdir-to-the-resource-install-path-at-program-startu.patch` -Disable SDL hardware acceleration. +chdir() to the resource install path at program startup + +The game tries to open its resource files using relative paths, and we +install them into /opt, so chdr() there. + +## `0002-Make-it-use-software-rendering.patch` + +Make it use software rendering -## `cwd.patch` -`chdir()` to the installed directory as the game tries to load resources with relative paths. diff --git a/Ports/dungeonrush/patches/cwd.patch b/Ports/dungeonrush/patches/cwd.patch deleted file mode 100644 index 22559b533b..0000000000 --- a/Ports/dungeonrush/patches/cwd.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -Naur DungeonRush-1.1-beta/src/main.c DungeonRush-1.1-beta.serenity/src/main.c ---- DungeonRush-1.1-beta/src/main.c 2020-11-21 14:22:39.000000000 +0100 -+++ DungeonRush-1.1-beta.serenity/src/main.c 2021-06-16 11:02:22.409585466 +0200 -@@ -12,6 +12,8 @@ - #endif - - int main(int argc, char** args) { -+ // The game tries to open its resource files using relative paths -+ chdir("/opt/DungeonRush"); - prngSrand(time(NULL)); - // Start up SDL and create window - if (!init()) { diff --git a/Ports/dungeonrush/patches/sw-renderer.patch b/Ports/dungeonrush/patches/sw-renderer.patch deleted file mode 100644 index 530654b0d3..0000000000 --- a/Ports/dungeonrush/patches/sw-renderer.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -Naur DungeonRush-1.1-beta/src/res.c DungeonRush-1.1-beta.serenity/src/res.c ---- DungeonRush-1.1-beta/src/res.c 2020-11-21 14:22:39.000000000 +0100 -+++ DungeonRush-1.1-beta.serenity/src/res.c 2021-06-16 11:00:12.654195338 +0200 -@@ -89,6 +89,8 @@ - int soundsCount; - Mix_Chunk *sounds[AUDIO_SOUND_SIZE]; - -+#define SOFTWARE_ACC -+ - bool init() { - // Initialization flag - bool success = true;