Fix for coverity #29360
[supertux.git] / src / supertux / game_manager.cpp
index c3ca5a1..1692a84 100644 (file)
 #include "supertux/game_session.hpp"
 #include "supertux/gameconfig.hpp"
 #include "supertux/globals.hpp"
+#include "supertux/levelset_screen.hpp"
+#include "supertux/savegame.hpp"
 #include "supertux/screen.hpp"
 #include "supertux/screen_fade.hpp"
 #include "supertux/screen_manager.hpp"
 #include "supertux/world.hpp"
-#include "supertux/savegame.hpp"
 #include "util/file_system.hpp"
 #include "util/log.hpp"
 #include "worldmap/worldmap.hpp"
@@ -50,13 +51,14 @@ GameManager::start_level(std::unique_ptr<World> world, const std::string& level_
   m_savegame.reset(new Savegame(m_world->get_savegame_filename()));
   m_savegame->load();
 
-  std::unique_ptr<Screen> screen(new GameSession(FileSystem::join(m_world->get_basedir(), level_filename),
-                                                 *m_savegame));
-  g_screen_manager->push_screen(std::move(screen));
+  std::unique_ptr<Screen> screen(new LevelsetScreen(m_world->get_basedir(),
+                                                    level_filename,
+                                                    *m_savegame));
+  ScreenManager::current()->push_screen(std::move(screen));
 }
 
 void
-GameManager::start_game(std::unique_ptr<World> world)
+GameManager::start_worldmap(std::unique_ptr<World> world)
 {
   try
   {
@@ -64,7 +66,7 @@ GameManager::start_game(std::unique_ptr<World> world)
     m_savegame.reset(new Savegame(m_world->get_savegame_filename()));
     m_savegame->load();
 
-    g_screen_manager->push_screen(std::unique_ptr<Screen>(
+    ScreenManager::current()->push_screen(std::unique_ptr<Screen>(
                                     new worldmap::WorldMap(m_world->get_worldmap_filename(),
                                                            *m_savegame)));
   }