X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Foptions_menu.cpp;h=ccadc447e28f8f158e0cf2415d51747d5aed359e;hb=e126dd8c3da286ab759dc36f3f59f3955e16ed09;hp=0060f30c2ac4139cb0c9dcaadc7e2350ea5c71b9;hpb=7a6f00e27bdc0aac2107506c3b00cbf0bf1cccc5;p=supertux.git diff --git a/src/options_menu.cpp b/src/options_menu.cpp index 0060f30c2..ccadc447e 100644 --- a/src/options_menu.cpp +++ b/src/options_menu.cpp @@ -36,7 +36,6 @@ enum OptionsMenuIDs { MNID_FULLSCREEN_RESOLUTION, MNID_MAGNIFICATION, MNID_ASPECTRATIO, - MNID_STRETCH_TO_WINDOW, MNID_PROFILES, MNID_SOUND, MNID_MUSIC @@ -72,13 +71,13 @@ public: config->locale = ""; dictionary_manager.set_language(config->locale); config->save(); - Menu::set_current(0); + Menu::pop_current(); } else if (item->id == 1) { config->locale = "en"; dictionary_manager.set_language(config->locale); config->save(); - Menu::set_current(0); + Menu::pop_current(); } int mnid = 10; std::set languages = dictionary_manager.get_languages(); @@ -88,7 +87,7 @@ public: config->locale = locale_name; dictionary_manager.set_language(config->locale); config->save(); - Menu::set_current(0); + Menu::pop_current(); } } } @@ -148,9 +147,6 @@ OptionsMenu::OptionsMenu() magnification->list.push_back("200%"); magnification->list.push_back("250%"); - add_toggle(MNID_STRETCH_TO_WINDOW, _("Stretch to Window"), config->stretch_to_window) - ->set_help(_("Use the fullscreen resolution and stretch SuperTux to fill the given window")); - SDL_Rect** modes = SDL_ListModes(NULL, SDL_FULLSCREEN|SDL_OPENGL); if (modes == (SDL_Rect **)0) @@ -191,22 +187,25 @@ OptionsMenu::OptionsMenu() aspect->list.push_back("16:9"); aspect->list.push_back("1368:768"); - std::ostringstream out; - out << config->aspect_width << ":" << config->aspect_height; - std::string aspect_ratio = out.str(); - for(std::vector::iterator i = aspect->list.begin(); i != aspect->list.end(); ++i) + if (config->aspect_width != 0 && config->aspect_height != 0) { - if(*i == aspect_ratio) + std::ostringstream out; + out << config->aspect_width << ":" << config->aspect_height; + std::string aspect_ratio = out.str(); + for(std::vector::iterator i = aspect->list.begin(); i != aspect->list.end(); ++i) { - aspect_ratio.clear(); - break; + if(*i == aspect_ratio) + { + aspect_ratio.clear(); + break; + } } - } - if (!aspect_ratio.empty()) - { - aspect->selected = aspect->list.size(); - aspect->list.push_back(aspect_ratio); + if (!aspect_ratio.empty()) + { + aspect->selected = aspect->list.size(); + aspect->list.push_back(aspect_ratio); + } } if (sound_manager->is_audio_enabled()) { @@ -215,8 +214,8 @@ OptionsMenu::OptionsMenu() add_toggle(MNID_MUSIC, _("Music"), config->music_enabled) ->set_help(_("Disable all music")); } else { - add_deactive(MNID_SOUND, _("Sound (disabled)")); - add_deactive(MNID_MUSIC, _("Music (disabled)")); + add_inactive(MNID_SOUND, _("Sound (disabled)")); + add_inactive(MNID_MUSIC, _("Music (disabled)")); } add_submenu(_("Setup Keyboard"), main_controller->get_key_options_menu()) @@ -280,7 +279,8 @@ OptionsMenu::menu_action(MenuItem* item) case MNID_FULLSCREEN: if(config->use_fullscreen != options_menu->is_toggled(MNID_FULLSCREEN)) { config->use_fullscreen = !config->use_fullscreen; - init_video(); + init_video(); // FIXME: Should call apply_config instead + Menu::recalc_pos(); config->save(); } break;