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:
parent
f1c9b285fa
commit
af02da1267
@ -49,8 +49,13 @@ using namespace irr::core;
|
||||
using namespace irr::scene;
|
||||
using namespace irr::video;
|
||||
|
||||
/** singleton */
|
||||
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()
|
||||
{
|
||||
m_res_switching = false;
|
||||
@ -84,11 +89,15 @@ void IrrDriver::initDevice()
|
||||
for(int i=0; i<count; i++)
|
||||
{
|
||||
// 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;
|
||||
mode.width = modes->getVideoModeResolution(i).Width;
|
||||
mode.height = modes->getVideoModeResolution(i).Height;
|
||||
mode.width = w;
|
||||
mode.height = h;
|
||||
m_modes.push_back( mode );
|
||||
}
|
||||
|
||||
|
@ -33,6 +33,7 @@
|
||||
|
||||
using namespace GUIEngine;
|
||||
|
||||
|
||||
OptionsScreenAV::OptionsScreenAV() : Screen("options_av.stkgui")
|
||||
{
|
||||
}
|
||||
@ -72,6 +73,7 @@ void OptionsScreenAV::init()
|
||||
assert( full != NULL );
|
||||
full->setState( UserConfigParams::m_fullscreen );
|
||||
|
||||
|
||||
// --- get resolution list from irrlicht the first time
|
||||
if(!this->m_inited)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user