menu_dir_select cpu usage problem fixed.

origin
stpohle 23 years ago
parent d07185d6b0
commit ef74f4b176

@ -1,4 +1,4 @@
/* $Id: menu.c,v 1.13 2003/05/07 18:48:05 patty21 Exp $ */
/* $Id: menu.c,v 1.14 2003/05/07 18:57:22 stpohle Exp $ */
/* menu's for the game */
#include <SDL.h>
@ -400,7 +400,7 @@ char *menu_dir_select (char *title, char *path, signed char dirflags) {
_direntry *destart, *de;
SDL_Event event;
Uint8 *keys;
int max = 0, sel = 0, keypressed = 0, done = 0, listend = 0, liststart = 0;
int max = 0, sel = 0, keypressed = 0, done = 0, listend = 0, liststart = 0, oldsel = -1;
/* get the directory list and count the numbers */
destart = s_getdir (path);
@ -412,8 +412,11 @@ char *menu_dir_select (char *title, char *path, signed char dirflags) {
while (done == 0 || (done == 1 && keypressed == 1)) {
/* do the network loop if we have to */
if (oldsel != sel) {
listend = menu_dir_draw (title, destart, liststart, sel);
SDL_Flip (gfx.screen);
oldsel = sel;
}
if (bman.gametype == GT_multi && bman.sock != -1)
network_loop ();

Loading…
Cancel
Save