menu_delete fixed, it happened sometimes that menus didn't disapear in the right way.

origin
stpohle 21 years ago
parent ca297c3a9a
commit be82589aaf

@ -1,4 +1,4 @@
/* $Id: menu.c,v 1.47 2004/09/12 21:42:59 stpohle Exp $ /* $Id: menu.c,v 1.48 2004/09/12 22:12:01 stpohle Exp $
* Menuhandling */ * Menuhandling */
#include "basic.h" #include "basic.h"
@ -55,6 +55,8 @@ menu_new (char *title, int x, int y)
void void
menu_delete (_menu * menu) menu_delete (_menu * menu)
{ {
gfx_blitdraw (); // to make sure nothing is left in the blitbuffer
gfx_restorescreen (menu->oldscreen, &menu->oldscreenpos); gfx_restorescreen (menu->oldscreen, &menu->oldscreenpos);
gfx_blitdraw (); gfx_blitdraw ();
SDL_FreeSurface (menu->oldscreen); SDL_FreeSurface (menu->oldscreen);

@ -1,4 +1,4 @@
/* $Id: multiwait.c,v 1.43 2004/09/12 21:08:11 stpohle Exp $ /* $Id: multiwait.c,v 1.44 2004/09/12 22:12:02 stpohle Exp $
multiwait.c - this manages only the network screen where multiwait.c - this manages only the network screen where
everyone have to select it's players and where even the basic chat is inside everyone have to select it's players and where even the basic chat is inside
*/ */
@ -43,7 +43,7 @@ mw_init ()
* do some calculations to setup everything on the screen * do some calculations to setup everything on the screen
*/ */
mw_num_players_x = gfx.res.x / MW_PLAYERSCR_X; mw_num_players_x = gfx.res.x / MW_PLAYERSCR_X;
mw_num_players_y = MAX_PLAYERS / mw_num_players_x; mw_num_players_y = ceil ((float)MAX_PLAYERS / (float)mw_num_players_x);
d_printf ("mw_num_players_x : %d, mw_num_players_y : %d\n", mw_num_players_x, mw_num_players_y); d_printf ("mw_num_players_x : %d, mw_num_players_y : %d\n", mw_num_players_x, mw_num_players_y);

@ -1,4 +1,4 @@
/* $Id: playermenu.c,v 1.3 2004/09/12 20:54:25 stpohle Exp $ /* $Id: playermenu.c,v 1.4 2004/09/12 22:12:02 stpohle Exp $
* *
*/ */
@ -159,7 +159,7 @@ void playermenu () {
sprintf (playerlist[i].text, "%2d. %15s", i+1, ""); sprintf (playerlist[i].text, "%2d. %15s", i+1, "");
charlist_fillarraypointer (playerlist, MAX_PLAYERS); charlist_fillarraypointer (playerlist, MAX_PLAYERS);
menu = menu_new ("Playermenu", 400, 350); menu = menu_new ("Playermenu", 400, 350);
printf ("called\n");
menu_create_entry (menu, " Player 1 Name: ", -1, 50, 350, &bman.playername, LEN_PLAYERNAME, MENU_entrytext, 2); menu_create_entry (menu, " Player 1 Name: ", -1, 50, 350, &bman.playername, LEN_PLAYERNAME, MENU_entrytext, 2);
menu_create_entry (menu, " Player 2 Name: ", -1, 80, 350, &bman.player2name, LEN_PLAYERNAME, MENU_entrytext, 3); menu_create_entry (menu, " Player 2 Name: ", -1, 80, 350, &bman.player2name, LEN_PLAYERNAME, MENU_entrytext, 3);
if (IS_LPLAYER2) if (IS_LPLAYER2)

Loading…
Cancel
Save