updating Nolok contrib templates
[supertux.git] / src / supertux.cpp
index c29d7f3..46efc59 100644 (file)
 //  along with this program; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //  02111-1307, USA.
+#include <config.h>
 
 #include <sys/types.h>
 #include <cctype>
 #include <iostream>
 #include <exception>
+#include <locale.h>
 
-#include "utils/exceptions.h"
-#include "defines.h"
 #include "app/globals.h"
 #include "app/setup.h"
-#include "intro.h"
 #include "title.h"
 #include "gameloop.h"
 #include "leveleditor.h"
@@ -37,7 +36,6 @@
 #include "video/surface.h"
 #include "tile_manager.h"
 #include "app/gettext.h"
-#include "player.h"
 #include "misc.h"
 #include "utils/configfile.h"
 
@@ -47,18 +45,13 @@ int main(int argc, char * argv[])
   try {
 #endif
     config = new MyConfig;
-    setlocale(LC_ALL, "");
-    bindtextdomain(PACKAGE, LOCALEDIR);
-    textdomain(PACKAGE);
-    bind_textdomain_codeset(PACKAGE, "ISO-8859-1");
+   
+    Setup::init(PACKAGE_NAME, PACKAGE_NAME, PACKAGE_VERSION);
     
-    Setup::info(PACKAGE_NAME,PACKAGE,PACKAGE_VERSION);  
-    
-    Setup::directories();
     Setup::parseargs(argc, argv);
 
     Setup::audio();
-    Setup::video(SCREEN_W,SCREEN_H);
+    Setup::video(screen_width, screen_height);
     Setup::joystick();
     Setup::general();
     st_menu();
@@ -95,25 +88,15 @@ int main(int argc, char * argv[])
       title();
     }
 
-    SDL_FillRect(screen, 0, 0);
-    //SDL_Flip(screen);
-
     unloadshared();
     Setup::general_free();
     st_menu_free();
-    TileManager::destroy_instance();
-    #ifdef DEBUG
+#ifdef DEBUG
     Surface::debug_check();
-    #endif
+#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)
-  {
+  } catch (std::exception &e) {
     std:: cerr << "Unhandled exception: " << e.what() << std::endl;
   }
 #endif