ResidualVM: bump version

* fix settings paths
* fix opengl init
* add application icon
This commit is contained in:
Gerasim Troeglazov
2018-10-27 19:48:01 +10:00
parent 800e6d65d7
commit e20e8926a7
3 changed files with 193 additions and 11 deletions

View File

@@ -0,0 +1,47 @@
resource app_flags B_SINGLE_LAUNCH;
resource app_version {
major = @MAJOR@,
middle = @MIDDLE@,
minor = @MINOR@,
variety = B_APPV_FINAL,
internal = 0,
short_info = "ResidualVM",
long_info = "@LONG_INFO@"
};
resource app_signature "@APP_SIGNATURE@";
resource vector_icon array {
$"6E636966080500020006023E49D7381134B904473F56ED492C32C167BA4DFFD2"
$"7CE0BC7105057C020016023FF52DBA51F43A51F43FF52DC4F6A943DA80457EFF"
$"3B020016033F89383CD898BCFC9B3FB5F544D3A5C63D8A66E8BD63F729040069"
$"020006033F888E3E6438BE3DF53F50064958DEC50A0662FFFFFF93E4ED06FFAE"
$"B40402001402A244FF2307040AF6FF0B2340482C51B783C5EAB822C751305230"
$"C49930533358B8F056BC9CCA4F3B5FBD79CC623C5E424DC171C53A3F4C464EC1"
$"7BC57E524B4F3CC5DDBEFEC593BD4249330209BB51C86AB8A0C76BBE01C969C0"
$"4CC8D03C57C2FCC8B0C547C5A0C4B1C6F5C5D3C461C5A0C1D7C5E0C323C598C1"
$"AFC6DFC0A5C608C15DC791C00CC903BF4DC86ABFCCC980BEE4C98FBCC3C9ABBD"
$"5AC95CBBAAC71FB953C86ABA45C60AB88949B76EC395B76EC316B76E0213B7EE"
$"BEA72F37B7ABBF47B6AFBF33B716BE66B66FBFB3B517C1F1B99CC38122C17EB2"
$"A6C3E21FC316B2BAC520B4B1C65FB3FF50B4E3C671B6AFC87728C712B70AC976"
$"BB37CC00B788CC26BBADCBFBBDCE5CBCC3CBB9BE81CA5BBF73C560BF73C560BF"
$"73C560C04C54C04C54C04C54C0FEC7054252C171C71FC4D4C75EC3FB53C621C7"
$"72C811C646C7ACC682C890C5F9C98FC4A1C969C5F9C9AAC3B0C778C230C7ACC3"
$"5FC72BC072C8DDBF0DC842C042583C5839C967BD8DC944BCAC5234C92ABC17C5"
$"86BA45332FBBFCB881273302105737502ECA23BDBCC910BFA6C910BEE7C910C0"
$"13C791C20AC757C123C7EBC36F59C47BC969C3C8CA20C573C7EBC6B9C856C689"
$"C77852C4C754C65FC798C37CC7D1C18B54C1FDC7D1C118C79EBECDC82ABECDC8"
$"2ABECDC82ABE015CBF66C9E9BD14CB91BBAACC0DBC1FCC032BCC66B67CC890B6"
$"EFC9F5B604C71AB47EC679B511C6A6B3D8C646B2734AB2734DB273C323B4CBC1"
$"7EB38BC1A3B616442B3BB7A1BE412A39312FB7C62F382F0609BA99023F314635"
$"483E4B38464242414C3B4842384631420605BA0245354837483BC3CEBCE3C211"
$"BEA0433C40390608BAA24B3153365742C91EBE64C8B8C292534B4D4F49435E38"
$"52070A000103123F84760000000000003F8476455E1242D5D401178400040A06"
$"0102023F84760000000000003F8476455E1242D5D40A05010602400000000000"
$"0000003FD27D0000004182D80A040100023FCB120000000000003FCB1244E7D0"
$"BF8E810A0101040240B2553CC691BCEF0B408D214157F8C879850A0301041240"
$"B2553CC691BCEF0B408D214157F8C8798501178300040A03010500"
};

View 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

View File

@@ -4,11 +4,13 @@ DESCRIPTION="ResidualVM is a program which allows you to run certain classic \
replaces the executables shipped with the game, allowing you to play them on \
systems for which they were never designed!"
HOMEPAGE="http://www.residualvm.org/"
COPYRIGHT="2003-2017 ResidualVM Team"
COPYRIGHT="2003-2018 ResidualVM Team"
LICENSE="GNU GPL v2"
REVISION="1"
SOURCE_URI="http://www.residualvm.org/downloads/release/$portVersion/residualvm-$portVersion-sources.tar.gz"
CHECKSUM_SHA256="45d86430475f1a17923d2d19ee08433269dd5da850352baf550bb7461f6aba1c"
CHECKSUM_SHA256="515b02129dd374bc9c0b732ddeaaaa3a342cc25ea0ea3c4ccf19141b5d362e1d"
PATCHES="residualvm-$portVersion.patchset"
ADDITIONAL_FILES="residualvm.rdef.in"
ARCHITECTURES="!x86_gcc2 x86 x86_64"
SECONDARY_ARCHITECTURES="x86"
@@ -27,21 +29,20 @@ REQUIRES="
lib:libfluidsynth$secondaryArchSuffix
lib:libfreetype$secondaryArchSuffix
lib:libgl$secondaryArchSuffix
# lib:libglew$secondaryArchSuffix
lib:libglu$secondaryArchSuffix
lib:libiconv$secondaryArchSuffix
lib:libintl$secondaryArchSuffix
lib:libjpeg$secondaryArchSuffix
lib:libmad$secondaryArchSuffix
lib:libmpeg2$secondaryArchSuffix
lib:libnghttp2$secondaryArchSuffix
lib:libogg$secondaryArchSuffix
lib:libpng16$secondaryArchSuffix
lib:libreadline$secondaryArchSuffix
lib:libSDL$secondaryArchSuffix
# lib:libsdl_net$secondaryArchSuffix
lib:libSDL2_2.0$secondaryArchSuffix
lib:libSDL2_net_2.0$secondaryArchSuffix
lib:libssl$secondaryArchSuffix
lib:libtheoradec$secondaryArchSuffix
# lib:libtimidity$secondaryArchSuffix
lib:libvorbis$secondaryArchSuffix
lib:libvorbisfile$secondaryArchSuffix
lib:libz$secondaryArchSuffix
@@ -57,21 +58,20 @@ BUILD_REQUIRES="
devel:libfluidsynth$secondaryArchSuffix
devel:libfreetype$secondaryArchSuffix
devel:libgl$secondaryArchSuffix
# devel:libglew$secondaryArchSuffix
devel:libglu$secondaryArchSuffix
devel:libiconv$secondaryArchSuffix
devel:libintl$secondaryArchSuffix
devel:libjpeg$secondaryArchSuffix
devel:libmad$secondaryArchSuffix
devel:libmpeg2$secondaryArchSuffix
devel:libnghttp2$secondaryArchSuffix
devel:libogg$secondaryArchSuffix
devel:libpng16$secondaryArchSuffix
devel:libreadline$secondaryArchSuffix
devel:libSDL$secondaryArchSuffix
# devel:libsdl_net$secondaryArchSuffix
devel:libSDL2_2.0$secondaryArchSuffix
devel:libSDL2_net_2.0$secondaryArchSuffix
devel:libssl$secondaryArchSuffix
devel:libtheoradec$secondaryArchSuffix
# devel:libtimidity$secondaryArchSuffix
devel:libvorbis$secondaryArchSuffix
devel:libvorbisfile$secondaryArchSuffix
devel:libz$secondaryArchSuffix
@@ -87,6 +87,7 @@ BUILD_PREREQUIRES="
BUILD()
{
CPPFLAGS=`freetype-config --cflags` ./configure --prefix=$appsDir/ResidualVM \
--enable-all-engines \
--enable-release \
--enable-libcurl \
--enable-fluidsynth \
@@ -105,5 +106,22 @@ INSTALL()
make install
mv $appsDir/ResidualVM/bin/residualvm $appsDir/ResidualVM/ResidualVM
rm -R $appsDir/ResidualVM/bin
addAppDeskbarSymlink $appsDir/ResidualVM/ResidualVM ResidualVM
local APP_SIGNATURE="application/x-vnd.residualvm"
local MAJOR="`echo "$portVersion" | cut -d. -f1`"
local MIDDLE="`echo "$portVersion" | cut -d. -f2`"
local MINOR="`echo "$portVersion" | cut -d. -f2`"
local LONG_INFO="$SUMMARY"
sed \
-e "s|@APP_SIGNATURE@|$APP_SIGNATURE|" \
-e "s|@MAJOR@|$MAJOR|" \
-e "s|@MIDDLE@|$MIDDLE|" \
-e "s|@MINOR@|$MINOR|" \
-e "s|@LONG_INFO@|$LONG_INFO|" \
$portDir/additional-files/residualvm.rdef.in > $sourceDir/residualvm.rdef
addResourcesToBinaries $sourceDir/residualvm.rdef \
$appsDir/ResidualVM/ResidualVM
addAppDeskbarSymlink $appsDir/ResidualVM/ResidualVM
}