diff options
author | Eugene Sandulenko | 2013-07-18 08:15:28 -0700 |
---|---|---|
committer | Eugene Sandulenko | 2013-07-18 08:15:28 -0700 |
commit | 2c812ade01714351aeda3dbbe877d376ad3d48ca (patch) | |
tree | 61daae8cca200b51fdea0c82ecc2d555e97ba865 /backends/platform/sdl | |
parent | 2eb26ad02ead5fc65cc206cb287ff04c84eba4e8 (diff) | |
parent | 4a7e4e5b22da3587a9d68978d7be31e4e78a8ccc (diff) | |
download | scummvm-rg350-2c812ade01714351aeda3dbbe877d376ad3d48ca.tar.gz scummvm-rg350-2c812ade01714351aeda3dbbe877d376ad3d48ca.tar.bz2 scummvm-rg350-2c812ade01714351aeda3dbbe877d376ad3d48ca.zip |
Merge pull request #353 from clone2727/eventrec_timer_fix
ALL: Don't use EventRecorder at all when not compiled in
Diffstat (limited to 'backends/platform/sdl')
-rw-r--r-- | backends/platform/sdl/sdl.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/backends/platform/sdl/sdl.cpp b/backends/platform/sdl/sdl.cpp index f55dd277c7..7ab367d4a4 100644 --- a/backends/platform/sdl/sdl.cpp +++ b/backends/platform/sdl/sdl.cpp @@ -98,7 +98,13 @@ OSystem_SDL::~OSystem_SDL() { delete _mixerManager; _mixerManager = 0; +#ifdef ENABLE_EVENTRECORDER + // HACK HACK HACK + // This is nasty. delete g_eventRec.getTimerManager(); +#else + delete _timerManager; +#endif _timerManager = 0; delete _mutexManager; @@ -193,9 +199,15 @@ void OSystem_SDL::initBackend() { // Setup and start mixer _mixerManager->init(); } + +#ifdef ENABLE_EVENTRECORDER g_eventRec.registerMixerManager(_mixerManager); g_eventRec.registerTimerManager(new SdlTimerManager()); +#else + if (_timerManager == 0) + _timerManager = new SdlTimerManager(); +#endif if (_audiocdManager == 0) { // Audio CD support was removed with SDL 1.3 @@ -470,12 +482,18 @@ void OSystem_SDL::setupIcon() { uint32 OSystem_SDL::getMillis(bool skipRecord) { uint32 millis = SDL_GetTicks(); + +#ifdef ENABLE_EVENTRECORDER g_eventRec.processMillis(millis, skipRecord); +#endif + return millis; } void OSystem_SDL::delayMillis(uint msecs) { +#ifdef ENABLE_EVENTRECORDER if (!g_eventRec.processDelayMillis()) +#endif SDL_Delay(msecs); } @@ -498,11 +516,20 @@ Audio::Mixer *OSystem_SDL::getMixer() { SdlMixerManager *OSystem_SDL::getMixerManager() { assert(_mixerManager); + +#ifdef ENABLE_EVENTRECORDER return g_eventRec.getMixerManager(); +#else + return _mixerManager; +#endif } Common::TimerManager *OSystem_SDL::getTimerManager() { +#ifdef ENABLE_EVENTRECORDER return g_eventRec.getTimerManager(); +#else + return _timerManager; +#endif } #ifdef USE_OPENGL |