Check if window is larger than screen, if so switch back to 800x600

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@11187 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
auria
2012-05-06 14:49:39 +00:00
parent 95a8ba37e0
commit 70a49e4922

View File

@@ -199,6 +199,16 @@ void IrrDriver::initDevice()
}
} // end if firstTime
const core::dimension2d<u32> ssize = m_device->getVideoModeList()->getDesktopResolution();
if (UserConfigParams::m_width > (int)ssize.Width ||
UserConfigParams::m_height > (int)ssize.Height)
{
fprintf(stderr, "[IrrDriver] The window size specified in "
"user config is larger than your screen!");
UserConfigParams::m_width = 800;
UserConfigParams::m_height = 600;
}
m_device->closeDevice();
m_video_driver = NULL;