[Scummvm-cvs-logs] SF.net SVN: scummvm: [31107] scummvm/trunk
fingolfin at users.sourceforge.net
fingolfin at users.sourceforge.net
Tue Mar 11 18:24:34 CET 2008
Revision: 31107
http://scummvm.svn.sourceforge.net/scummvm/?rev=31107&view=rev
Author: fingolfin
Date: 2008-03-11 10:24:34 -0700 (Tue, 11 Mar 2008)
Log Message:
-----------
Added OSystem_SDL::getFilesystemFactory()
Modified Paths:
--------------
scummvm/trunk/backends/platform/sdl/sdl.cpp
scummvm/trunk/backends/platform/sdl/sdl.h
scummvm/trunk/common/system.cpp
Modified: scummvm/trunk/backends/platform/sdl/sdl.cpp
===================================================================
--- scummvm/trunk/backends/platform/sdl/sdl.cpp 2008-03-11 05:45:23 UTC (rev 31106)
+++ scummvm/trunk/backends/platform/sdl/sdl.cpp 2008-03-11 17:24:34 UTC (rev 31107)
@@ -38,7 +38,21 @@
#define SAMPLES_PER_SEC 22050
//#define SAMPLES_PER_SEC 44100
+/*
+ * Include header files needed for the getFilesystemFactory() method.
+ */
+#if defined(__amigaos4__)
+ #include "backends/fs/amigaos4/amigaos4-fs-factory.h"
+#elif defined(__SYMBIAN32__)
+ // TODO: Move this to the symbian source code
+ #include "backends/fs/symbian/symbian-fs-factory.h"
+#elif defined(UNIX)
+ #include "backends/fs/posix/posix-fs-factory.h"
+#elif defined(WIN32)
+ #include "backends/fs/windows/windows-fs-factory.h"
+#endif
+
static Uint32 timer_handler(Uint32 interval, void *param) {
((DefaultTimerManager *)param)->handler();
return interval;
@@ -212,6 +226,20 @@
return _savefile;
}
+FilesystemFactory *OSystem_SDL::getFilesystemFactory() {
+ #if defined(__amigaos4__)
+ return &AmigaOSFilesystemFactory::instance();
+ #elif defined(__SYMBIAN32__)
+ return &SymbianFilesystemFactory::instance();
+ #elif defined(UNIX)
+ return &POSIXFilesystemFactory::instance();
+ #elif defined(WIN32)
+ return &WindowsFilesystemFactory::instance();
+ #else
+ #error Unknown and unsupported backend in OSystem_SDL::getFilesystemFactory
+ #endif
+}
+
void OSystem_SDL::setWindowCaption(const char *caption) {
SDL_WM_SetCaption(caption, caption);
}
Modified: scummvm/trunk/backends/platform/sdl/sdl.h
===================================================================
--- scummvm/trunk/backends/platform/sdl/sdl.h 2008-03-11 05:45:23 UTC (rev 31106)
+++ scummvm/trunk/backends/platform/sdl/sdl.h 2008-03-11 17:24:34 UTC (rev 31107)
@@ -196,6 +196,7 @@
#endif
virtual Common::SaveFileManager *getSavefileManager();
+ virtual FilesystemFactory *getFilesystemFactory();
protected:
bool _inited;
Modified: scummvm/trunk/common/system.cpp
===================================================================
--- scummvm/trunk/common/system.cpp 2008-03-11 05:45:23 UTC (rev 31106)
+++ scummvm/trunk/common/system.cpp 2008-03-11 17:24:34 UTC (rev 31107)
@@ -133,15 +133,12 @@
}
/*
- * All the following includes choose, at compile time, which specific backend will be used
- * during the execution of the ScummVM.
+ * Include header files needed for the getFilesystemFactory() method.
*
- * TODO: Remove these gradually and instead move the getFilesystemFactory() implementatios
- * to the respective backends.
+ * TODO: Remove these gradually and move the getFilesystemFactory() implementations
+ * to the respective backends. Then turn it into a pure virtual method of OSystem.
*/
-#if defined(__amigaos4__)
- #include "backends/fs/amigaos4/amigaos4-fs-factory.h"
-#elif defined(__DS__)
+#if defined(__DS__)
#include "backends/fs/ds/ds-fs-factory.h"
#elif defined(__GP32__)
#include "backends/fs/gp32/gp32-fs-factory.h"
@@ -153,20 +150,12 @@
#include "backends/fs/ps2/ps2-fs-factory.h"
#elif defined(__PSP__)
#include "backends/fs/psp/psp-fs-factory.h"
-#elif defined(__SYMBIAN32__)
- #include "backends/fs/symbian/symbian-fs-factory.h"
-#elif defined(UNIX)
- #include "backends/fs/posix/posix-fs-factory.h"
-#elif defined(WIN32)
- #include "backends/fs/windows/windows-fs-factory.h"
#endif
FilesystemFactory *OSystem::getFilesystemFactory() {
- #if defined(__amigaos4__)
- return &AmigaOSFilesystemFactory::instance();
- #elif defined(__DC__)
- // The DC port overrides this function...
- abort();
+ #if defined(__amigaos4__) || defined(__DC__) || defined(__SYMBIAN32__) || defined(UNIX) || defined(WIN32)
+ // These ports already implement this function, so it should never be called.
+ return 0;
#elif defined(__DS__)
return &DSFilesystemFactory::instance();
#elif defined(__GP32__)
@@ -179,12 +168,6 @@
return &Ps2FilesystemFactory::instance();
#elif defined(__PSP__)
return &PSPFilesystemFactory::instance();
- #elif defined(__SYMBIAN32__)
- return &SymbianFilesystemFactory::instance();
- #elif defined(UNIX)
- return &POSIXFilesystemFactory::instance();
- #elif defined(WIN32)
- return &WindowsFilesystemFactory::instance();
#else
#error Unknown and unsupported backend in OSystem::getFilesystemFactory
#endif
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list