From 5031f52ea1e90744e69cabfeeef8d6d8b198cf2c Mon Sep 17 00:00:00 2001
From: begasus <begasus@gmail.com>
Date: Tue, 21 Jul 2020 09:14:39 +0000
Subject: Fix reference to luac5.2


diff --git a/CMakeLists.txt b/CMakeLists.txt
index f214082..68f6f29 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -55,7 +55,7 @@ foreach(OUTPUTCONFIG ${CMAKE_CONFIGURATION_TYPES})
 	set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ${CMAKE_BINARY_DIR}/${CMAKE_BUILD_TYPE}/lib)
 	set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ${CMAKE_BINARY_DIR}/${CMAKE_BUILD_TYPE}/lib)
 endforeach()
-set(DEFAULT_LUAC_EXECUTABLE luac)
+set(DEFAULT_LUAC_EXECUTABLE luac5.2)
 set(CP_CMAKE_DIR ${PROJECT_SOURCE_DIR}/cmake)
 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CP_CMAKE_DIR})
 set(CMAKE_VERBOSE_MAKEFILE ${VERBOSE})
-- 
2.27.0


From cef62bc3e9571d33979c929aa64058692be6be68 Mon Sep 17 00:00:00 2001
From: begasus <begasus@gmail.com>
Date: Tue, 21 Jul 2020 09:17:19 +0000
Subject: Don't use fullscreen on launch, set to 800*600


diff --git a/base/cavepacker/config.lua b/base/cavepacker/config.lua
index e5e482d..d65d6aa 100644
--- a/base/cavepacker/config.lua
+++ b/base/cavepacker/config.lua
@@ -2,9 +2,9 @@ function isMobile()
 	return (isAndroid() or isIOS()) and not isOUYA();
 end
 
-defaultwidth = -1
-defaultheight = -1
-defaultfullscreen = true
+defaultwidth = 800
+defaultheight = 600
+defaultfullscreen = false
 defaultpersister = "sqlite"
 defaultfrontend = "sdl"
 defaultsoundengine = "sdl"
-- 
2.27.0


From 07c5499fabb47265468426790cc68c2bf47c2d39 Mon Sep 17 00:00:00 2001
From: begasus <begasus@gmail.com>
Date: Tue, 21 Jul 2020 09:18:30 +0000
Subject: Fix launch from Tracker and Deskbar


diff --git a/src/Main.cpp b/src/Main.cpp
index 41cb968..4707873 100644
--- a/src/Main.cpp
+++ b/src/Main.cpp
@@ -8,8 +8,20 @@
 #include <SDL_main.h>
 #include "game.h"
 
+#ifdef __HAIKU__
+#include <libgen.h>
+#include <unistd.h>
+#endif
+
 extern "C" int main (int argc, char *argv[])
 {
+#ifdef __HAIKU__
+	char* binpath = realpath(argv[0], NULL);
+	if (binpath != NULL) {
+		chdir(dirname(binpath));
+		free(binpath);
+	}
+#endif
 	Application& app = Singleton<Application>::getInstance();
 	const GamePtr& game = Singleton<GameRegistry>::getInstance().getGame();
 	app.setOrganisation("caveproductions");
-- 
2.27.0

