Now the growings animation looks pretty cool :)
[supertux.git] / src / supertux.cpp
index 8cbc3be..22cf28d 100644 (file)
 #include "title.h"
 #include "gameloop.h"
 #include "leveleditor.h"
-#include "screen.h"
+#include "screen/screen.h"
 #include "worldmap.h"
 #include "resources.h"
-#include "texture.h"
+#include "screen/texture.h"
 #include "tile.h"
+#include "gettext.h"
 
 int main(int argc, char * argv[])
 {
+#ifndef DEBUG
   try {
+#endif
+    setlocale(LC_ALL, "");
+    bindtextdomain(PACKAGE, LOCALEDIR);
+    textdomain(PACKAGE);
+    bind_textdomain_codeset(PACKAGE, "ISO-8859-1");
+      
     st_directory_setup();
     parseargs(argc, argv);
 
@@ -53,11 +61,12 @@ int main(int argc, char * argv[])
 
     if (launch_leveleditor_mode && level_startup_file)
     {
-    leveleditor(level_startup_file);
+      // TODO
+      // leveleditor(level_startup_file);
     }
     else if (level_startup_file)
     {
-      GameSession session(level_startup_file, 1, ST_GL_LOAD_LEVEL_FILE);
+      GameSession session(level_startup_file, ST_GL_LOAD_LEVEL_FILE);
       session.run();
     }
     else
@@ -65,8 +74,8 @@ int main(int argc, char * argv[])
       title();
     }
 
-    clearscreen(0, 0, 0);
-    updatescreen();
+    SDL_FillRect(screen, 0, 0);
+    SDL_Flip(screen);
 
     unloadshared();
     st_general_free();
@@ -75,6 +84,7 @@ int main(int argc, char * argv[])
     Surface::debug_check();
     #endif
     st_shutdown();
+#ifndef DEBUG  // we want to see the backtrace in gdb when in debug mode
   }
   catch (SuperTuxException &e)
   {
@@ -84,6 +94,7 @@ int main(int argc, char * argv[])
   {
     std:: cerr << "Unhandled exception: " << e.what() << std::endl;
   }
+#endif
 
   return 0;
 }