Eclude from resolution choices resolutions that are too small (and that STK's GUI does not support)

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@4627 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
auria 2010-02-03 21:56:45 +00:00
parent f1c9b285fa
commit af02da1267
2 changed files with 14 additions and 3 deletions

View File

@ -49,8 +49,13 @@ using namespace irr::core;
using namespace irr::scene; using namespace irr::scene;
using namespace irr::video; using namespace irr::video;
/** singleton */
IrrDriver *irr_driver = NULL; IrrDriver *irr_driver = NULL;
const int MIN_SUPPORTED_HEIGHT = 480; //TODO: do some tests, 480 might be too small without a special menu
const int MIN_SUPPORTED_WIDTH = 800;
// ----------------------------------------------------------------------------
IrrDriver::IrrDriver() IrrDriver::IrrDriver()
{ {
m_res_switching = false; m_res_switching = false;
@ -84,11 +89,15 @@ void IrrDriver::initDevice()
for(int i=0; i<count; i++) for(int i=0; i<count; i++)
{ {
// only consider 32-bit resolutions for now // only consider 32-bit resolutions for now
if(modes->getVideoModeDepth(i) >= 24) if (modes->getVideoModeDepth(i) >= 24)
{ {
const int w = modes->getVideoModeResolution(i).Width;
const int h = modes->getVideoModeResolution(i).Height;
if (h < MIN_SUPPORTED_HEIGHT || w < MIN_SUPPORTED_WIDTH) continue;
VideoMode mode; VideoMode mode;
mode.width = modes->getVideoModeResolution(i).Width; mode.width = w;
mode.height = modes->getVideoModeResolution(i).Height; mode.height = h;
m_modes.push_back( mode ); m_modes.push_back( mode );
} }

View File

@ -33,6 +33,7 @@
using namespace GUIEngine; using namespace GUIEngine;
OptionsScreenAV::OptionsScreenAV() : Screen("options_av.stkgui") OptionsScreenAV::OptionsScreenAV() : Screen("options_av.stkgui")
{ {
} }
@ -72,6 +73,7 @@ void OptionsScreenAV::init()
assert( full != NULL ); assert( full != NULL );
full->setState( UserConfigParams::m_fullscreen ); full->setState( UserConfigParams::m_fullscreen );
// --- get resolution list from irrlicht the first time // --- get resolution list from irrlicht the first time
if(!this->m_inited) if(!this->m_inited)
{ {