aboutsummaryrefslogtreecommitdiff
path: root/backends/graphics/opengl
diff options
context:
space:
mode:
Diffstat (limited to 'backends/graphics/opengl')
-rw-r--r--backends/graphics/opengl/opengl-graphics.cpp18
-rw-r--r--backends/graphics/opengl/opengl-graphics.h4
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.