Ports: Update fheroes2's patches to use git patches

This commit is contained in:
Ali Mohammad Pur 2022-05-16 19:21:35 +04:30 committed by Ali Mohammad Pur
parent 5da5c4d9fa
commit 1e06a78966
5 changed files with 66 additions and 25 deletions

View file

@ -0,0 +1,25 @@
From eda93d38b7677a38e5027bccfa48d55c94242f4e Mon Sep 17 00:00:00 2001
From: Michael Manganiello <adamantike@users.noreply.github.com>
Date: Sun, 27 Mar 2022 12:52:11 -0300
Subject: [PATCH 1/3] Include <endian.h> on serenity as well
---
src/engine/endian_h2.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/engine/endian_h2.h b/src/engine/endian_h2.h
index 7d1fa27..9144a91 100644
--- a/src/engine/endian_h2.h
+++ b/src/engine/endian_h2.h
@@ -21,7 +21,7 @@
#ifndef ENDIAN_H2_H
#define ENDIAN_H2_H
-#if defined( __linux__ )
+#if defined( __linux__ ) || defined( __serenity__ )
#include <endian.h>
#elif defined( __FreeBSD__ ) || defined( __OpenBSD__ )
--
2.36.1

View file

@ -1,5 +1,15 @@
From 315d38c29eac54f3db525a7077279c37f1d83b15 Mon Sep 17 00:00:00 2001
From: Michael Manganiello <adamantike@users.noreply.github.com>
Date: Sun, 27 Mar 2022 12:52:11 -0300
Subject: [PATCH 2/3] Use pkg-config for SDL_* and SDL2
---
CMakeLists.txt | 9 ++++++---
src/engine/CMakeLists.txt | 12 +++++++-----
2 files changed, 13 insertions(+), 8 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 87282647..ebed16ee 100644
index 8728264..ebed16e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -26,13 +26,16 @@ option(FHEROES2_STRICT_COMPILATION "Enable -Werror strict compilation" OFF)
@ -15,15 +25,15 @@ index 87282647..ebed16ee 100644
+
find_package(ZLIB REQUIRED)
find_package(Threads)
if(ENABLE_IMAGE)
- find_package(${USE_SDL_VERSION}_image REQUIRED)
+ PKG_SEARCH_MODULE(${USE_SDL_VERSION}IMAGE REQUIRED SDL2_image)
find_package(PNG REQUIRED)
endif(ENABLE_IMAGE)
diff --git a/src/engine/CMakeLists.txt b/src/engine/CMakeLists.txt
index 8a1fbeb3..b9df3120 100644
index 8a1fbeb..b9df312 100644
--- a/src/engine/CMakeLists.txt
+++ b/src/engine/CMakeLists.txt
@@ -5,19 +5,21 @@ target_compile_definitions(engine PRIVATE
@ -53,3 +63,6 @@ index 8a1fbeb3..b9df3120 100644
Threads::Threads # To match the build settings of the main app
ZLIB::ZLIB
)
--
2.36.1

View file

@ -1,8 +1,17 @@
From 50f72a8d38355f2d9814cc6f507301b11bcbe02f Mon Sep 17 00:00:00 2001
From: Michael Manganiello <adamantike@users.noreply.github.com>
Date: Sun, 27 Mar 2022 12:52:11 -0300
Subject: [PATCH 3/3] Disable SDL's accelerated rendering
---
src/engine/screen.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/engine/screen.cpp b/src/engine/screen.cpp
index 6083cb82..844ffb72 100644
index 9cd9ccb..f4fe315 100644
--- a/src/engine/screen.cpp
+++ b/src/engine/screen.cpp
@@ -1003,10 +1003,10 @@ namespace
@@ -1005,10 +1005,10 @@ namespace
int renderFlags() const
{
if ( _isVSyncEnabled ) {
@ -15,3 +24,6 @@ index 6083cb82..844ffb72 100644
}
void _createPalette()
--
2.36.1

View file

@ -1,13 +1,17 @@
# Patches for fheroes2 on SerenityOS
## `cmakelists.patch`
## `0001-Include-endian.h-on-serenity-as-well.patch`
Fix library detection for SDL2 dependencies in CMakeLists files.
Include <endian.h> on serenity as well
## `add-serenity-support.patch`
Add `__serenity__` option in header files that validate current platform.
## `0002-Use-pkg-config-for-SDL_-and-SDL2.patch`
Use pkg-config for SDL_* and SDL2
## `0003-Disable-SDL-s-accelerated-rendering.patch`
Disable SDL's accelerated rendering
## `set-sdl-software-renderer.patch`
Use SDL Software renderer, instead of hardware-accelerated one.

View file

@ -1,13 +0,0 @@
diff --git a/src/engine/endian_h2.h b/src/engine/endian_h2.h
index 7d1fa275..84846ca9 100644
--- a/src/engine/endian_h2.h
+++ b/src/engine/endian_h2.h
@@ -21,7 +21,7 @@
#ifndef ENDIAN_H2_H
#define ENDIAN_H2_H
-#if defined( __linux__ )
+#if defined( __linux__ ) || defined( __serenity__ )
#include <endian.h>
#elif defined( __FreeBSD__ ) || defined( __OpenBSD__ )