diff options
author | Vincent Bénony | 2015-12-01 19:07:47 +0100 |
---|---|---|
committer | Vincent Bénony | 2016-01-06 15:35:31 +0100 |
commit | 62606412b117117373a6e966ad82f3a8af855f40 (patch) | |
tree | 84a881b890372ab1f1b11b23f19116141fa7ee79 /backends/platform/iphone | |
parent | 452968ec679909bc6a3fdab682d3ba91b245642c (diff) | |
download | scummvm-rg350-62606412b117117373a6e966ad82f3a8af855f40.tar.gz scummvm-rg350-62606412b117117373a6e966ad82f3a8af855f40.tar.bz2 scummvm-rg350-62606412b117117373a6e966ad82f3a8af855f40.zip |
IOS: Uses the chroot filesystem
Diffstat (limited to 'backends/platform/iphone')
-rw-r--r-- | backends/platform/iphone/osys_main.cpp | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/backends/platform/iphone/osys_main.cpp b/backends/platform/iphone/osys_main.cpp index 968c7c56cb..9d0a7f4411 100644 --- a/backends/platform/iphone/osys_main.cpp +++ b/backends/platform/iphone/osys_main.cpp @@ -38,6 +38,8 @@ #include "backends/saves/default/default-saves.h" #include "backends/timer/default/default-timer.h" +#include "backends/fs/chroot/chroot-fs-factory.h" +#include "backends/fs/posix/posix-fs.h" #include "audio/mixer.h" #include "audio/mixer_intern.h" @@ -63,7 +65,11 @@ OSystem_IPHONE::OSystem_IPHONE() : _mouseCursorPaletteEnabled(false), _gfxTransactionError(kTransactionSuccess) { _queuedInputEvent.type = Common::EVENT_INVALID; _touchpadModeEnabled = !iPhone_isHighResDevice(); +#ifdef IPHONE_OFFICIAL + _fsFactory = new ChRootFilesystemFactory(iPhone_getDocumentsDir()); +#else _fsFactory = new POSIXFilesystemFactory(); +#endif initVideoContext(); memset(_gamePalette, 0, sizeof(_gamePalette)); @@ -95,7 +101,7 @@ int OSystem_IPHONE::timerHandler(int t) { void OSystem_IPHONE::initBackend() { #ifdef IPHONE_OFFICIAL - _savefileManager = new DefaultSaveFileManager(iPhone_getDocumentsDir()); + _savefileManager = new DefaultSaveFileManager("/savegames"); #else _savefileManager = new DefaultSaveFileManager(SCUMMVM_SAVE_PATH); #endif @@ -257,8 +263,7 @@ OSystem *OSystem_IPHONE_create() { Common::String OSystem_IPHONE::getDefaultConfigFileName() { #ifdef IPHONE_OFFICIAL - Common::String path = iPhone_getDocumentsDir(); - path += "/Preferences"; + Common::String path = "/Preferences"; return path; #else return SCUMMVM_PREFS_PATH; @@ -274,7 +279,14 @@ void OSystem_IPHONE::addSysArchivesToSearchSet(Common::SearchSet &s, int priorit if (CFURLGetFileSystemRepresentation(fileUrl, true, buf, sizeof(buf))) { // Success: Add it to the search path Common::String bundlePath((const char *)buf); +#ifdef IPHONE_OFFICIAL + POSIXFilesystemNode *posixNode = new POSIXFilesystemNode(bundlePath); + Common::FSNode *node = new Common::FSNode(posixNode); + s.add("__OSX_BUNDLE__", new Common::FSDirectory(*node), priority); +#else + // OS X s.add("__OSX_BUNDLE__", new Common::FSDirectory(bundlePath), priority); +#endif } CFRelease(fileUrl); } |