diff options
-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); |