From c6cb84a1be68f141b38ec941d30808363d0d5a1c Mon Sep 17 00:00:00 2001 From: Deve Date: Wed, 24 Sep 2014 18:04:14 +0200 Subject: [PATCH] Find best fit resolution only in fullscreen mode. --- src/graphics/irr_driver.cpp | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/src/graphics/irr_driver.cpp b/src/graphics/irr_driver.cpp index 74ea167d3..537b89a26 100644 --- a/src/graphics/irr_driver.cpp +++ b/src/graphics/irr_driver.cpp @@ -351,20 +351,22 @@ void IrrDriver::initDevice() core::dimension2d res = core::dimension2du(UserConfigParams::m_width, UserConfigParams::m_height); - - if (modes->getVideoModeCount() > 0) + if (UserConfigParams::m_fullscreen) { - res = modes->getVideoModeResolution(res, res); - - UserConfigParams::m_width = res.Width; - UserConfigParams::m_height = res.Height; - } - else - { - Log::verbose("irr_driver", "Cannot get information about " - "resolutions. Try to use the default one."); - UserConfigParams::m_width = MIN_SUPPORTED_WIDTH; - UserConfigParams::m_height = MIN_SUPPORTED_HEIGHT; + if (modes->getVideoModeCount() > 0) + { + res = modes->getVideoModeResolution(res, res); + + UserConfigParams::m_width = res.Width; + UserConfigParams::m_height = res.Height; + } + else + { + Log::verbose("irr_driver", "Cannot get information about " + "resolutions. Try to use the default one."); + UserConfigParams::m_width = MIN_SUPPORTED_WIDTH; + UserConfigParams::m_height = MIN_SUPPORTED_HEIGHT; + } } m_device->closeDevice();