diff options
author | Johannes Schickel | 2011-08-08 23:46:05 +0200 |
---|---|---|
committer | Johannes Schickel | 2011-08-09 00:03:11 +0200 |
commit | 0630a88a04e9688d664751b6a68edf622d76b348 (patch) | |
tree | 87d7867c298c60272eff69777b16bff5c15c8bfe /backends/graphics/surfacesdl/surfacesdl-graphics.cpp | |
parent | dedc74abfa44f7dac344da1868588193f91dd4f1 (diff) | |
download | scummvm-rg350-0630a88a04e9688d664751b6a68edf622d76b348.tar.gz scummvm-rg350-0630a88a04e9688d664751b6a68edf622d76b348.tar.bz2 scummvm-rg350-0630a88a04e9688d664751b6a68edf622d76b348.zip |
SDL: Let SDL based graphics managers inherit from SdlGraphicsManager.
This also adapts port I can not test (not even the compilation). So if this
breaks anything I am sorry about it.
Diffstat (limited to 'backends/graphics/surfacesdl/surfacesdl-graphics.cpp')
-rw-r--r-- | backends/graphics/surfacesdl/surfacesdl-graphics.cpp | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/backends/graphics/surfacesdl/surfacesdl-graphics.cpp b/backends/graphics/surfacesdl/surfacesdl-graphics.cpp index 2d41ecead4..293fd9b188 100644 --- a/backends/graphics/surfacesdl/surfacesdl-graphics.cpp +++ b/backends/graphics/surfacesdl/surfacesdl-graphics.cpp @@ -122,7 +122,7 @@ static AspectRatio getDesiredAspectRatio() { SurfaceSdlGraphicsManager::SurfaceSdlGraphicsManager(SdlEventSource *sdlEventSource) : - _sdlEventSource(sdlEventSource), + SdlGraphicsManager(sdlEventSource), _sdlEventSource(sdlEventSource), #ifdef USE_OSD _osdSurface(0), _osdAlpha(SDL_ALPHA_TRANSPARENT), _osdFadeStartTime(0), #endif @@ -2324,4 +2324,22 @@ bool SurfaceSdlGraphicsManager::notifyEvent(const Common::Event &event) { return false; } +void SurfaceSdlGraphicsManager::notifyVideoExpose() { + _forceFull = true; +} + +void SurfaceSdlGraphicsManager::transformMouseCoordinates(Common::Point &point) { + if (!_overlayVisible) { + point.x /= _videoMode.scaleFactor; + point.y /= _videoMode.scaleFactor; + if (_videoMode.aspectRatioCorrection) + point.y = aspect2Real(point.y); + } +} + +void SurfaceSdlGraphicsManager::notifyMousePos(Common::Point mouse) { + transformMouseCoordinates(mouse); + setMousePos(mouse.x, mouse.y); +} + #endif |