| 250 | } |
| 251 | |
| 252 | std::filesystem::path Filesystem::getBaseDir() noexcept |
| 253 | { |
| 254 | auto getsavebase = []() { |
| 255 | // assume portable mode is _on_ if init is missing |
| 256 | if (!df::global::init || df::global::init->media.flag.is_set(df::enums::init_media_flags::PORTABLE_MODE)) |
| 257 | return DFSDL::DFSDL_GetBasePath(); |
| 258 | else |
| 259 | return DFSDL::DFSDL_GetPrefPath("Bay 12 Games", "Dwarf Fortress"); |
| 260 | }; |
| 261 | return std::filesystem::path{ getsavebase() }; |
| 262 | } |