iOS document directories. Might use these on other platforms as well.
This commit is contained in:
parent
d21f643d74
commit
0238d1529f
1 changed files with 17 additions and 0 deletions
|
@ -52,6 +52,15 @@
|
|||
#include <algorithm>
|
||||
#include <set>
|
||||
|
||||
// Copied from boost::predef, as it's there only since 1.55.
|
||||
#if defined(__APPLE__) && defined(__MACH__) && defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__)
|
||||
|
||||
#define WESNOTH_BOOST_OS_IOS (__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__*1000)
|
||||
#include <SDL_filesystem.h>
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
static lg::log_domain log_filesystem("filesystem");
|
||||
#define DBG_FS LOG_STREAM(debug, log_filesystem)
|
||||
#define LOG_FS LOG_STREAM(info, log_filesystem)
|
||||
|
@ -618,6 +627,14 @@ void set_user_data_dir(std::string newprefdir)
|
|||
|
||||
std::string backupprefdir = ".wesnoth" + get_version_path_suffix();
|
||||
|
||||
#ifdef WESNOTH_BOOST_OS_IOS
|
||||
char *sdl_pref_path = SDL_GetPrefPath("wesnoth.org", "iWesnoth");
|
||||
if(sdl_pref_path) {
|
||||
backupprefdir = std::string(sdl_pref_path) + backupprefdir;
|
||||
SDL_free(sdl_pref_path);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef _X11
|
||||
const char* home_str = getenv("HOME");
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue