mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-22 11:40:06 +02:00
Improved patch for Slime Volley.
Cleaner with use of #ifdef __HAIKU__
This commit is contained in:
@@ -1,38 +1,49 @@
|
||||
From 924ce773527465b27a61eeabf5a7f4a44bc32bde Mon Sep 17 00:00:00 2001
|
||||
From 1f268374d0eb8959082ba8d42aad35bfe264dae0 Mon Sep 17 00:00:00 2001
|
||||
From: Humdinger <humdingerb@gmail.com>
|
||||
Date: Sat, 5 Sep 2015 09:03:25 +0200
|
||||
Subject: Put settings file into /boot/home/config/settings
|
||||
Date: Sat, 5 Sep 2015 11:03:52 +0200
|
||||
Subject: Put settings in the right folder for Haiku.
|
||||
|
||||
|
||||
diff --git a/src/slime.c b/src/slime.c
|
||||
index 683d04a..84c3beb 100644
|
||||
index 683d04a..0125baa 100644
|
||||
--- a/src/slime.c
|
||||
+++ b/src/slime.c
|
||||
@@ -29,6 +29,7 @@ $Id: slime.c 257 2008-11-23 10:03:21Z vinduv $
|
||||
#include <SDL.h>
|
||||
#include <SDL_ttf.h>
|
||||
#include <SDL_image.h>
|
||||
+#include <storage/FindDirectory.h>
|
||||
@@ -39,6 +39,10 @@ $Id: slime.c 257 2008-11-23 10:03:21Z vinduv $
|
||||
|
||||
#include "config.h"
|
||||
#include "slime.h"
|
||||
@@ -237,11 +238,11 @@ int main(int argc, char* argv[]) {
|
||||
#include "credits.h"
|
||||
|
||||
+#ifdef __HAIKU__
|
||||
+ #include <storage/FindDirectory.h>
|
||||
+#endif
|
||||
+
|
||||
#ifdef WINDOWS
|
||||
#define CONFIG_NOM "slime.ini"
|
||||
#define SEP "\\"
|
||||
@@ -236,7 +240,7 @@ int main(int argc, char* argv[]) {
|
||||
chemin_moi = argv[0];
|
||||
}
|
||||
|
||||
#ifndef MACOS9
|
||||
- if(getenv(DOSS_PREFS) != NULL) {
|
||||
- conf_chemin[0] = '\0';
|
||||
- strncat(conf_chemin, getenv(DOSS_PREFS), sizeof(conf_chemin));
|
||||
- strncat(conf_chemin, SEP, sizeof(conf_chemin));
|
||||
- strncat(conf_chemin, CONFIG_NOM, sizeof(conf_chemin));
|
||||
-#ifndef MACOS9
|
||||
+#ifndef MACOS9 || __HAIKU__
|
||||
if(getenv(DOSS_PREFS) != NULL) {
|
||||
conf_chemin[0] = '\0';
|
||||
strncat(conf_chemin, getenv(DOSS_PREFS), sizeof(conf_chemin));
|
||||
@@ -245,6 +249,15 @@ int main(int argc, char* argv[]) {
|
||||
}
|
||||
#endif
|
||||
|
||||
+#ifdef __HAIKU__
|
||||
+ conf_chemin[256] = '\0';
|
||||
+ find_directory(B_USER_SETTINGS_DIRECTORY, 0, true, conf_chemin, sizeof(conf_chemin));
|
||||
+ if(conf_chemin != NULL) {
|
||||
+ strncat(conf_chemin, "/", sizeof(conf_chemin));
|
||||
+ strncat(conf_chemin, "Slime_Volley", sizeof(conf_chemin));
|
||||
}
|
||||
#endif
|
||||
+ }
|
||||
+#endif
|
||||
+
|
||||
config_fich = fopen(conf_chemin, "rb");
|
||||
|
||||
if(config_fich == NULL) {
|
||||
--
|
||||
2.2.2
|
||||
|
||||
|
||||
Reference in New Issue
Block a user