diff options
Diffstat (limited to 'backends/platform/sdl')
| -rw-r--r-- | backends/platform/sdl/sdl-sys.h | 3 | ||||
| -rw-r--r-- | backends/platform/sdl/sdl.cpp | 28 | ||||
| -rw-r--r-- | backends/platform/sdl/sdl.h | 3 | 
3 files changed, 22 insertions, 12 deletions
diff --git a/backends/platform/sdl/sdl-sys.h b/backends/platform/sdl/sdl-sys.h index ca3c586e03..eccf73815d 100644 --- a/backends/platform/sdl/sdl-sys.h +++ b/backends/platform/sdl/sdl-sys.h @@ -35,8 +35,11 @@  // it with an alternate slightly less unfriendly override.  #if !defined(FORBIDDEN_SYMBOL_ALLOW_ALL) && !defined(FORBIDDEN_SYMBOL_EXCEPTION_FILE)  #undef FILE +// Solaris has typedef __FILE FILE in several places already +#if !defined(__sun)  typedef struct { int FAKE; } FAKE_FILE;  #define FILE FAKE_FILE +#endif   // (__sun)  #endif  #if !defined(FORBIDDEN_SYMBOL_ALLOW_ALL) && !defined(FORBIDDEN_SYMBOL_EXCEPTION_strcasecmp) diff --git a/backends/platform/sdl/sdl.cpp b/backends/platform/sdl/sdl.cpp index d54854352d..f55dd277c7 100644 --- a/backends/platform/sdl/sdl.cpp +++ b/backends/platform/sdl/sdl.cpp @@ -30,7 +30,7 @@  #include "backends/platform/sdl/sdl.h"  #include "common/config-manager.h" -#include "common/EventRecorder.h" +#include "gui/EventRecorder.h"  #include "common/taskbar.h"  #include "common/textconsole.h" @@ -97,7 +97,9 @@ OSystem_SDL::~OSystem_SDL() {  	_audiocdManager = 0;  	delete _mixerManager;  	_mixerManager = 0; -	delete _timerManager; + +	delete g_eventRec.getTimerManager(); +  	_timerManager = 0;  	delete _mutexManager;  	_mutexManager = 0; @@ -131,9 +133,6 @@ void OSystem_SDL::init() {  	if (_mutexManager == 0)  		_mutexManager = new SdlMutexManager(); -	if (_timerManager == 0) -		_timerManager = new SdlTimerManager(); -  #if defined(USE_TASKBAR)  	if (_taskbarManager == 0)  		_taskbarManager = new Common::TaskbarManager(); @@ -191,10 +190,12 @@ void OSystem_SDL::initBackend() {  	if (_mixerManager == 0) {  		_mixerManager = new SdlMixerManager(); -  		// Setup and start mixer  		_mixerManager->init();  	} +	g_eventRec.registerMixerManager(_mixerManager); + +	g_eventRec.registerTimerManager(new SdlTimerManager());  	if (_audiocdManager == 0) {  		// Audio CD support was removed with SDL 1.3 @@ -466,14 +467,15 @@ void OSystem_SDL::setupIcon() {  	free(icon);  } -uint32 OSystem_SDL::getMillis() { + +uint32 OSystem_SDL::getMillis(bool skipRecord) {  	uint32 millis = SDL_GetTicks(); -	g_eventRec.processMillis(millis); +	g_eventRec.processMillis(millis, skipRecord);  	return millis;  }  void OSystem_SDL::delayMillis(uint msecs) { -	if (!g_eventRec.processDelayMillis(msecs)) +	if (!g_eventRec.processDelayMillis())  		SDL_Delay(msecs);  } @@ -491,12 +493,16 @@ void OSystem_SDL::getTimeAndDate(TimeDate &td) const {  Audio::Mixer *OSystem_SDL::getMixer() {  	assert(_mixerManager); -	return _mixerManager->getMixer(); +	return getMixerManager()->getMixer();  }  SdlMixerManager *OSystem_SDL::getMixerManager() {  	assert(_mixerManager); -	return _mixerManager; +	return g_eventRec.getMixerManager(); +} + +Common::TimerManager *OSystem_SDL::getTimerManager() { +	return g_eventRec.getTimerManager();  }  #ifdef USE_OPENGL diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h index f05207b482..840e73ff09 100644 --- a/backends/platform/sdl/sdl.h +++ b/backends/platform/sdl/sdl.h @@ -68,10 +68,11 @@ public:  	virtual void setWindowCaption(const char *caption);  	virtual void addSysArchivesToSearchSet(Common::SearchSet &s, int priority = 0); -	virtual uint32 getMillis(); +	virtual uint32 getMillis(bool skipRecord = false);  	virtual void delayMillis(uint msecs);  	virtual void getTimeAndDate(TimeDate &td) const;  	virtual Audio::Mixer *getMixer(); +	virtual Common::TimerManager *getTimerManager();  protected:  	bool _inited;  | 
