Skip to content

Commit

Permalink
WINCE: Fix timer manager
Browse files Browse the repository at this point in the history
  • Loading branch information
CeRiAl committed Jun 26, 2011
1 parent fa97da8 commit f300c17
Showing 1 changed file with 7 additions and 16 deletions.
23 changes: 7 additions & 16 deletions backends/platform/wince/wince-sdl.cpp
Expand Up @@ -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;
}

Expand All @@ -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
Expand All @@ -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;
}

Expand Down

0 comments on commit f300c17

Please sign in to comment.