- moved lots of code around, made gameloop even more into a class
[supertux.git] / src / supertux.cpp
1 /*
2   supertux.c
3   
4   Super Tux
5   
6   by Bill Kendrick & Tobias Glaesser <tobi.web@gmx.de>
7   bill@newbreedsoftware.com
8   http://www.newbreedsoftware.com/supertux/
9   
10   April 11, 2000 - March 15, 2004
11 */
12
13 #include "supertux.h"
14
15
16 /* --- MAIN --- */
17
18 int main(int argc, char * argv[])
19 {
20   int done;
21   
22   st_directory_setup();
23   parseargs(argc, argv);
24   
25   st_audio_setup();
26   st_video_setup();
27   st_joystick_setup();
28   st_general_setup();
29   st_menu();
30
31   if (launch_worldmap_mode)
32     {
33       worldmap_run();
34     }
35   else if (level_startup_file)
36     {
37       GameSession session(level_startup_file, 1, ST_GL_LOAD_LEVEL_FILE);
38       session.run();
39     }
40   else
41     {  
42       done = 0;
43   
44       while (!done)
45         {
46           done = title();
47         }
48     }
49   
50   clearscreen(0, 0, 0);
51   updatescreen();
52
53   st_shutdown();
54   
55   return(0);
56 }