From 28c6c600d45b4ce16f13d08cfc7c9fbcc8461a63 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Mon, 8 Mar 2010 10:29:00 +0000 Subject: Move some aspect ratio related stuff to graphics/scaler/aspect.h svn-id: r48186 --- backends/platform/sdl/events.cpp | 1 + backends/platform/sdl/graphics.cpp | 7 +++++++ backends/platform/sdl/sdl.h | 5 +---- 3 files changed, 9 insertions(+), 4 deletions(-) (limited to 'backends/platform/sdl') 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(); -- cgit v1.2.3