Fixed EventPoll bug.
authorTobias Gläßer <tobi.web@gmx.de>
Sat, 21 Feb 2004 15:33:58 +0000 (15:33 +0000)
committerTobias Gläßer <tobi.web@gmx.de>
Sat, 21 Feb 2004 15:33:58 +0000 (15:33 +0000)
SVN-Revision: 142

src/gameloop.c
src/menu.c
src/menu.h
src/setup.c

index 4f83369..28a9956 100644 (file)
@@ -146,6 +146,7 @@ void game_event(void)
                     quit = 1;
                   else if(show_menu)
                     {
+                     menu_set_current(&game_menu);
                       show_menu = 0;
                       st_pause_ticks_stop();
                     }
@@ -589,6 +590,9 @@ int gameloop(char * subset, int levelnb, int mode)
   timer_init(&frame_timer);
   fps_cnt = 0;
 
+    while (SDL_PollEvent(&event))
+    {}
+  
   game_draw();
   do
     {
index bcbbbcb..245995d 100644 (file)
@@ -37,7 +37,7 @@ int show_menu;
 int menu_change;
 texture_type checkbox, checkbox_checked, back;
 
-menu_type main_menu, game_menu, options_menu, leveleditor_menu, highscore_menu, load_game_menu;
+menu_type main_menu, game_menu, options_menu, leveleditor_menu, highscore_menu, load_game_menu, save_game_menu;
 menu_type* current_menu, * last_menu;
 
 /* input implementation variables */
@@ -242,7 +242,7 @@ void menu_draw(menu_type* pmenu)
       else if(pmenu->item[i].kind == MN_LABEL)
         {
           text_drawf(&gold_text,pmenu->item[i].text,0,(i)*24 - menu_height/2 + 10,A_HMIDDLE, A_VMIDDLE,2,NO_UPDATE);
-          fillrect(screen->w/2 - menu_width/2,(i)*24 - menu_height/2 + 28,menu_width,2,150,150,150,100);
+          fillrect(screen->w/2 - menu_width/2,(i)*24 - menu_height/2 + 20 + screen->h /2,menu_width,2,190,190,190,100);
         }
       else if(pmenu->item[i].kind == MN_TEXTFIELD)
         {
index ecb86c7..64adf98 100644 (file)
@@ -69,7 +69,7 @@ extern int show_menu;
 extern int menu_change;
 extern texture_type checkbox, checkbox_checked, back;
 
-extern menu_type main_menu, game_menu, options_menu, leveleditor_menu, highscore_menu, load_game_menu;
+extern menu_type main_menu, game_menu, options_menu, leveleditor_menu, highscore_menu, load_game_menu, save_game_menu;;
 extern menu_type* current_menu, * last_menu;
 
 /* input implementation variables */
index d3d54c9..8e299f3 100644 (file)
@@ -252,9 +252,12 @@ void st_menu(void)
   menu_init(&load_game_menu);
   menu_additem(&load_game_menu,menu_item_create(MN_LABEL,"Load Game",0,0));
 
+  menu_init(&save_game_menu);
+  menu_additem(&save_game_menu,menu_item_create(MN_LABEL,"Save Game",0,0));
+  
   menu_init(&game_menu);
   menu_additem(&game_menu,menu_item_create(MN_ACTION,"Return To Game",0,0));
-  menu_additem(&game_menu,menu_item_create(MN_ACTION,"Save Game",0,0));
+  menu_additem(&game_menu,menu_item_create(MN_ACTION,"Save Game",0,&save_game_menu));
   menu_additem(&game_menu,menu_item_create(MN_GOTO,"Load Game",0,&load_game_menu));
   menu_additem(&game_menu,menu_item_create(MN_GOTO,"Options",0,&options_menu));
   menu_additem(&game_menu,menu_item_create(MN_ACTION,"Quit Game",0,0));