Spiky, Snowball and Poison Ivy can move again
[supertux.git] / src / title.cpp
index 187b6f0..a688667 100644 (file)
@@ -1,8 +1,8 @@
 //  $Id$
-// 
+//
 //  SuperTux
-//  Copyright (C) 2000 Bill Kendrick <bill@newbreedsoftware.com>
 //  Copyright (C) 2004 Tobias Glaesser <tobi.web@gmx.de>
+//  Copyright (C) 2006 Matthias Braun <matze@braunis.de>
 //
 //  This program is free software; you can redistribute it and/or
 //  modify it under the terms of the GNU General Public License
@@ -13,7 +13,7 @@
 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 //  GNU General Public License for more details.
-// 
+//
 //  You should have received a copy of the GNU General Public License
 //  along with this program; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
@@ -46,7 +46,7 @@
 #include "level.hpp"
 #include "world.hpp"
 #include "game_session.hpp"
-#include "worldmap.hpp"
+#include "worldmap/worldmap.hpp"
 #include "player_status.hpp"
 #include "tile.hpp"
 #include "sector.hpp"
@@ -61,7 +61,7 @@
 #include "control/joystickkeyboardcontroller.hpp"
 #include "control/codecontroller.hpp"
 #include "main.hpp"
-#include "msg.hpp"
+#include "log.hpp"
 #include "console.hpp"
 
 void
@@ -120,7 +120,7 @@ TitleScreen::generate_contrib_menu()
       contrib_worlds.push_back(world.release());
     } catch(std::exception& e) {
 #ifdef DEBUG
-      msg_warning << "Couldn't parse levelset info for '" << *it << "': " << e.what() << std::endl;
+      log_warning << "Couldn't parse levelset info for '" << *it << "': " << e.what() << std::endl;
 #endif
     }
   }
@@ -144,7 +144,7 @@ TitleScreen::get_level_name(const std::string& filename)
     level->get("name", name);
     return name;
   } catch(std::exception& e) {
-    msg_warning << "Problem getting name of '" << filename << "'." << std::endl;
+    log_warning << "Problem getting name of '" << filename << "'." << std::endl;
     return "";
   }
 }
@@ -357,7 +357,7 @@ TitleScreen::update(float elapsed_time)
         
         if(confirm_dialog(bkg_title, str.c_str())) {
           str = "save/slot" + stream.str() + ".stsg";
-          msg_debug << "Removing: " << str << std::endl;
+          log_debug << "Removing: " << str << std::endl;
           PHYSFS_delete(str.c_str());
         }
 
@@ -430,11 +430,14 @@ TitleScreen::process_load_game_menu()
   stream << "save/" << worlddirname << "_" << slot << ".stsg";
   std::string slotfile = stream.str();
 
-  sound_manager->stop_music();
   fadeout(256);
 
-  current_world->set_savegame_filename(slotfile);
-  current_world->run();
+  try {
+    current_world->set_savegame_filename(slotfile);
+    current_world->run();
+  } catch(std::exception& e) {
+    log_fatal << "Couldn't start world: " << e.what() << std::endl;
+  }
 
   return true;
 }