diff options
author | Max Horn | 2010-03-08 10:29:00 +0000 |
---|---|---|
committer | Max Horn | 2010-03-08 10:29:00 +0000 |
commit | 28c6c600d45b4ce16f13d08cfc7c9fbcc8461a63 (patch) | |
tree | e76ab0466cd13402b343b63ed814bc38d0774717 /backends/platform/sdl | |
parent | 9fb27a26f86dcf888cb26cc1b4622c5a10de3fb5 (diff) | |
download | scummvm-rg350-28c6c600d45b4ce16f13d08cfc7c9fbcc8461a63.tar.gz scummvm-rg350-28c6c600d45b4ce16f13d08cfc7c9fbcc8461a63.tar.bz2 scummvm-rg350-28c6c600d45b4ce16f13d08cfc7c9fbcc8461a63.zip |
Move some aspect ratio related stuff to graphics/scaler/aspect.h
svn-id: r48186
Diffstat (limited to 'backends/platform/sdl')
-rw-r--r-- | backends/platform/sdl/events.cpp | 1 | ||||
-rw-r--r-- | backends/platform/sdl/graphics.cpp | 7 | ||||
-rw-r--r-- | backends/platform/sdl/sdl.h | 5 |
3 files changed, 9 insertions, 4 deletions
diff --git a/backends/platform/sdl/events.cpp b/backends/platform/sdl/events.cpp index fe7fd7e5f9..0eff23778b 100644 --- a/backends/platform/sdl/events.cpp +++ b/backends/platform/sdl/events.cpp @@ -26,6 +26,7 @@ #include "backends/platform/sdl/sdl.h" #include "common/util.h" #include "common/events.h" +#include "graphics/scaler/aspect.h" // for aspect2Real // FIXME move joystick defines out and replace with confile file options // we should really allow users to map any key to a joystick button diff --git a/backends/platform/sdl/graphics.cpp b/backends/platform/sdl/graphics.cpp index 10716fe89a..705b44215e 100644 --- a/backends/platform/sdl/graphics.cpp +++ b/backends/platform/sdl/graphics.cpp @@ -32,6 +32,7 @@ #include "graphics/font.h" #include "graphics/fontman.h" #include "graphics/scaler.h" +#include "graphics/scaler/aspect.h" #include "graphics/surface.h" static const OSystem::GraphicsMode s_supportedGraphicsModes[] = { @@ -476,6 +477,12 @@ void OSystem_SDL::initSize(uint w, uint h, const Graphics::PixelFormat *format) _dirtyChecksums = (uint32 *)calloc(_cksumNum * 2, sizeof(uint32)); } +int OSystem_SDL::effectiveScreenHeight() const { + return _videoMode.scaleFactor * + (_videoMode.aspectRatioCorrection + ? real2Aspect(_videoMode.screenHeight) + : _videoMode.screenHeight); +} static void fixupResolutionForAspectRatio(AspectRatio desiredAspectRatio, int &width, int &height) { assert(&width != &height); diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h index 78793d4aad..2c1a22e7d6 100644 --- a/backends/platform/sdl/sdl.h +++ b/backends/platform/sdl/sdl.h @@ -485,10 +485,7 @@ protected: virtual bool saveScreenshot(const char *filename); // overloaded by CE backend - int effectiveScreenHeight() const { - return (_videoMode.aspectRatioCorrection ? real2Aspect(_videoMode.screenHeight) : _videoMode.screenHeight) - * _videoMode.scaleFactor; - } + int effectiveScreenHeight() const; void setupIcon(); void handleKbdMouse(); |