From f7b28153ac0e7700adc09a3d5f9333d301d70a09 Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 12 Mar 2016 14:46:13 +0100 Subject: [PATCH] Fixed: 0x0 is Auto mode --- .../client_config_qt/display_settings_widget.cpp | 13 ++++++++++++- code/ryzom/tools/client/client_config_qt/system.cpp | 10 ++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/code/ryzom/tools/client/client_config_qt/display_settings_widget.cpp b/code/ryzom/tools/client/client_config_qt/display_settings_widget.cpp index ae8b1a590..49e841631 100644 --- a/code/ryzom/tools/client/client_config_qt/display_settings_widget.cpp +++ b/code/ryzom/tools/client/client_config_qt/display_settings_widget.cpp @@ -166,7 +166,18 @@ void CDisplaySettingsWidget::updateVideoModes() while(itr != iend) { - videomodeComboBox->addItem(QString("%1x%2 %3 bit @%4").arg(itr->width).arg(itr->height).arg(itr->depth).arg(itr->frequency)); + if (itr->frequency) + { + videomodeComboBox->addItem(QString("%1x%2 %3 bit @%4").arg(itr->width).arg(itr->height).arg(itr->depth).arg(itr->frequency)); + } + else if (itr->width) + { + videomodeComboBox->addItem(QString("%1x%2 %3 bit").arg(itr->width).arg(itr->height).arg(itr->depth)); + } + else + { + videomodeComboBox->addItem(tr("Auto")); + } ++itr; } diff --git a/code/ryzom/tools/client/client_config_qt/system.cpp b/code/ryzom/tools/client/client_config_qt/system.cpp index 8ef5a930b..635800878 100644 --- a/code/ryzom/tools/client/client_config_qt/system.cpp +++ b/code/ryzom/tools/client/client_config_qt/system.cpp @@ -160,6 +160,16 @@ void CSystem::GetVideoModes( std::vector< CVideoMode > &dst, NL3D::IDriver *driv std::vector< NL3D::GfxMode > modes; driver->getModes( modes ); + { + // auto mode + CVideoMode mode; + mode.depth = 0; + mode.width = 0; + mode.height = 0; + mode.frequency = 0; + dst.push_back( mode ); + } + for( std::vector< NL3D::GfxMode >::iterator itr = modes.begin(); itr != modes.end(); ++itr ) { if( ( itr->Width >= 800 ) && ( itr->Height >= 600 ) && ( itr->Depth >= 16 ) )