aboutsummaryrefslogtreecommitdiff
path: root/backends/graphics/openglsdl
diff options
context:
space:
mode:
authorJohannes Schickel2011-08-12 04:06:54 +0200
committerJohannes Schickel2011-08-12 04:06:54 +0200
commitb8dcd9a25eb27ef40aa5535fc83879d20db7e10c (patch)
treef89d4f9ef35a6bdfcd45e9db1bdee008dfa813eb /backends/graphics/openglsdl
parenta77c29327e8e4c06c3b45dac16b96198a120fefe (diff)
downloadscummvm-rg350-b8dcd9a25eb27ef40aa5535fc83879d20db7e10c.tar.gz
scummvm-rg350-b8dcd9a25eb27ef40aa5535fc83879d20db7e10c.tar.bz2
scummvm-rg350-b8dcd9a25eb27ef40aa5535fc83879d20db7e10c.zip
OPENGL: Fix aspect ratio correction behavior.
Now only 320x200 and 640x400 will result in aspect ratio correction to be used if the user requested it. This should fix some strechting in Myst/Riven.
Diffstat (limited to 'backends/graphics/openglsdl')
-rw-r--r--backends/graphics/openglsdl/openglsdl-graphics.cpp19
1 files changed, 11 insertions, 8 deletions
diff --git a/backends/graphics/openglsdl/openglsdl-graphics.cpp b/backends/graphics/openglsdl/openglsdl-graphics.cpp
index d2810818e7..84515732fe 100644
--- a/backends/graphics/openglsdl/openglsdl-graphics.cpp
+++ b/backends/graphics/openglsdl/openglsdl-graphics.cpp
@@ -313,14 +313,17 @@ bool OpenGLSdlGraphicsManager::loadGFXMode() {
_videoMode.overlayWidth = _videoMode.hardwareWidth = _videoMode.screenWidth * scaleFactor;
_videoMode.overlayHeight = _videoMode.hardwareHeight = _videoMode.screenHeight * scaleFactor;
- int screenAspectRatio = _videoMode.screenWidth * 10000 / _videoMode.screenHeight;
- int desiredAspectRatio = getAspectRatio();
-
- // Do not downscale dimensions, only enlarge them if needed
- if (screenAspectRatio > desiredAspectRatio)
- _videoMode.hardwareHeight = (_videoMode.overlayWidth * 10000 + 5000) / desiredAspectRatio;
- else if (screenAspectRatio < desiredAspectRatio)
- _videoMode.hardwareWidth = (_videoMode.overlayHeight * desiredAspectRatio + 5000) / 10000;
+ // The only modes where we need to adapt the aspect ratio are 320x200
+ // and 640x400. That is since our aspect ratio correction in fact is
+ // only used to ensure that the original pixel size aspect for these
+ // modes is used.
+ // (Non-square pixels on old monitors vs square pixel on new ones).
+ if (_videoMode.aspectRatioCorrection
+ && ((_videoMode.screenWidth == 320 && _videoMode.screenHeight == 200)
+ || (_videoMode.screenWidth == 640 && _videoMode.screenHeight == 400)))
+ _videoMode.overlayHeight = _videoMode.hardwareHeight = 240 * scaleFactor;
+ else
+ _videoMode.overlayHeight = _videoMode.hardwareHeight = _videoMode.screenHeight * scaleFactor;
}
_screenResized = false;