SDLPoP: Fix working directory

This commit is contained in:
Gerasim Troeglazov
2019-09-09 22:04:26 +10:00
parent b8cad31ddd
commit 8a9ac25e98
2 changed files with 35 additions and 5 deletions

View File

@@ -1,14 +1,14 @@
From 7920812ef10c49277568618b5be0bab8d119efd9 Mon Sep 17 00:00:00 2001
From 604842a2d0e2cee9d054adead66ba238a533bc4e Mon Sep 17 00:00:00 2001
From: Gerasim Troeglazov <3dEyes@gmail.com>
Date: Thu, 27 Sep 2018 19:26:28 +1000
Subject: Disable haptic init
diff --git a/src/seg009.c b/src/seg009.c
index 691954e..d5551b0 100644
index 295d960..d6f0267 100644
--- a/src/seg009.c
+++ b/src/seg009.c
@@ -2108,7 +2108,7 @@ void __pascal far set_gr_mode(byte grmode) {
@@ -2301,7 +2301,7 @@ void __pascal far set_gr_mode(byte grmode) {
SDL_SetHint(SDL_HINT_WINDOWS_DISABLE_THREAD_NAMING, "1");
#endif
if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_TIMER | SDL_INIT_NOPARACHUTE |
@@ -18,5 +18,35 @@ index 691954e..d5551b0 100644
quit(1);
}
--
2.19.0
2.23.0
From 9bfc4743827c52aab832805771d71881419935e3 Mon Sep 17 00:00:00 2001
From: Gerasim Troeglazov <3dEyes@gmail.com>
Date: Mon, 9 Sep 2019 22:02:54 +1000
Subject: Set working directory
diff --git a/src/main.c b/src/main.c
index 4f5b9f3..2a01eb4 100644
--- a/src/main.c
+++ b/src/main.c
@@ -22,6 +22,15 @@ The authors of this program may be contacted at http://forum.princed.org
int main(int argc, char *argv[])
{
+#ifdef __HAIKU__
+ char *binpath = realpath(argv[0], NULL);
+ if (binpath != NULL) {
+ char *appdir = strrchr(binpath, '/');
+ *appdir = '\0';
+ chdir(binpath);
+ free(binpath);
+ }
+#endif
g_argc = argc;
g_argv = argv;
pop_main();
--
2.23.0

View File

@@ -4,7 +4,7 @@ It is based on a disassembly of the DOS version, and uses SDL."
HOMEPAGE="http://www.princed.org/"
COPYRIGHT="Dávid Nagy"
LICENSE="GNU GPL v3"
REVISION="1"
REVISION="2"
SOURCE_URI="https://github.com/NagyD/SDLPoP/archive/v$portVersion.tar.gz"
CHECKSUM_SHA256="e43e3a215e1377d74375fc06183cda76195328a0348a980a5991f3648bb91be2"
SOURCE_DIR="SDLPoP-$portVersion"