aboutsummaryrefslogtreecommitdiff
path: root/backends/platform/sdl/sdl.cpp
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/sdl.cpp
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/sdl.cpp')
-rw-r--r--backends/platform/sdl/sdl.cpp22
1 files changed, 13 insertions, 9 deletions
diff --git a/backends/platform/sdl/sdl.cpp b/backends/platform/sdl/sdl.cpp
index e9b35fae32..85506c9520 100644
--- a/backends/platform/sdl/sdl.cpp
+++ b/backends/platform/sdl/sdl.cpp
@@ -54,18 +54,25 @@ OSystem_SDL::~OSystem_SDL() {
deinit();
}
-void OSystem_SDL::initBackend() {
- // Check if backend has not been initialized
- assert(!_inited);
-
+void OSystem_SDL::init() {
// Initialize SDL
initSDL();
- // Creates the backend managers, if they don't exist yet (we check
- // for this to allow subclasses to provide their own).
+ // Creates the early needed managers, if they don't exist yet
+ // (we check for this to allow subclasses to provide their own).
if (_mutexManager == 0)
_mutexManager = new SdlMutexManager();
+ if (_timerManager == 0)
+ _timerManager = new SdlTimerManager();
+}
+
+void OSystem_SDL::initBackend() {
+ // Check if backend has not been initialized
+ assert(!_inited);
+
+ // Creates the backend managers, if they don't exist yet (we check
+ // for this to allow subclasses to provide their own).
if (_eventManager == 0)
_eventManager = new SdlEventManager(this);
@@ -79,9 +86,6 @@ void OSystem_SDL::initBackend() {
_mixerManager->init();
}
- if (_timerManager == 0)
- _timerManager = new SdlTimerManager();
-
if (_graphicsManager == 0)
_graphicsManager = new SdlGraphicsManager();