mirror of
https://github.com/yann64/haikuports.git
synced 2026-05-05 14:38:51 +02:00
ResidualVM: bump version
* fix settings paths * fix opengl init * add application icon
This commit is contained in:
117
games-engines/residualvm/patches/residualvm-0.3.1.patchset
Normal file
117
games-engines/residualvm/patches/residualvm-0.3.1.patchset
Normal file
@@ -0,0 +1,117 @@
|
||||
From 9a30d0226c12ad22878211eb2b727443e4d11609 Mon Sep 17 00:00:00 2001
|
||||
From: Gerasim Troeglazov <3dEyes@gmail.com>
|
||||
Date: Sat, 27 Oct 2018 18:51:08 +1000
|
||||
Subject: Use find_directory
|
||||
|
||||
|
||||
diff --git a/backends/platform/sdl/posix/posix.cpp b/backends/platform/sdl/posix/posix.cpp
|
||||
index abae7b1..5094bb7 100644
|
||||
--- a/backends/platform/sdl/posix/posix.cpp
|
||||
+++ b/backends/platform/sdl/posix/posix.cpp
|
||||
@@ -49,6 +49,10 @@
|
||||
#include <sys/wait.h>
|
||||
#include <unistd.h>
|
||||
|
||||
+#ifdef __HAIKU__
|
||||
+#include <FindDirectory.h>
|
||||
+#endif
|
||||
+
|
||||
OSystem_POSIX::OSystem_POSIX(Common::String baseConfigName)
|
||||
:
|
||||
_baseConfigName(baseConfigName) {
|
||||
@@ -93,6 +97,15 @@ Common::String OSystem_POSIX::getDefaultConfigFileName() {
|
||||
Common::String prefix;
|
||||
#ifdef MACOSX
|
||||
prefix = getenv("HOME");
|
||||
+#elif defined(__HAIKU__)
|
||||
+ static char settingsDir[PATH_MAX] = "";
|
||||
+ if (find_directory(B_USER_SETTINGS_DIRECTORY, -1, false, settingsDir, sizeof(settingsDir)) == B_OK) {
|
||||
+ prefix = settingsDir;
|
||||
+ prefix += "/ResidualVM";
|
||||
+ } else {
|
||||
+ prefix = "/boot/home/config/settings/ResidualVM";
|
||||
+ }
|
||||
+ mkdir(prefix.c_str(), 0755);
|
||||
#elif !defined(SAMSUNGTV)
|
||||
const char *envVar;
|
||||
// Our old configuration file path for POSIX systems was ~/.residualvmrc.
|
||||
@@ -180,6 +193,14 @@ Common::WriteStream *OSystem_POSIX::createLogFile() {
|
||||
#elif SAMSUNGTV
|
||||
prefix = nullptr;
|
||||
logFile = "/mtd_ram";
|
||||
+#elif defined(__HAIKU__)
|
||||
+ static char cacheDir[PATH_MAX] = "";
|
||||
+ if (find_directory(B_USER_CACHE_DIRECTORY, -1, false, cacheDir, sizeof(cacheDir)) == B_OK) {
|
||||
+ prefix = cacheDir;
|
||||
+ } else {
|
||||
+ prefix = "/boot/home/config/cache";
|
||||
+ }
|
||||
+ logFile = "ResidualVM/logs";
|
||||
#else
|
||||
// On POSIX systems we follow the XDG Base Directory Specification for
|
||||
// where to store files. The version we based our code upon can be found
|
||||
@@ -268,6 +289,11 @@ bool OSystem_POSIX::displayLogFile() {
|
||||
bool OSystem_POSIX::openUrl(const Common::String &url) {
|
||||
// inspired by Qt's "qdesktopservices_x11.cpp"
|
||||
|
||||
+#ifdef __HAIKU__
|
||||
+ if (launchBrowser("open", url))
|
||||
+ return true;
|
||||
+#endif
|
||||
+
|
||||
// try "standards"
|
||||
if (launchBrowser("xdg-open", url))
|
||||
return true;
|
||||
diff --git a/backends/platform/sdl/sdl.cpp b/backends/platform/sdl/sdl.cpp
|
||||
index 415eb36..130f02a 100644
|
||||
--- a/backends/platform/sdl/sdl.cpp
|
||||
+++ b/backends/platform/sdl/sdl.cpp
|
||||
@@ -426,8 +426,11 @@ void OSystem_SDL::launcherInitSize(uint w, uint h) {
|
||||
Graphics::RendererType matchingRendererType = Graphics::getBestMatchingAvailableRendererType(desiredRendererType);
|
||||
|
||||
bool fullscreen = ConfMan.getBool("fullscreen");
|
||||
-
|
||||
+#ifdef __HAIKU__
|
||||
+ setupScreen(w, h, fullscreen, false);
|
||||
+#else
|
||||
setupScreen(w, h, fullscreen, matchingRendererType != Graphics::kRendererTypeTinyGL);
|
||||
+#endif
|
||||
}
|
||||
// End of ResidualVM specific code
|
||||
|
||||
diff --git a/backends/saves/posix/posix-saves.cpp b/backends/saves/posix/posix-saves.cpp
|
||||
index 84be67b..0d8fd58 100644
|
||||
--- a/backends/saves/posix/posix-saves.cpp
|
||||
+++ b/backends/saves/posix/posix-saves.cpp
|
||||
@@ -44,6 +44,10 @@
|
||||
#include <errno.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
+#ifdef __HAIKU__
|
||||
+#include <FindDirectory.h>
|
||||
+#endif
|
||||
+
|
||||
POSIXSaveFileManager::POSIXSaveFileManager() {
|
||||
// Register default savepath.
|
||||
#if defined(SAMSUNGTV)
|
||||
@@ -59,7 +63,16 @@ POSIXSaveFileManager::POSIXSaveFileManager() {
|
||||
|
||||
ConfMan.registerDefault("savepath", savePath);
|
||||
}
|
||||
-
|
||||
+#elif defined(__HAIKU__)
|
||||
+ static char settingsDir[PATH_MAX] = "";
|
||||
+ if (find_directory(B_USER_SETTINGS_DIRECTORY, -1, false, settingsDir, sizeof(settingsDir)) == B_OK) {
|
||||
+ savePath = settingsDir;
|
||||
+ savePath += "/ResidualVM/Savegames";
|
||||
+ } else {
|
||||
+ savePath = "/boot/home/config/settings/ResidualVM/Savegames";
|
||||
+ }
|
||||
+ mkdir(savePath.c_str(), 0755);
|
||||
+ ConfMan.registerDefault("savepath", savePath);
|
||||
#else
|
||||
const char *envVar;
|
||||
|
||||
--
|
||||
2.19.1
|
||||
|
||||
Reference in New Issue
Block a user