From 62606412b117117373a6e966ad82f3a8af855f40 Mon Sep 17 00:00:00 2001 From: Vincent Bénony Date: Tue, 1 Dec 2015 19:07:47 +0100 Subject: IOS: Uses the chroot filesystem --- backends/platform/iphone/osys_main.cpp | 18 +++++++++++++++--- 1 file 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); } -- cgit v1.2.3