diff options
author | Alejandro Marzini | 2010-08-05 06:20:44 +0000 |
---|---|---|
committer | Alejandro Marzini | 2010-08-05 06:20:44 +0000 |
commit | f97809a9a62a2d8840229facb2c2b6f75e37bad3 (patch) | |
tree | 96d12baa85a26225842a85390de30ddbf624197d /backends/graphics/opengl | |
parent | 4b5138483e72b091bc20bba13f2130044b20c24e (diff) | |
download | scummvm-rg350-f97809a9a62a2d8840229facb2c2b6f75e37bad3.tar.gz scummvm-rg350-f97809a9a62a2d8840229facb2c2b6f75e37bad3.tar.bz2 scummvm-rg350-f97809a9a62a2d8840229facb2c2b6f75e37bad3.zip |
OPENGL: Improve aspect ratio correction mode selection.
svn-id: r51752
Diffstat (limited to 'backends/graphics/opengl')
-rw-r--r-- | backends/graphics/opengl/opengl-graphics.cpp | 18 | ||||
-rw-r--r-- | backends/graphics/opengl/opengl-graphics.h | 4 |
2 files changed, 21 insertions, 1 deletions
diff --git a/backends/graphics/opengl/opengl-graphics.cpp b/backends/graphics/opengl/opengl-graphics.cpp index ddace8f3a4..600f280bc8 100644 --- a/backends/graphics/opengl/opengl-graphics.cpp +++ b/backends/graphics/opengl/opengl-graphics.cpp @@ -39,6 +39,9 @@ OpenGLGraphicsManager::OpenGLGraphicsManager() #ifdef USE_OSD _osdTexture(0), _osdAlpha(0), _osdFadeStartTime(0), #endif +#ifndef USE_ALL_ASR + _desiredAspectRatio(kAspectRatio4_3), +#endif _gameTexture(0), _overlayTexture(0), _cursorTexture(0), _screenChangeCount(0), _screenNeedsRedraw(false), _shakePos(0), @@ -65,6 +68,14 @@ OpenGLGraphicsManager::OpenGLGraphicsManager() // Register the graphics manager as a event observer g_system->getEventManager()->getEventDispatcher()->registerObserver(this, 2, false); + +#ifndef USE_ALL_ASR + Common::String desiredAspectRatio = ConfMan.get("desired_screen_aspect_ratio"); + if (!scumm_stricmp(desiredAspectRatio.c_str(), "16/9")) + _desiredAspectRatio = kAspectRatio16_9; + else if (!scumm_stricmp(desiredAspectRatio.c_str(), "16/10")) + _desiredAspectRatio = kAspectRatio16_10; +#endif } OpenGLGraphicsManager::~OpenGLGraphicsManager() { @@ -1178,7 +1189,12 @@ void OpenGLGraphicsManager::setAspectRatioCorrection(int ratio) { #ifdef USE_ALL_ASR _videoMode.aspectRatioCorrection = (_videoMode.aspectRatioCorrection + 1) % 5; #else - _videoMode.aspectRatioCorrection = (_videoMode.aspectRatioCorrection + 1) % 3; + if (_videoMode.aspectRatioCorrection == kAspectRatioNone) + _videoMode.aspectRatioCorrection = kAspectRatioConserve; + else if (_videoMode.aspectRatioCorrection == kAspectRatioConserve) + _videoMode.aspectRatioCorrection = _desiredAspectRatio; + else + _videoMode.aspectRatioCorrection = kAspectRatioNone; #endif else _videoMode.aspectRatioCorrection = ratio; diff --git a/backends/graphics/opengl/opengl-graphics.h b/backends/graphics/opengl/opengl-graphics.h index 60c569726f..a3d3483c74 100644 --- a/backends/graphics/opengl/opengl-graphics.h +++ b/backends/graphics/opengl/opengl-graphics.h @@ -189,6 +189,10 @@ protected: int _aspectWidth; int _aspectHeight; +#ifndef USE_ALL_ASR + int _desiredAspectRatio; +#endif + /** * Sets the aspect ratio mode. * @mode the aspect ratio mode, if -1 it will switch to next mode. |