5 /* defined in their respective screen source files */
6 struct game_screen main_menu_screen;
7 struct game_screen game_screen;
9 static struct game_screen *screens[16];
10 static int num_screens;
12 static struct game_screen *stack;
14 int init_screens(void)
18 /* populate the screens */
19 screens[i++] = &main_menu_screen;
20 screens[i++] = &game_screen;
25 for(i=0; i<num_screens; i++) {
26 if(screens[i]->init() == -1) {
29 if(opt.start_scr && strcmp(screens[i]->name, opt.start_scr) == 0) {
36 void cleanup_screens(void)
40 for(i=0; i<num_screens; i++) {
41 screens[i]->cleanup();
45 void reshape_screens(int x, int y)
47 struct game_screen *s = stack;
54 void push_screen(struct game_screen *s)
63 struct game_screen *s;
65 if(!stack->next) return -1;