b4da51170bb8d52a1b3cd64f713fd91fc13a107c
[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 #include "resources.h"
15
16 int main(int argc, char * argv[])
17 {
18   bool done;
19   
20   st_directory_setup();
21   parseargs(argc, argv);
22   
23   st_audio_setup();
24   st_video_setup();
25   st_joystick_setup();
26   st_general_setup();
27   st_menu();
28
29   if (launch_worldmap_mode)
30     {
31       worldmap_run();
32     }
33   else if (level_startup_file)
34     {
35       GameSession session(level_startup_file, 1, ST_GL_LOAD_LEVEL_FILE);
36       session.run();
37     }
38   else
39     {  
40       done = false;
41       while (!done)
42         {
43           loadshared();
44           done = title();
45           unloadshared();
46         }
47     }
48   
49   clearscreen(0, 0, 0);
50   updatescreen();
51
52   st_shutdown();
53   
54   return 0;
55 }