diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-01-28 00:30:51 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-01-28 23:35:20 +0300 |
commit | a0b2deb4192bddad4d061f5d5df86411a437f01f (patch) | |
tree | 4739472959d83045eac4d7f7ddf3dc265d37b45c /src/gui/widgets/tabs | |
parent | 226202ff807dc860991af0d6665ef9e9b48c1bed (diff) | |
download | mv-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/gui/widgets/tabs')
-rw-r--r-- | src/gui/widgets/tabs/setup_video.cpp | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/src/gui/widgets/tabs/setup_video.cpp b/src/gui/widgets/tabs/setup_video.cpp index feebb774a..c977318e6 100644 --- a/src/gui/widgets/tabs/setup_video.cpp +++ b/src/gui/widgets/tabs/setup_video.cpp @@ -122,8 +122,8 @@ ModeListModel::ModeListModel() : addCustomMode("1280x1024"); addCustomMode("1400x900"); addCustomMode("1500x990"); - addCustomMode(toString(mainGraphics->mWidth).append("x") - .append(toString(mainGraphics->mHeight))); + addCustomMode(toString(mainGraphics->mActualWidth).append("x") + .append(toString(mainGraphics->mActualHeight))); std::sort(mVideoModes.begin(), mVideoModes.end(), &modeSorter); mVideoModes.push_back("custom"); @@ -243,8 +243,9 @@ Setup_Video::Setup_Video(const Widget2 *const widget) : mFpsCheckBox->setSelected(mFps > 0); // Pre-select the current video mode. - const std::string videoMode = toString(mainGraphics->mWidth).append("x") - .append(toString(mainGraphics->mHeight)); + const std::string videoMode = toString( + mainGraphics->mActualWidth).append("x").append( + toString(mainGraphics->mActualHeight)); mModeList->setSelected(mModeListModel->getIndexOf(videoMode)); mModeList->setActionEventId("videomode"); @@ -428,11 +429,11 @@ void Setup_Video::cancel() config.setValue("screen", mFullScreenEnabled); // Set back to the current video mode. - std::string videoMode = toString(mainGraphics->mWidth).append("x") - .append(toString(mainGraphics->mHeight)); + std::string videoMode = toString(mainGraphics->mActualWidth).append("x") + .append(toString(mainGraphics->mActualHeight)); mModeList->setSelected(mModeListModel->getIndexOf(videoMode)); - config.setValue("screenwidth", mainGraphics->mWidth); - config.setValue("screenheight", mainGraphics->mHeight); + config.setValue("screenwidth", mainGraphics->mActualWidth); + config.setValue("screenheight", mainGraphics->mActualHeight); config.setValue("customcursor", mCustomCursorEnabled); config.setValue("opengl", static_cast<int>(mOpenGLEnabled)); @@ -474,18 +475,19 @@ void Setup_Video::action(const gcn::ActionEvent &event) if (!width || !height) return; - if (width != mainGraphics->mWidth || height != mainGraphics->mHeight) + if (width != mainGraphics->mActualWidth + || height != mainGraphics->mActualHeight) { #if defined(WIN32) || defined(__APPLE__) || defined(ANDROID) if (intToRenderType(config.getIntValue("opengl")) == RENDER_SOFTWARE) { - client->resizeVideo(width, height); + client->resizeVideo(width, height, false); } else { - if (width < mainGraphics->mWidth - || height < mainGraphics->mHeight) + if (width < mainGraphics->mActualWidth + || height < mainGraphics->mActualHeight) { // TRANSLATORS: video settings warning new OkDialog(_("Screen Resolution Changed"), @@ -505,13 +507,13 @@ void Setup_Video::action(const gcn::ActionEvent &event) } #else mainGraphics->setWindowSize(width, height); - client->resizeVideo(width, height); + client->resizeVideo(width, height, false); #endif } config.setValue("oldscreen", config.getBoolValue("screen")); - config.setValue("oldscreenwidth", mainGraphics->mWidth); - config.setValue("oldscreenheight", mainGraphics->mHeight); + config.setValue("oldscreenwidth", mainGraphics->mActualWidth); + config.setValue("oldscreenheight", mainGraphics->mActualHeight); config.setValue("screenwidth", width); config.setValue("screenheight", height); } |