summaryrefslogtreecommitdiff
path: root/src/client.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/client.cpp
parent226202ff807dc860991af0d6665ef9e9b48c1bed (diff)
downloadmanaverse-a0b2deb4192bddad4d061f5d5df86411a437f01f.tar.gz
manaverse-a0b2deb4192bddad4d061f5d5df86411a437f01f.tar.bz2
manaverse-a0b2deb4192bddad4d061f5d5df86411a437f01f.tar.xz
manaverse-a0b2deb4192bddad4d061f5d5df86411a437f01f.zip
add support for screen scale in OpenGL modes.
Diffstat (limited to 'src/client.cpp')
-rw-r--r--src/client.cpp25
1 files changed, 15 insertions, 10 deletions
diff --git a/src/client.cpp b/src/client.cpp
index 13835c938..82652e433 100644
--- a/src/client.cpp
+++ b/src/client.cpp
@@ -2798,25 +2798,30 @@ bool Client::isTmw() const
return false;
}
-void Client::resizeVideo(int width, int height, const bool always)
+void Client::resizeVideo(int actualWidth,
+ int actualHeight,
+ const bool always)
{
// Keep a minimum size. This isn't adhered to by the actual window, but
// it keeps some window positions from getting messed up.
- width = std::max(470, width);
- height = std::max(320, height);
+ actualWidth = std::max(470, actualWidth);
+ actualHeight = std::max(320, actualHeight);
if (!mainGraphics)
return;
- if (!always && mainGraphics->mWidth == width
- && mainGraphics->mHeight == height)
+ if (!always
+ && mainGraphics->mActualWidth == actualWidth
+ && mainGraphics->mActualHeight == actualHeight)
{
return;
}
- touchManager.resize(width, height);
-
- if (mainGraphics->resizeScreen(width, height))
+ if (mainGraphics->resizeScreen(actualWidth, actualHeight))
{
+ const int width = mainGraphics->mWidth;
+ const int height = mainGraphics->mHeight;
+ touchManager.resize(width, height);
+
if (gui)
gui->videoResized();
@@ -2852,8 +2857,8 @@ void Client::resizeVideo(int width, int height, const bool always)
if (gui)
gui->draw();
- config.setValue("screenwidth", width);
- config.setValue("screenheight", height);
+ config.setValue("screenwidth", actualWidth);
+ config.setValue("screenheight", actualHeight);
}
}