|
64 | 64 | #endif |
65 | 65 | #include <SDL.h> |
66 | 66 | #include <SDL_syswm.h> |
| 67 | +#ifdef __HAIKU__ |
| 68 | +#include <FindDirectory.h> |
| 69 | +#include <StorageDefs.h> |
| 70 | +#endif |
67 | 71 |
|
68 | 72 | namespace OpenXcom |
69 | 73 | { |
@@ -175,7 +179,10 @@ std::vector<std::string> findDataFolders() |
175 | 179 | #else |
176 | 180 | char const *home = getHome(); |
177 | 181 | #ifdef __HAIKU__ |
178 | | - list.push_back("/boot/apps/OpenXcom/"); |
| 182 | + char data_path[B_PATH_NAME_LENGTH]; |
| 183 | + find_directory(B_SYSTEM_SETTINGS_DIRECTORY, 0, true, data_path, sizeof(data_path)-strlen("/OpenXcom/")); |
| 184 | + strcat(data_path,"/OpenXcom/"); |
| 185 | + list.push_back(data_path); |
179 | 186 | #endif |
180 | 187 | char path[MAXPATHLEN]; |
181 | 188 |
|
@@ -267,7 +274,10 @@ std::vector<std::string> findUserFolders() |
267 | 274 | } |
268 | 275 | #else |
269 | 276 | #ifdef __HAIKU__ |
270 | | - list.push_back("/boot/apps/OpenXcom/"); |
| 277 | + char user_path[B_PATH_NAME_LENGTH]; |
| 278 | + find_directory(B_USER_SETTINGS_DIRECTORY, 0, true, user_path, sizeof(user_path)-strlen("/OpenXcom/")); |
| 279 | + strcat(user_path,"/OpenXcom/"); |
| 280 | + list.push_back(user_path); |
271 | 281 | #endif |
272 | 282 | char const *home = getHome(); |
273 | 283 | char path[MAXPATHLEN]; |
@@ -311,7 +321,10 @@ std::string findConfigFolder() |
311 | 321 | #if defined(_WIN32) || defined(__APPLE__) |
312 | 322 | return ""; |
313 | 323 | #elif defined (__HAIKU__) |
314 | | - return "/boot/home/config/settings/openxcom/"; |
| 324 | + char settings_path[B_PATH_NAME_LENGTH]; |
| 325 | + find_directory(B_USER_SETTINGS_DIRECTORY, 0, true, settings_path, sizeof(settings_path)-strlen("/OpenXcom/")); |
| 326 | + strcat(settings_path,"/OpenXcom/"); |
| 327 | + return settings_path; |
315 | 328 | #else |
316 | 329 | char const *home = getHome(); |
317 | 330 | char path[MAXPATHLEN]; |
|
0 commit comments