From 18928c0dbfd521c3d4a72c67b19bc614d5749883 Mon Sep 17 00:00:00 2001 From: ob1kenewb Date: Sat, 10 May 2003 21:14:04 +0000 Subject: [PATCH] Use SDL_WaitEvent instead of Pool Even otherwhise the menu handling is like an active loop and this is not GOOD for the CPU :). We have the same pb for the Game Loop where SDL_PoolEven is used to lookup the key to move the player... Maybe create a thread to look for the key ? --- src/menu.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/menu.c b/src/menu.c index 61d9137..5cae7e9 100644 --- a/src/menu.c +++ b/src/menu.c @@ -1,4 +1,4 @@ -/* $Id: menu.c,v 1.20 2003/05/10 00:36:03 patty21 Exp $ */ +/* $Id: menu.c,v 1.21 2003/05/10 21:14:04 ob1kenewb Exp $ */ /* menu's for the game */ #include @@ -127,7 +127,7 @@ menu_loop (char *menutitle, _menu menu[], int lastselect) if (bman.gametype == GT_multi && bman.sock != -1) network_loop (); - if (SDL_PollEvent (&event) != 0) + if (SDL_WaitEvent (&event) != 0) switch (event.type) { case (SDL_QUIT): menuselect = -1; @@ -240,7 +240,7 @@ menu_get_text (char *title, char *text, int len) if (bman.gametype == GT_multi && bman.sock != -1) network_loop (); - if (SDL_PollEvent (&event) != 0) + if (SDL_WaitEvent (&event) != 0) switch (event.type) { case (SDL_QUIT): bman.state = GS_quit; @@ -346,7 +346,7 @@ menu_displaymessage (char *title, char *text) if (bman.gametype == GT_multi && bman.sock != -1) network_loop (); - if (SDL_PollEvent (&event) != 0) + if (SDL_WaitEvent (&event) != 0) switch (event.type) { case (SDL_QUIT): done = 1; @@ -460,7 +460,7 @@ char *menu_dir_select (char *title, char *path, signed char dirflags) { if (bman.gametype == GT_multi && bman.sock != -1) network_loop (); - if (SDL_PollEvent (&event) != 0) + if (SDL_WaitEvent (&event) != 0) switch (event.type) { case (SDL_QUIT): sel = -1;