import ADV settings, platform files

This commit is contained in:
Ondřej Novák 2025-01-30 20:43:42 +01:00
parent 9b86bed2d8
commit ccebc91f0d
17 changed files with 244 additions and 14 deletions

View file

@ -0,0 +1,25 @@
#include "../save_folder.h"
#include "../error.h"
#include <filesystem>
static std::string get_default_savegame_dir() {
// Linux
char* home = std::getenv("HOME");
if (home) {
return std::filesystem::path(home) / ".local/share/" SAVEGAME_FOLDERNAME;
} else {
display_error("$HOME has no value (user with no home)");
abort();
}
}
const char *get_default_savegame_directory() {
static std::string dir = get_default_savegame_dir();
return dir.c_str();
}