+ else if (launch_worldmap_mode && level_startup_file)
+ {
+ // hack to make it possible for someone to give an absolute path
+ std::string str(level_startup_file);
+ unsigned int i = str.find_last_of("/", str.size());
+ if(i != std::string::npos)
+ str.erase(0, i+1);
+
+ WorldMapNS::WorldMap worldmap;
+ worldmap.loadmap(str);
+ worldmap.display();
+ }
+ else if (level_startup_file)
+ {
+ GameSession session(level_startup_file, ST_GL_LOAD_LEVEL_FILE);
+ session.run();
+ }
+ else
+ {
+ title();
+ }
+
+ unloadshared();
+ Setup::general_free();
+ st_menu_free();
+ TileManager::destroy_instance();
+#ifdef DEBUG
+ Surface::debug_check();
+#endif
+ Termination::shutdown();
+#ifndef DEBUG // we want to see the backtrace in gdb when in debug mode
+ } catch (SuperTuxException &e) {
+ std::cerr << "Unhandled SuperTux exception:\n " << e.what_file() << ":" << e.what_line() << ": " << e.what() << std::endl;
+ } catch (std::exception &e) {
+ std:: cerr << "Unhandled exception: " << e.what() << std::endl;
+ }
+#endif
+
+ return 0;