aboutsummaryrefslogtreecommitdiff
path: root/backends
diff options
context:
space:
mode:
authorCeRiAl2011-07-17 22:42:45 +0200
committerCeRiAl2011-07-20 02:14:34 +0200
commit822a2ef3dccaedd654ca5429b677456328b22ef1 (patch)
tree3cc760066e163c4de4ccc10ed47b3c5f9d11e50e /backends
parentedfd998642833d23d5b6004334b96b867f7023f8 (diff)
downloadscummvm-rg350-822a2ef3dccaedd654ca5429b677456328b22ef1.tar.gz
scummvm-rg350-822a2ef3dccaedd654ca5429b677456328b22ef1.tar.bz2
scummvm-rg350-822a2ef3dccaedd654ca5429b677456328b22ef1.zip
WINCE: Move initialization of TimerManager to overloaded init() method.
Diffstat (limited to 'backends')
-rw-r--r--backends/platform/wince/wince-sdl.cpp27
-rw-r--r--backends/platform/wince/wince-sdl.h1
2 files changed, 20 insertions, 8 deletions
diff --git a/backends/platform/wince/wince-sdl.cpp b/backends/platform/wince/wince-sdl.cpp
index ec222c6fc1..1abc3cb350 100644
--- a/backends/platform/wince/wince-sdl.cpp
+++ b/backends/platform/wince/wince-sdl.cpp
@@ -42,6 +42,7 @@
#include "audio/mixer_intern.h"
#include "audio/fmopl.h"
+#include "backends/mutex/sdl/sdl-mutex.h"
#include "backends/timer/sdl/sdl-timer.h"
#include "gui/Actions.h"
@@ -379,14 +380,6 @@ void OSystem_WINCE3::initBackend() {
((WINCESdlEventSource *)_eventSource)->init((WINCESdlGraphicsManager *)_graphicsManager);
- // Create the timer (but remove the timer manager from the SDL backend first).
- // CE SDL does not support multiple timers (SDL_AddTimer).
- // We work around this by using the SetTimer function, since we only use
- // one timer in scummvm (for the time being)
- delete _timerManager;
- _timerManager = new DefaultTimerManager();
- SDL_SetTimer(10, &timer_handler_wrapper);
-
// Call parent implementation of this method
OSystem_SDL::initBackend();
@@ -546,6 +539,24 @@ void OSystem_WINCE3::initSDL() {
}
}
+void OSystem_WINCE3::init() {
+ // Create SdlMutexManager instance as the TimerManager relies on the
+ // MutexManager being already initialized
+ if (_mutexManager == 0)
+ _mutexManager = new SdlMutexManager();
+
+ // Create the timer. CE SDL does not support multiple timers (SDL_AddTimer).
+ // We work around this by using the SetTimer function, since we only use
+ // one timer in scummvm (for the time being)
+ if (_timerManager == 0) {
+ _timerManager = new DefaultTimerManager();
+ SDL_SetTimer(10, &timer_handler_wrapper);
+ }
+
+ // Call parent implementation of this method
+ OSystem_SDL::init();
+}
+
void OSystem_WINCE3::quit() {
fclose(stdout_file);
fclose(stderr_file);
diff --git a/backends/platform/wince/wince-sdl.h b/backends/platform/wince/wince-sdl.h
index 481956c19a..b4f323c9e2 100644
--- a/backends/platform/wince/wince-sdl.h
+++ b/backends/platform/wince/wince-sdl.h
@@ -52,6 +52,7 @@ public:
void initBackend();
// Overloaded from SDL backend
+ void init();
void quit();
virtual Common::String getSystemLanguage() const;