- moved loadshared() to the right point
[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   loadshared();
29
30   if (launch_worldmap_mode)
31     {
32       worldmap_run();
33     }
34   else if (level_startup_file)
35     {
36       GameSession session(level_startup_file, 1, ST_GL_LOAD_LEVEL_FILE);
37       session.run();
38     }
39   else
40     {  
41       done = false;
42       while (!done)
43         {
44           done = title();
45         }
46     }
47   
48   clearscreen(0, 0, 0);
49   updatescreen();
50
51   unloadshared();
52   st_shutdown();
53   
54   return 0;
55 }