From 34302765caecabf21cc884de95805b3e1d8f8ea1 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Wed, 13 Oct 2010 15:42:53 +0000 Subject: OPENGL: Get rid of one ugly cast. svn-id: r53435 --- backends/graphics/sdl/sdl-graphics.cpp | 5 +++-- backends/graphics/sdl/sdl-graphics.h | 6 +++++- 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'backends/graphics/sdl') 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 #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; -- cgit v1.2.3