From afb06b51cceb96cf3ac2baae1f562c673114d108 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Mon, 6 Jun 2011 15:02:33 +0200 Subject: BACKENDS: Unify AudioCD manager instantiation --- backends/platform/iphone/osys_main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'backends/platform/iphone/osys_main.cpp') diff --git a/backends/platform/iphone/osys_main.cpp b/backends/platform/iphone/osys_main.cpp index 12317ad935..75156b9544 100644 --- a/backends/platform/iphone/osys_main.cpp +++ b/backends/platform/iphone/osys_main.cpp @@ -101,7 +101,7 @@ void OSystem_IPHONE::initBackend() { setTimerCallback(&OSystem_IPHONE::timerHandler, 10); - OSystem::initBackend(); + BaseBackend::initBackend(); } bool OSystem_IPHONE::hasFeature(Feature f) { -- cgit v1.2.3 From c8475224221ed14590ad08929a1cadd6e8e3cc4e Mon Sep 17 00:00:00 2001 From: Max Horn Date: Mon, 6 Jun 2011 15:30:21 +0200 Subject: BACKENDS: Add OSystem::getDefaultConfigFileName This is used to provide default implementations for createConfigWriteStream and createConfigReadStream, which can be used by most backends. Note that backends can still override createConfigRead/WriteStream; this could be useful if settings on some port are not stored in a regular file (think 'Windows registry', for a hypothetical example). --- backends/platform/iphone/osys_main.cpp | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) (limited to 'backends/platform/iphone/osys_main.cpp') diff --git a/backends/platform/iphone/osys_main.cpp b/backends/platform/iphone/osys_main.cpp index 75156b9544..d0a10d9edc 100644 --- a/backends/platform/iphone/osys_main.cpp +++ b/backends/platform/iphone/osys_main.cpp @@ -229,29 +229,16 @@ OSystem *OSystem_IPHONE_create() { return new OSystem_IPHONE(); } -Common::SeekableReadStream *OSystem_IPHONE::createConfigReadStream() { +CCommon::String OSystem_IPHONE::getDefaultConfigFileName() { #ifdef IPHONE_OFFICIAL - char buf[256]; - strncpy(buf, iPhone_getDocumentsDir(), 256); - strncat(buf, "/Preferences", 256 - strlen(buf) ); - Common::FSNode file(buf); + Common::String path = iPhone_getDocumentsDir(); + path += "/Preferences"; + return path; #else - Common::FSNode file(SCUMMVM_PREFS_PATH); + return SCUMMVM_PREFS_PATH; #endif - return file.createReadStream(); } -Common::WriteStream *OSystem_IPHONE::createConfigWriteStream() { -#ifdef IPHONE_OFFICIAL - char buf[256]; - strncpy(buf, iPhone_getDocumentsDir(), 256); - strncat(buf, "/Preferences", 256 - strlen(buf) ); - Common::FSNode file(buf); -#else - Common::FSNode file(SCUMMVM_PREFS_PATH); -#endif - return file.createWriteStream(); -} void OSystem_IPHONE::addSysArchivesToSearchSet(Common::SearchSet &s, int priority) { // Get URL of the Resource directory of the .app bundle -- cgit v1.2.3 From 7ea4583d2fcbc7f760a041e265a0bfdff6853064 Mon Sep 17 00:00:00 2001 From: Sven Hesse Date: Tue, 7 Jun 2011 01:43:48 +0200 Subject: IPHONE: Fix a typo, fix compilation (hopefully) --- backends/platform/iphone/osys_main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'backends/platform/iphone/osys_main.cpp') diff --git a/backends/platform/iphone/osys_main.cpp b/backends/platform/iphone/osys_main.cpp index d0a10d9edc..9007f006f8 100644 --- a/backends/platform/iphone/osys_main.cpp +++ b/backends/platform/iphone/osys_main.cpp @@ -229,7 +229,7 @@ OSystem *OSystem_IPHONE_create() { return new OSystem_IPHONE(); } -CCommon::String OSystem_IPHONE::getDefaultConfigFileName() { +Common::String OSystem_IPHONE::getDefaultConfigFileName() { #ifdef IPHONE_OFFICIAL Common::String path = iPhone_getDocumentsDir(); path += "/Preferences"; -- cgit v1.2.3 From 14f0a0c6823dc899a78e3a627200ad1337181b1a Mon Sep 17 00:00:00 2001 From: Max Horn Date: Tue, 7 Jun 2011 10:53:50 +0200 Subject: IPHONE: Use OSystem's 'slots' for timer/savefile manager --- backends/platform/iphone/osys_main.cpp | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) (limited to 'backends/platform/iphone/osys_main.cpp') diff --git a/backends/platform/iphone/osys_main.cpp b/backends/platform/iphone/osys_main.cpp index 9007f006f8..4e5f860f20 100644 --- a/backends/platform/iphone/osys_main.cpp +++ b/backends/platform/iphone/osys_main.cpp @@ -53,7 +53,7 @@ SoundProc OSystem_IPHONE::s_soundCallback = NULL; void *OSystem_IPHONE::s_soundParam = NULL; OSystem_IPHONE::OSystem_IPHONE() : - _savefile(NULL), _mixer(NULL), _timer(NULL), _offscreen(NULL), + _mixer(NULL), _offscreen(NULL), _overlayVisible(false), _fullscreen(NULL), _mouseHeight(0), _mouseWidth(0), _mouseBuf(NULL), _lastMouseTap(0), _queuedEventTime(0), _secondaryTapped(false), _lastSecondaryTap(0), @@ -73,9 +73,7 @@ OSystem_IPHONE::~OSystem_IPHONE() { AudioQueueDispose(s_AudioQueue.queue, true); delete _fsFactory; - delete _savefile; delete _mixer; - delete _timer; delete _offscreen; delete _fullscreen; } @@ -88,12 +86,12 @@ int OSystem_IPHONE::timerHandler(int t) { void OSystem_IPHONE::initBackend() { #ifdef IPHONE_OFFICIAL - _savefile = new DefaultSaveFileManager(iPhone_getDocumentsDir()); + _savefileManager = new DefaultSaveFileManager(iPhone_getDocumentsDir()); #else - _savefile = new DefaultSaveFileManager(SCUMMVM_SAVE_PATH); + _savefileManager = new DefaultSaveFileManager(SCUMMVM_SAVE_PATH); #endif - _timer = new DefaultTimerManager(); + _timerManager = new DefaultTimerManager(); gettimeofday(&_startTime, NULL); @@ -210,21 +208,11 @@ void OSystem_IPHONE::getTimeAndDate(TimeDate &td) const { td.tm_year = t.tm_year; } -Common::SaveFileManager *OSystem_IPHONE::getSavefileManager() { - assert(_savefile); - return _savefile; -} - Audio::Mixer *OSystem_IPHONE::getMixer() { assert(_mixer); return _mixer; } -Common::TimerManager *OSystem_IPHONE::getTimerManager() { - assert(_timer); - return _timer; -} - OSystem *OSystem_IPHONE_create() { return new OSystem_IPHONE(); } -- cgit v1.2.3 From 0a0c6ac07dd6ded3c0b90edd8c8ac3f9518c8a9d Mon Sep 17 00:00:00 2001 From: Max Horn Date: Tue, 7 Jun 2011 13:10:32 +0200 Subject: IPHONE: Use OSystem's _fsFactory slot --- backends/platform/iphone/osys_main.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'backends/platform/iphone/osys_main.cpp') diff --git a/backends/platform/iphone/osys_main.cpp b/backends/platform/iphone/osys_main.cpp index 4e5f860f20..5f27091108 100644 --- a/backends/platform/iphone/osys_main.cpp +++ b/backends/platform/iphone/osys_main.cpp @@ -72,7 +72,6 @@ OSystem_IPHONE::OSystem_IPHONE() : OSystem_IPHONE::~OSystem_IPHONE() { AudioQueueDispose(s_AudioQueue.queue, true); - delete _fsFactory; delete _mixer; delete _offscreen; delete _fullscreen; -- cgit v1.2.3 From fce7f90a94165158ea93d5969d795ad5a565847c Mon Sep 17 00:00:00 2001 From: Max Horn Date: Wed, 8 Jun 2011 14:29:22 +0200 Subject: BACKENDS: Shuffle backends class hierarchy and module initialization --- backends/platform/iphone/osys_main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'backends/platform/iphone/osys_main.cpp') diff --git a/backends/platform/iphone/osys_main.cpp b/backends/platform/iphone/osys_main.cpp index 5f27091108..9325ed50bf 100644 --- a/backends/platform/iphone/osys_main.cpp +++ b/backends/platform/iphone/osys_main.cpp @@ -98,7 +98,7 @@ void OSystem_IPHONE::initBackend() { setTimerCallback(&OSystem_IPHONE::timerHandler, 10); - BaseBackend::initBackend(); + EventsBaseBackend::initBackend(); } bool OSystem_IPHONE::hasFeature(Feature f) { -- cgit v1.2.3