diff options
author | CeRiAl | 2011-06-26 02:09:54 +0200 |
---|---|---|
committer | CeRiAl | 2011-06-26 03:44:56 +0200 |
commit | f300c172f08c8982e451f7d335792e15cbc7f6b6 (patch) | |
tree | 24278688a420c470ddc8e2d303379e7333ff2078 | |
parent | fa97da864aeb17b46a83eead3f87a151b5bee59b (diff) | |
download | scummvm-rg350-f300c172f08c8982e451f7d335792e15cbc7f6b6.tar.gz scummvm-rg350-f300c172f08c8982e451f7d335792e15cbc7f6b6.tar.bz2 scummvm-rg350-f300c172f08c8982e451f7d335792e15cbc7f6b6.zip |
WINCE: Fix timer manager
-rw-r--r-- | backends/platform/wince/wince-sdl.cpp | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/backends/platform/wince/wince-sdl.cpp b/backends/platform/wince/wince-sdl.cpp index 9b1ffe817c..ec222c6fc1 100644 --- a/backends/platform/wince/wince-sdl.cpp +++ b/backends/platform/wince/wince-sdl.cpp @@ -353,9 +353,9 @@ void drawError(char *error) { } // ******************************************************************************************** -static DefaultTimerManager *_int_timer = NULL; static Uint32 timer_handler_wrapper(Uint32 interval) { - _int_timer->handler(); + DefaultTimerManager *tm = (DefaultTimerManager *)g_system->getTimerManager(); + tm->handler(); return interval; } @@ -379,21 +379,15 @@ void OSystem_WINCE3::initBackend() { ((WINCESdlEventSource *)_eventSource)->init((WINCESdlGraphicsManager *)_graphicsManager); - - // FIXME: This timer manager is *not accesible* from the outside. - // Instead the timer manager setup by OSystem_SDL is visible on the outside. - // Since the WinCE backend actually seems to work, my guess is that - // SDL_AddTimer works after all and the following code is redundant. - // However it may be, this must be resolved one way or another. - - // Create the timer. CE SDL does not support multiple timers (SDL_AddTimer). + // 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) - _int_timer = new DefaultTimerManager(); - //_timerID = NULL; // OSystem_SDL will call removetimer with this, it's ok + delete _timerManager; + _timerManager = new DefaultTimerManager(); SDL_SetTimer(10, &timer_handler_wrapper); - // Chain init + // Call parent implementation of this method OSystem_SDL::initBackend(); // Initialize global key mapping @@ -404,9 +398,6 @@ void OSystem_WINCE3::initBackend() { GUI_Actions::Instance()->saveMapping(); // write defaults } - // Call parent implementation of this method - //OSystem_SDL::initBackend(); - _inited = true; } |