diff options
Diffstat (limited to 'common')
-rw-r--r-- | common/config-manager.cpp | 6 | ||||
-rw-r--r-- | common/file.cpp | 4 |
2 files changed, 7 insertions, 3 deletions
diff --git a/common/config-manager.cpp b/common/config-manager.cpp index da31161919..59fd27bc0a 100644 --- a/common/config-manager.cpp +++ b/common/config-manager.cpp @@ -82,7 +82,9 @@ ConfigManager::ConfigManager() void ConfigManager::loadDefaultConfigFile() { char configFile[MAXPATHLEN]; -#if defined(UNIX) && !defined(GP2X) // GP2X is Linux based but Home dir can be read only so do not use it and put the config in the executable dir. + // GP2X is Linux based but Home dir can be read only so do not use it and put the config in the executable dir. + // On the iPhone, the home dir of the user when you launch the app from the Springboard, is /. Which we don't want. +#if defined(UNIX) && !defined(GP2X) && !defined(IPHONE) const char *home = getenv("HOME"); if (home != NULL && strlen(home) < MAXPATHLEN) snprintf(configFile, MAXPATHLEN, "%s/%s", home, DEFAULT_CONFIG_FILE); @@ -135,6 +137,8 @@ void ConfigManager::loadDefaultConfigFile() { #elif defined(PALMOS_MODE) strcpy(configFile,"/PALM/Programs/ScummVM/" DEFAULT_CONFIG_FILE); + #elif defined(IPHONE) + strcpy(configFile,"/var/root/" DEFAULT_CONFIG_FILE); #elif defined(__PLAYSTATION2__) ((OSystem_PS2*)g_system)->makeConfigPath(configFile); #elif defined(__PSP__) diff --git a/common/file.cpp b/common/file.cpp index 2bf65abf62..3c2dfd4f59 100644 --- a/common/file.cpp +++ b/common/file.cpp @@ -30,7 +30,7 @@ #include "common/hash-str.h" #include <errno.h> -#ifdef MACOSX +#if defined(MACOSX) || defined(IPHONE) #include "CoreFoundation/CoreFoundation.h" #endif @@ -329,7 +329,7 @@ bool File::open(const String &filename, AccessMode mode) { _handle = fopenNoCase(filename, "", modeStr); // Last last (really) resort: try looking inside the application bundle on Mac OS X for the lowercase file. -#ifdef MACOSX +#if defined(MACOSX) || defined(IPHONE) if (!_handle) { CFStringRef cfFileName = CFStringCreateWithBytes(NULL, (const UInt8 *)filename.c_str(), filename.size(), kCFStringEncodingASCII, false); CFURLRef fileUrl = CFBundleCopyResourceURL(CFBundleGetMainBundle(), cfFileName, NULL, NULL); |