diff options
Diffstat (limited to 'Ports/Super-Mario/patches')
-rw-r--r-- | Ports/Super-Mario/patches/0001-chdir-to-the-installed-directory-before-execution.patch | 37 | ||||
-rw-r--r-- | Ports/Super-Mario/patches/0002-Disable-graphics-acceleration.patch (renamed from Ports/Super-Mario/patches/disable_graphic_acceleration.patch) | 13 | ||||
-rw-r--r-- | Ports/Super-Mario/patches/0003-Use-pkgconfig-instead-of-find_package-to-look-for-de.patch (renamed from Ports/Super-Mario/patches/fix_cmakelists.patch) | 13 | ||||
-rw-r--r-- | Ports/Super-Mario/patches/0004-Fix-a-header-include-path.patch (renamed from Ports/Super-Mario/patches/fix_fireball_header.patch) | 13 | ||||
-rw-r--r-- | Ports/Super-Mario/patches/0005-Remove-global-static-initializers.patch (renamed from Ports/Super-Mario/patches/gcc-11-static-initializers.patch) | 23 | ||||
-rw-r--r-- | Ports/Super-Mario/patches/ReadMe.md | 32 | ||||
-rw-r--r-- | Ports/Super-Mario/patches/cwd.patch | 21 |
7 files changed, 114 insertions, 38 deletions
diff --git a/Ports/Super-Mario/patches/0001-chdir-to-the-installed-directory-before-execution.patch b/Ports/Super-Mario/patches/0001-chdir-to-the-installed-directory-before-execution.patch new file mode 100644 index 0000000000..f487089377 --- /dev/null +++ b/Ports/Super-Mario/patches/0001-chdir-to-the-installed-directory-before-execution.patch @@ -0,0 +1,37 @@ +From c7869092a313c1550a34675d1c9faebc1468ef1e Mon Sep 17 00:00:00 2001 +From: Gunnar Beutner <gbeutner@serenityos.org> +Date: Fri, 4 Jun 2021 00:29:36 +0200 +Subject: [PATCH 1/5] chdir() to the installed directory before execution + +The game expects its assets in the current directory, but we install +those to /opt/Super_Mario, so chdir() there at program startup to avoid +crashing. +--- + src/main.cpp | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +diff --git a/src/main.cpp b/src/main.cpp +index 040eb56..ca14d6f 100644 +--- a/src/main.cpp ++++ b/src/main.cpp +@@ -1,10 +1,15 @@ + #include "header.h" + #include "Core.h" ++#include <unistd.h> + + int main(int argc, const char* argv[]) { +- CCore oCore; ++ chdir("/opt/Super_Mario"); + +- oCore.mainLoop(); ++ { ++ CCore oCore; ++ ++ oCore.mainLoop(); ++ } + + return 0; + } +-- +2.36.1 + diff --git a/Ports/Super-Mario/patches/disable_graphic_acceleration.patch b/Ports/Super-Mario/patches/0002-Disable-graphics-acceleration.patch index cd2bbfdee5..0600742b4c 100644 --- a/Ports/Super-Mario/patches/disable_graphic_acceleration.patch +++ b/Ports/Super-Mario/patches/0002-Disable-graphics-acceleration.patch @@ -1,3 +1,13 @@ +From 4a8e24e824e0de7557ae15414d30a1b49d14ce0d Mon Sep 17 00:00:00 2001 +From: Manuel Palenzuela <manuelpalenzuelamerino@gmail.com> +Date: Sun, 4 Apr 2021 00:41:48 +0200 +Subject: [PATCH 2/5] Disable graphics acceleration + +Disables SDL2 hardware acceleration as we don't support that. +--- + src/Core.cpp | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + diff --git a/src/Core.cpp b/src/Core.cpp index c04581b..f0c0308 100644 --- a/src/Core.cpp @@ -18,3 +28,6 @@ index c04581b..f0c0308 100644 -} \ No newline at end of file +} +-- +2.36.1 + diff --git a/Ports/Super-Mario/patches/fix_cmakelists.patch b/Ports/Super-Mario/patches/0003-Use-pkgconfig-instead-of-find_package-to-look-for-de.patch index 25506089aa..3910531ad0 100644 --- a/Ports/Super-Mario/patches/fix_cmakelists.patch +++ b/Ports/Super-Mario/patches/0003-Use-pkgconfig-instead-of-find_package-to-look-for-de.patch @@ -1,3 +1,13 @@ +From a780c6ee085103b0d3ffa39e0162ddd1848068bb Mon Sep 17 00:00:00 2001 +From: Manuel Palenzuela <manuelpalenzuelamerino@gmail.com> +Date: Sun, 4 Apr 2021 00:41:48 +0200 +Subject: [PATCH 3/5] Use pkgconfig instead of find_package() to look for + dependencies + +--- + CMakeLists.txt | 13 ++++++++----- + 1 file changed, 8 insertions(+), 5 deletions(-) + diff --git a/CMakeLists.txt b/CMakeLists.txt index 616d876..d1aa020 100644 --- a/CMakeLists.txt @@ -28,3 +38,6 @@ index 616d876..d1aa020 100644 +target_link_libraries(uMario ${SDL2_LIBRARIES} ${SDL2_IMAGE_LIBRARIES} ${SDL2_MIXER_LIBRARIES}-lSDL2_mixer -lpthread -lm -lgfx -lgui -lipc -lcore) install(TARGETS uMario RUNTIME DESTINATION ${BIN_DIR}) +-- +2.36.1 + diff --git a/Ports/Super-Mario/patches/fix_fireball_header.patch b/Ports/Super-Mario/patches/0004-Fix-a-header-include-path.patch index 22d882ad70..5fe0a27b21 100644 --- a/Ports/Super-Mario/patches/fix_fireball_header.patch +++ b/Ports/Super-Mario/patches/0004-Fix-a-header-include-path.patch @@ -1,3 +1,13 @@ +From 452f2ace4ba87e7d2e07a46adf4abdfb8970317d Mon Sep 17 00:00:00 2001 +From: Manuel Palenzuela <manuelpalenzuelamerino@gmail.com> +Date: Sun, 4 Apr 2021 00:41:48 +0200 +Subject: [PATCH 4/5] Fix a header include path + +--- + src/FireBall.cpp | 4 ++-- + src/Map.h | 4 ++-- + 2 files changed, 4 insertions(+), 4 deletions(-) + diff --git a/src/FireBall.cpp b/src/FireBall.cpp index 6f3eacc..6f5eade 100644 --- a/src/FireBall.cpp @@ -35,3 +45,6 @@ index b812b49..f6abbb9 100644 -#endif \ No newline at end of file +#endif +-- +2.36.1 + diff --git a/Ports/Super-Mario/patches/gcc-11-static-initializers.patch b/Ports/Super-Mario/patches/0005-Remove-global-static-initializers.patch index c6f501a0cb..050a60f0cd 100644 --- a/Ports/Super-Mario/patches/gcc-11-static-initializers.patch +++ b/Ports/Super-Mario/patches/0005-Remove-global-static-initializers.patch @@ -1,7 +1,17 @@ -diff -Naur Super-Mario-Clone-Cpp-master/src/CFG.cpp Super-Mario-Clone-Cpp-master.serenity/src/CFG.cpp ---- Super-Mario-Clone-Cpp-master/src/CFG.cpp 2021-04-29 07:39:18.688987494 +0200 -+++ Super-Mario-Clone-Cpp-master.serenity/src/CFG.cpp 2021-04-29 07:41:19.464330908 +0200 -@@ -14,11 +13,11 @@ +From e9d588e7519a15003ded6b68ed7fa10dbe0f8f11 Mon Sep 17 00:00:00 2001 +From: Gunnar Beutner <gbeutner@serenityos.org> +Date: Thu, 29 Apr 2021 07:36:37 +0200 +Subject: [PATCH 5/5] Remove global static initializers + +--- + src/CFG.cpp | 16 ++++++++++++---- + 1 file changed, 12 insertions(+), 4 deletions(-) + +diff --git a/src/CFG.cpp b/src/CFG.cpp +index 90595a5..20dd6ea 100644 +--- a/src/CFG.cpp ++++ b/src/CFG.cpp +@@ -13,11 +13,11 @@ CCFG::~CCFG(void) { int CCFG::GAME_HEIGHT = 448; int CCFG::GAME_WIDTH = 800; @@ -17,7 +27,7 @@ diff -Naur Super-Mario-Clone-Cpp-master/src/CFG.cpp Super-Mario-Clone-Cpp-master bool CCFG::keySpace = false; int CCFG::keyIDA = 0; -@@ -30,18 +29,26 @@ +@@ -29,18 +29,26 @@ int CCFG::keyIDShift = 0; bool CCFG::canMoveBackward = true; Text* CCFG::getText() { @@ -44,3 +54,6 @@ diff -Naur Super-Mario-Clone-Cpp-master/src/CFG.cpp Super-Mario-Clone-Cpp-master return tSMBLOGO; } +-- +2.36.1 + diff --git a/Ports/Super-Mario/patches/ReadMe.md b/Ports/Super-Mario/patches/ReadMe.md index eefd91cb69..a00141b366 100644 --- a/Ports/Super-Mario/patches/ReadMe.md +++ b/Ports/Super-Mario/patches/ReadMe.md @@ -1,23 +1,31 @@ -# Patches for Super-Mario +# Patches for Super-Mario on SerenityOS -## `cwd.patch` +## `0001-chdir-to-the-installed-directory-before-execution.patch` -`chdir()`s to the installed directory before execution. +chdir() to the installed directory before execution -## `gcc-11-static-initializers.patch` +The game expects its assets in the current directory, but we install +those to /opt/Super_Mario, so chdir() there at program startup to avoid +crashing. -Removes global static initializers. -Presumably not needed anymore. +## `0002-Disable-graphics-acceleration.patch` -## `fix_cmakelists.patch` +Disable graphics acceleration -Use `FindPkgConfig` instead of `find_package()` to locate SDL2. +Disables SDL2 hardware acceleration as we don't support that. -## `fix_fireball_header.patch` +## `0003-Use-pkgconfig-instead-of-find_package-to-look-for-de.patch` -Fixes a header include name. +Use pkgconfig instead of find_package() to look for dependencies -## `disable_graphic_acceleration.patch` -Disables SDL2 hardware acceleration as we don't support that. +## `0004-Fix-a-header-include-path.patch` + +Fix a header include path + + +## `0005-Remove-global-static-initializers.patch` + +Remove global static initializers + diff --git a/Ports/Super-Mario/patches/cwd.patch b/Ports/Super-Mario/patches/cwd.patch deleted file mode 100644 index 57abed06b5..0000000000 --- a/Ports/Super-Mario/patches/cwd.patch +++ /dev/null @@ -1,21 +0,0 @@ -diff -Naur Super-Mario-Clone-Cpp-master/src/main.cpp Super-Mario-Clone-Cpp-master.serenity/src/main.cpp ---- Super-Mario-Clone-Cpp-master/src/main.cpp 2019-08-01 15:39:15.000000000 +0200 -+++ Super-Mario-Clone-Cpp-master.serenity/src/main.cpp 2021-06-03 23:54:26.881221759 +0200 -@@ -1,10 +1,15 @@ - #include "header.h" - #include "Core.h" -+#include <unistd.h> - - int main(int argc, const char* argv[]) { -- CCore oCore; -+ chdir("/opt/Super_Mario"); - -- oCore.mainLoop(); -+ { -+ CCore oCore; -+ -+ oCore.mainLoop(); -+ } - - return 0; - } |