From f300c172f08c8982e451f7d335792e15cbc7f6b6 Mon Sep 17 00:00:00 2001 From: CeRiAl Date: Sun, 26 Jun 2011 02:09:54 +0200 Subject: WINCE: Fix timer manager --- backends/platform/wince/wince-sdl.cpp | 23 +++++++---------------- 1 file 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; } -- cgit v1.2.3