diff options
Diffstat (limited to 'backends/graphics')
-rw-r--r-- | backends/graphics/opengl/opengl-graphics.cpp | 18 | ||||
-rw-r--r-- | backends/graphics/opengl/opengl-graphics.h | 4 | ||||
-rw-r--r-- | backends/graphics/sdl/sdl-graphics.cpp | 2 |
3 files changed, 21 insertions, 3 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. diff --git a/backends/graphics/sdl/sdl-graphics.cpp b/backends/graphics/sdl/sdl-graphics.cpp index 2ffd21b686..1681d2ce7d 100644 --- a/backends/graphics/sdl/sdl-graphics.cpp +++ b/backends/graphics/sdl/sdl-graphics.cpp @@ -673,7 +673,6 @@ static void fixupResolutionForAspectRatio(AspectRatio desiredAspectRatio, int &w continue; if (mode->h * kw != mode->w * kh) continue; - //printf("%d %d\n", mode->w, mode->h); uint metric = mode->w * mode->h - w * h; if (metric > bestMetric) @@ -687,7 +686,6 @@ static void fixupResolutionForAspectRatio(AspectRatio desiredAspectRatio, int &w warning("Unable to enforce the desired aspect ratio!"); return; } - //printf("%d %d\n", bestMode->w, bestMode->h); width = bestMode->w; height = bestMode->h; } |