diff options
author | Eugene Sandulenko | 2006-05-30 01:41:49 +0000 |
---|---|---|
committer | Eugene Sandulenko | 2006-05-30 01:41:49 +0000 |
commit | 5bbe44cd505dafb5a64df677fc0889248c523c13 (patch) | |
tree | 9973ce22e9ba75b77dc0277e56a739818af83b2d /gui | |
parent | ce33cfd93840bcac3142546c62bd7f31a884f64c (diff) | |
download | scummvm-rg350-5bbe44cd505dafb5a64df677fc0889248c523c13.tar.gz scummvm-rg350-5bbe44cd505dafb5a64df677fc0889248c523c13.tar.bz2 scummvm-rg350-5bbe44cd505dafb5a64df677fc0889248c523c13.zip |
Fix bug #1496582 "GUI: Default graphics mode not committing".
svn-id: r22763
Diffstat (limited to 'gui')
-rw-r--r-- | gui/launcher.cpp | 9 | ||||
-rw-r--r-- | gui/options.cpp | 5 |
2 files changed, 11 insertions, 3 deletions
diff --git a/gui/launcher.cpp b/gui/launcher.cpp index 923d3c9bee..a03e32d903 100644 --- a/gui/launcher.cpp +++ b/gui/launcher.cpp @@ -291,10 +291,13 @@ void EditGameDialog::open() { const Common::LanguageDescription *l = Common::g_languages; const Common::Language lang = Common::parseLanguage(ConfMan.get("language", _domain)); + sel = 0; - for (i = 0; l->code; ++l, ++i) { - if (lang == l->id) - sel = i + 2; + if (ConfMan.hasKey("language", _domain)) { + for (i = 0; l->code; ++l, ++i) { + if (lang == l->id) + sel = i + 2; + } } _langPopUp->setSelected(sel); diff --git a/gui/options.cpp b/gui/options.cpp index 60c5e4888a..62c5347520 100644 --- a/gui/options.cpp +++ b/gui/options.cpp @@ -242,17 +242,22 @@ void OptionsDialog::close() { ConfMan.setBool("fullscreen", _fullscreenCheckbox->getState(), _domain); ConfMan.setBool("aspect_ratio", _aspectCheckbox->getState(), _domain); + bool isSet = false; + if ((int32)_gfxPopUp->getSelectedTag() >= 0) { const OSystem::GraphicsMode *gm = g_system->getSupportedGraphicsModes(); while (gm->name) { if (gm->id == (int)_gfxPopUp->getSelectedTag()) { ConfMan.set("gfx_mode", gm->name, _domain); + isSet = true; break; } gm++; } } + if (!isSet) + ConfMan.removeKey("gfx_mode", _domain); if ((int32)_renderModePopUp->getSelectedTag() >= 0) ConfMan.set("render_mode", Common::getRenderModeCode((Common::RenderMode)_renderModePopUp->getSelectedTag()), _domain); |