Find best fit resolution only in fullscreen mode.

This commit is contained in:
Deve 2014-09-24 18:04:14 +02:00
parent b524f72bb5
commit c6cb84a1be

View File

@ -351,20 +351,22 @@ void IrrDriver::initDevice()
core::dimension2d<u32> 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();