From da0418d654cc621e30757c7540e3456c067ae5e7 Mon Sep 17 00:00:00 2001 From: Peppersawce <157759066+Peppersawce@users.noreply.github.com> Date: Wed, 23 Oct 2024 14:01:05 +0200 Subject: [PATCH] Define Haiku assets path --- Source/utils/paths.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Source/utils/paths.cpp b/Source/utils/paths.cpp index 2f6415bea..a3749ebd6 100644 --- a/Source/utils/paths.cpp +++ b/Source/utils/paths.cpp @@ -7,6 +7,11 @@ #include "utils/log.hpp" #include "utils/sdl_ptrs.h" +#ifdef __HAIKU__ +#include +#include +#endif + #ifdef __IPHONEOS__ #include "platform/ios/ios_paths.h" #endif @@ -114,6 +119,12 @@ const std::string &ConfigPath() const std::string &AssetsPath() { if (!assetsPath) { +#if defined(__HAIKU__) + char buffer[B_PATH_NAME_LENGTH+10]; + find_directory(B_SYSTEM_DATA_DIRECTORY, dev_for_path("/boot"), false, buffer, B_PATH_NAME_LENGTH); + strcat(buffer, "/devilutionx/"); + assetsPath.emplace(strdup(buffer)); +#endif #if __EMSCRIPTEN__ assetsPath.emplace("assets/"); #elif defined(NXDK)