New grow and skid sounds from remaxim
[supertux.git] / src / title.cpp
index dfa805e..f706e93 100644 (file)
@@ -44,6 +44,7 @@
 #include "video/drawing_context.hpp"
 #include "world.hpp"
 
+#include <algorithm>
 #include <physfs.h>
 
 enum MainMenuIDs {
@@ -102,9 +103,7 @@ TitleScreen::generate_contrib_menu()
       contrib_menu->add_entry(i++, world->title);
       contrib_worlds.push_back(world.release());
     } catch(std::exception& e) {
-#ifdef DEBUG
       log_warning << "Couldn't parse levelset info for '" << *it << "': " << e.what() << std::endl;
-#endif
     }
   }
 
@@ -421,6 +420,7 @@ TitleScreen::update(float elapsed_time)
           break;
 
         case MNID_CREDITS:
+          Menu::set_current(NULL);
           main_loop->push_screen(new TextScroller("credits.txt"),
                                  new FadeOut(0.5));
           break;
@@ -439,9 +439,9 @@ TitleScreen::update(float elapsed_time)
     }
   }
 
-  // reopen menu of user closed it (so that the app doesn't close when user
+  // reopen menu if user closed it (so that the app doesn't close when user
   // accidently hit ESC)
-  if(Menu::current() == 0) {
+  if(Menu::current() == 0 && main_loop->has_no_pending_fadeout()) {
     generate_main_menu();
     Menu::set_current(main_menu.get());
   }
@@ -450,6 +450,7 @@ TitleScreen::update(float elapsed_time)
 void
 TitleScreen::start_game()
 {
+  Menu::set_current(NULL);
   std::string basename = current_world->get_basedir();
   basename = basename.substr(0, basename.length()-1);
   std::string worlddirname = FileSystem::basename(basename);