#303: Typo fixes from mathnerd314
[supertux.git] / src / options_menu.cpp
index 0060f30..c947101 100644 (file)
@@ -36,7 +36,6 @@ enum OptionsMenuIDs {
   MNID_FULLSCREEN_RESOLUTION,
   MNID_MAGNIFICATION,
   MNID_ASPECTRATIO,
-  MNID_STRETCH_TO_WINDOW,
   MNID_PROFILES,
   MNID_SOUND,
   MNID_MUSIC
@@ -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<std::string>::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<std::string>::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;