diff options
author | Johannes Schickel | 2010-10-13 15:42:53 +0000 |
---|---|---|
committer | Johannes Schickel | 2010-10-13 15:42:53 +0000 |
commit | 34302765caecabf21cc884de95805b3e1d8f8ea1 (patch) | |
tree | 82f7e3b1ae2b3300d66ccb47cb52eb5d088b837e | |
parent | 1769b520aaf066bb8298c8e2f9d089fb69cf0c02 (diff) | |
download | scummvm-rg350-34302765caecabf21cc884de95805b3e1d8f8ea1.tar.gz scummvm-rg350-34302765caecabf21cc884de95805b3e1d8f8ea1.tar.bz2 scummvm-rg350-34302765caecabf21cc884de95805b3e1d8f8ea1.zip |
OPENGL: Get rid of one ugly cast.
svn-id: r53435
-rw-r--r-- | backends/graphics/sdl/sdl-graphics.cpp | 5 | ||||
-rw-r--r-- | backends/graphics/sdl/sdl-graphics.h | 6 | ||||
-rw-r--r-- | backends/platform/sdl/sdl.cpp | 4 |
3 files changed, 10 insertions, 5 deletions
diff --git a/backends/graphics/sdl/sdl-graphics.cpp b/backends/graphics/sdl/sdl-graphics.cpp index 2c0320f5d0..36d4c52239 100644 --- a/backends/graphics/sdl/sdl-graphics.cpp +++ b/backends/graphics/sdl/sdl-graphics.cpp @@ -120,8 +120,9 @@ static AspectRatio getDesiredAspectRatio() { } #endif -SdlGraphicsManager::SdlGraphicsManager() +SdlGraphicsManager::SdlGraphicsManager(SdlEventSource *sdlEventSource) : + _sdlEventSource(sdlEventSource), #ifdef USE_OSD _osdSurface(0), _osdAlpha(SDL_ALPHA_TRANSPARENT), _osdFadeStartTime(0), #endif @@ -821,7 +822,7 @@ bool SdlGraphicsManager::loadGFXMode() { SDL_SetColorKey(_osdSurface, SDL_RLEACCEL | SDL_SRCCOLORKEY | SDL_SRCALPHA, kOSDColorKey); #endif - ((SdlEventSource *)g_system)->resetKeyboadEmulation( + _sdlEventSource->resetKeyboadEmulation( _videoMode.screenWidth * _videoMode.scaleFactor - 1, effectiveScreenHeight() - 1); diff --git a/backends/graphics/sdl/sdl-graphics.h b/backends/graphics/sdl/sdl-graphics.h index 7c6f95f134..62f87ee238 100644 --- a/backends/graphics/sdl/sdl-graphics.h +++ b/backends/graphics/sdl/sdl-graphics.h @@ -31,6 +31,8 @@ #include "common/events.h" #include "common/system.h" +#include "backends/events/sdl/sdl-events.h" + #if defined(__SYMBIAN32__) #include <esdl\SDL.h> #else @@ -75,7 +77,7 @@ public: */ class SdlGraphicsManager : public GraphicsManager, public Common::EventObserver { public: - SdlGraphicsManager(); + SdlGraphicsManager(SdlEventSource *sdlEventSource); virtual ~SdlGraphicsManager(); virtual void initEventObserver(); @@ -136,6 +138,8 @@ public: bool notifyEvent(const Common::Event &event); protected: + SdlEventSource *_sdlEventSource; + #ifdef USE_OSD /** Surface containing the OSD message */ SDL_Surface *_osdSurface; diff --git a/backends/platform/sdl/sdl.cpp b/backends/platform/sdl/sdl.cpp index 38bf4d0ba9..f3609d8212 100644 --- a/backends/platform/sdl/sdl.cpp +++ b/backends/platform/sdl/sdl.cpp @@ -104,7 +104,7 @@ void OSystem_SDL::initBackend() { } #endif if (_graphicsManager == 0) { - _graphicsManager = new SdlGraphicsManager(); + _graphicsManager = new SdlGraphicsManager(this); graphicsManagerType = 0; } } @@ -352,7 +352,7 @@ bool OSystem_SDL::setGraphicsMode(int mode) { // manager, delete and create the new mode graphics manager if (_graphicsMode >= _sdlModesCount && mode < _sdlModesCount) { delete _graphicsManager; - _graphicsManager = new SdlGraphicsManager(); + _graphicsManager = new SdlGraphicsManager(this); ((SdlGraphicsManager *)_graphicsManager)->initEventObserver(); _graphicsManager->beginGFXTransaction(); } else if (_graphicsMode < _sdlModesCount && mode >= _sdlModesCount) { |