aboutsummaryrefslogtreecommitdiff
path: root/backends/platform/sdl/posix
diff options
context:
space:
mode:
authorAlejandro Marzini2010-06-24 17:37:09 +0000
committerAlejandro Marzini2010-06-24 17:37:09 +0000
commit307d7aeb4fc044d925295b6ed1d4c7c359a99920 (patch)
tree168f5c576534ab3c91ba183f5ae4adf5a29622a1 /backends/platform/sdl/posix
parent86a502c1de0441431c4a002479294db4006d6310 (diff)
downloadscummvm-rg350-307d7aeb4fc044d925295b6ed1d4c7c359a99920.tar.gz
scummvm-rg350-307d7aeb4fc044d925295b6ed1d4c7c359a99920.tar.bz2
scummvm-rg350-307d7aeb4fc044d925295b6ed1d4c7c359a99920.zip
Added a init function to OSystem_SDL for early backend setup, and so allowing better sub classing.
svn-id: r50224
Diffstat (limited to 'backends/platform/sdl/posix')
-rw-r--r--backends/platform/sdl/posix/main.cpp6
-rw-r--r--backends/platform/sdl/posix/posix.cpp6
-rw-r--r--backends/platform/sdl/posix/posix.h2
3 files changed, 14 insertions, 0 deletions
diff --git a/backends/platform/sdl/posix/main.cpp b/backends/platform/sdl/posix/main.cpp
index cf1bc6ff2f..5f734e6b0e 100644
--- a/backends/platform/sdl/posix/main.cpp
+++ b/backends/platform/sdl/posix/main.cpp
@@ -37,13 +37,19 @@ int main(int argc, char *argv[]) {
g_system = new OSystem_POSIX();
assert(g_system);
+ // Pre initialize the backend
+ ((OSystem_POSIX *)g_system)->init();
+
#ifdef DYNAMIC_MODULES
PluginManager::instance().addPluginProvider(new SDLPluginProvider());
#endif
// Invoke the actual ScummVM main entry point:
int res = scummvm_main(argc, argv);
+
+ // Free OSystem
delete (OSystem_POSIX *)g_system;
+
return res;
}
diff --git a/backends/platform/sdl/posix/posix.cpp b/backends/platform/sdl/posix/posix.cpp
index aec36de910..e92a4398d9 100644
--- a/backends/platform/sdl/posix/posix.cpp
+++ b/backends/platform/sdl/posix/posix.cpp
@@ -44,8 +44,14 @@
#define DEFAULT_CONFIG_FILE ".scummvmrc"
OSystem_POSIX::OSystem_POSIX() {
+}
+
+void OSystem_Win32::init() {
// Initialze File System Factory
_fsFactory = new POSIXFilesystemFactory();
+
+ // Invoke parent implementation of this method
+ OSystem_SDL::init();
}
void OSystem_POSIX::initBackend() {
diff --git a/backends/platform/sdl/posix/posix.h b/backends/platform/sdl/posix/posix.h
index 2e87709598..a8d5e9a23b 100644
--- a/backends/platform/sdl/posix/posix.h
+++ b/backends/platform/sdl/posix/posix.h
@@ -33,6 +33,8 @@ public:
OSystem_POSIX();
virtual ~OSystem_POSIX() {}
+ virtual void init();
+
virtual void initBackend();
protected: