Skip to content

Commit

Permalink
Define Haiku assets path
Browse files Browse the repository at this point in the history
  • Loading branch information
Peppersawce authored and AJenbo committed Oct 23, 2024
1 parent 6523ac8 commit da0418d
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Source/utils/paths.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
#include "utils/log.hpp"
#include "utils/sdl_ptrs.h"

#ifdef __HAIKU__
#include <FindDirectory.h>
#include <fs_info.h>
#endif

#ifdef __IPHONEOS__
#include "platform/ios/ios_paths.h"
#endif
Expand Down Expand Up @@ -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

This comment has been minimized.

Copy link
@Peppersawce

Peppersawce Oct 23, 2024

Author Contributor

Since the code has changed a bit, afaik it would be best to change

#endif
#if __EMSCRIPTEN__

to

#elif __EMSCRIPTEN__

or else the path may be changed further down the line in the case of Haiku

This comment has been minimized.

Copy link
@AJenbo

AJenbo Oct 23, 2024

Member

True, feel free to send a PR

#if __EMSCRIPTEN__
assetsPath.emplace("assets/");
#elif defined(NXDK)
Expand Down

0 comments on commit da0418d

Please sign in to comment.