summaryrefslogtreecommitdiff
path: root/src/graphicsmanager.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-01-28 00:30:51 +0300
committerAndrei Karas <akaras@inbox.ru>2014-01-28 23:35:20 +0300
commita0b2deb4192bddad4d061f5d5df86411a437f01f (patch)
tree4739472959d83045eac4d7f7ddf3dc265d37b45c /src/graphicsmanager.cpp
parent226202ff807dc860991af0d6665ef9e9b48c1bed (diff)
downloadmv-a0b2deb4192bddad4d061f5d5df86411a437f01f.tar.gz
mv-a0b2deb4192bddad4d061f5d5df86411a437f01f.tar.bz2
mv-a0b2deb4192bddad4d061f5d5df86411a437f01f.tar.xz
mv-a0b2deb4192bddad4d061f5d5df86411a437f01f.zip
add support for screen scale in OpenGL modes.
Diffstat (limited to 'src/graphicsmanager.cpp')
-rw-r--r--src/graphicsmanager.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/graphicsmanager.cpp b/src/graphicsmanager.cpp
index 552f5a018..0a7f78eb6 100644
--- a/src/graphicsmanager.cpp
+++ b/src/graphicsmanager.cpp
@@ -377,8 +377,19 @@ void GraphicsManager::setVideoMode()
int height = config.getIntValue("screenheight");
#endif
+ int scale = 1;
+ if (mainGraphics->allowScale())
+ {
+ if (!scale)
+ scale = 1;
+ scale = config.getIntValue("scale");
+ if (width / scale < 470 || height / scale < 320)
+ scale = 1;
+ logger->log("set scale: %d", scale);
+ }
+
// Try to set the desired video mode
- if (!mainGraphics->setVideoMode(width, height, bpp,
+ if (!mainGraphics->setVideoMode(width, height, scale, bpp,
fullscreen, hwaccel, enableResize, noFrame))
{
logger->log(strprintf("Couldn't set %dx%dx%d video mode: %s",
@@ -396,7 +407,7 @@ void GraphicsManager::setVideoMode()
config.setValueInt("screenwidth", oldWidth);
config.setValueInt("screenheight", oldHeight);
config.setValue("screen", oldFullscreen == 1);
- if (!mainGraphics->setVideoMode(oldWidth, oldHeight, bpp,
+ if (!mainGraphics->setVideoMode(oldWidth, oldHeight, scale, bpp,
oldFullscreen, hwaccel, enableResize, noFrame))
{
logger->safeError(strprintf("Couldn't restore %dx%dx%d "