- bullet tweaks
[supertux.git] / src / supertux.cpp
index 555495a..d410aaa 100644 (file)
@@ -1,61 +1,69 @@
-/*
-  supertux.c
-  
-  Super Tux
-  
-  by Bill Kendrick & Tobias Glaesser <tobi.web@gmx.de>
-  bill@newbreedsoftware.com
-  http://www.newbreedsoftware.com/supertux/
-  
-  April 11, 2000 - March 15, 2004
-*/
+//  $Id$
+// 
+//  SuperTux
+//  Copyright (C) 2004 Tobias Glaesser <tobi.web@gmx.de>
+//
+//  This program is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU General Public License
+//  as published by the Free Software Foundation; either version 2
+//  of the License, or (at your option) any later version.
+//
+//  This program is distributed in the hope that it will be useful,
+//  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
+//  02111-1307, USA.
 
-#include "supertux.h"
+#include <sys/types.h>
+#include <ctype.h>
 
+#include "defines.h"
+#include "globals.h"
+#include "setup.h"
+#include "intro.h"
+#include "title.h"
+#include "gameloop.h"
+#include "leveleditor.h"
+#include "screen.h"
+#include "worldmap.h"
+#include "resources.h"
 
-/* --- MAIN --- */
-
-#ifdef WIN32
-main(int argc, char * argv[])
-#else
 int main(int argc, char * argv[])
-#endif
 {
-  int done;
-  
+  st_directory_setup();
   parseargs(argc, argv);
   
-  st_directory_setup();
   st_audio_setup();
   st_video_setup();
   st_joystick_setup();
   st_general_setup();
   st_menu();
+  loadshared();
 
   if (launch_worldmap_mode)
     {
-      worldmap_run();
+      WorldMapNS::WorldMap worldmap;
+      worldmap.display();
     }
   else if (level_startup_file)
     {
-      gameloop(level_startup_file, 1, ST_GL_LOAD_LEVEL_FILE);
+      GameSession session(level_startup_file, 1, ST_GL_LOAD_LEVEL_FILE);
+      session.run();
     }
   else
     {  
-      done = intro();
-  
-      done = 0;
-  
-      while (!done)
-        {
-          done = title();
-        }
+      title();
     }
   
   clearscreen(0, 0, 0);
   updatescreen();
 
+  unloadshared();
   st_shutdown();
   
-  return(0);
+  return 0;
 }