diff options
author | Johannes Schickel | 2010-10-13 15:42:16 +0000 |
---|---|---|
committer | Johannes Schickel | 2010-10-13 15:42:16 +0000 |
commit | a2b96a2516cd87203b22f7496a8d5a6b65749da3 (patch) | |
tree | 11617735d666c73cebd6979f7df32e01fb09fea1 /backends/platform | |
parent | 75e8452b6e6a2bf4fb2f588aa00b428a60d873b5 (diff) | |
download | scummvm-rg350-a2b96a2516cd87203b22f7496a8d5a6b65749da3.tar.gz scummvm-rg350-a2b96a2516cd87203b22f7496a8d5a6b65749da3.tar.bz2 scummvm-rg350-a2b96a2516cd87203b22f7496a8d5a6b65749da3.zip |
OPENGL: Replace SdlEventManager by SdlEventSource.
Formerly SdlEventManager was a subclass of DefaultEventManager but did not
really have anything in common with the idea of our EventManager interface.
Now I made a new object SdlEventSource which only subclasses EventSource
and which is responsible for obtaining events from SDL (and processing them).
svn-id: r53433
Diffstat (limited to 'backends/platform')
-rw-r--r-- | backends/platform/sdl/sdl.cpp | 7 | ||||
-rw-r--r-- | backends/platform/sdl/sdl.h | 4 |
2 files changed, 3 insertions, 8 deletions
diff --git a/backends/platform/sdl/sdl.cpp b/backends/platform/sdl/sdl.cpp index 5b38cbb9b4..38bf4d0ba9 100644 --- a/backends/platform/sdl/sdl.cpp +++ b/backends/platform/sdl/sdl.cpp @@ -112,7 +112,7 @@ void OSystem_SDL::initBackend() { // Creates the backend managers, if they don't exist yet (we check // for this to allow subclasses to provide their own). if (_eventManager == 0) - _eventManager = new SdlEventManager(this); + _eventManager = new DefaultEventManager(this); // We have to initialize the graphics manager before the event manager // so the virtual keyboard can be initialized, but we have to add the @@ -289,11 +289,6 @@ void OSystem_SDL::setupIcon() { free(icon); } -bool OSystem_SDL::pollEvent(Common::Event &event) { - assert(_eventManager); - return ((SdlEventManager *)_eventManager)->pollSdlEvent(event); -} - uint32 OSystem_SDL::getMillis() { uint32 millis = SDL_GetTicks(); g_eventRec.processMillis(millis); diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h index 17d4dc4ed9..9ef2573dad 100644 --- a/backends/platform/sdl/sdl.h +++ b/backends/platform/sdl/sdl.h @@ -34,11 +34,12 @@ #include "backends/modular-backend.h" #include "backends/mixer/sdl/sdl-mixer.h" +#include "backends/events/sdl/sdl-events.h" /** * Base OSystem class for all SDL ports. */ -class OSystem_SDL : public ModularBackend { +class OSystem_SDL : public ModularBackend, public SdlEventSource { public: OSystem_SDL(); virtual ~OSystem_SDL(); @@ -66,7 +67,6 @@ public: virtual void addSysArchivesToSearchSet(Common::SearchSet &s, int priority = 0); virtual Common::SeekableReadStream *createConfigReadStream(); virtual Common::WriteStream *createConfigWriteStream(); - virtual bool pollEvent(Common::Event &event); virtual uint32 getMillis(); virtual void delayMillis(uint msecs); virtual void getTimeAndDate(TimeDate &td) const; |