aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlejandro Marzini2010-08-13 05:26:23 +0000
committerAlejandro Marzini2010-08-13 05:26:23 +0000
commit503578ac1087b91dcb912fd7918454de73538b34 (patch)
treeca0cac2ba89efe1d1f0773fa825efb638e907e12
parent610f041930ee899a3667aa5b203c31c88d5df911 (diff)
downloadscummvm-rg350-503578ac1087b91dcb912fd7918454de73538b34.tar.gz
scummvm-rg350-503578ac1087b91dcb912fd7918454de73538b34.tar.bz2
scummvm-rg350-503578ac1087b91dcb912fd7918454de73538b34.zip
OPENGL: Restrict window scaling if current desktop resolution is not big enough.
svn-id: r52057
-rw-r--r--backends/graphics/openglsdl/openglsdl-graphics.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/backends/graphics/openglsdl/openglsdl-graphics.cpp b/backends/graphics/openglsdl/openglsdl-graphics.cpp
index da51de7c9b..e4881a105e 100644
--- a/backends/graphics/openglsdl/openglsdl-graphics.cpp
+++ b/backends/graphics/openglsdl/openglsdl-graphics.cpp
@@ -433,6 +433,13 @@ bool OpenGLSdlGraphicsManager::handleScalerHotkeys(Common::KeyCode key) {
int factor = _videoMode.scaleFactor;
factor += (sdlKey == SDLK_MINUS || sdlKey == SDLK_KP_MINUS) ? -1 : +1;
if (0 < factor && factor < 4) {
+ // Check if the desktop resolution has been detected
+ if (_desktopWidth > 0 && _desktopHeight > 0)
+ // If the new scale factor is too big, do not scale
+ if (_videoMode.screenWidth * factor > _desktopWidth ||
+ _videoMode.screenHeight * factor > _desktopHeight)
+ return false;
+
beginGFXTransaction();
setScale(factor);
endGFXTransaction();