Fixed: Redraw Menuitems only if changes were made.

Fixed: Logo is now shown after change of resolution.
* Changed: Download-Screen shows now a progress bar.
origin
patty21 22 years ago
parent 9e36f8c675
commit 3a83061d2c

@ -5,7 +5,7 @@ dnl Please disable it in the Anjuta project configuration
AC_INIT(configure.in)
AC_CANONICAL_TARGET
AM_INIT_AUTOMAKE(bomberclone, 0.11.1)
AM_INIT_AUTOMAKE(bomberclone, 0.11.2)
AM_CONFIG_HEADER(config.h)

@ -1,4 +1,4 @@
/* $Id: menu.h,v 1.4 2004/01/04 03:22:49 stpohle Exp $
/* $Id: menu.h,v 1.5 2004/02/02 23:30:34 patty21 Exp $
* GUI for menuhandling
*/
@ -34,7 +34,7 @@ struct __menuitem {
int type;
int len;
int id;
char changed;
char label[MENU_TITLELEN];
_keybinput keybi;
int state;

@ -1,4 +1,4 @@
/* $Id: network.h,v 1.14 2004/02/01 02:47:33 stpohle Exp $
/* $Id: network.h,v 1.15 2004/02/02 23:30:34 patty21 Exp $
* network.h file... for everything what have to do with the network stuff
*/
@ -111,7 +111,7 @@ extern void net_game_send_respawn (int pl_nr);
extern void net_game_fillsockaddr ();
extern void net_game_send_ill (int p_nr);
extern void net_delplayer (int pl_nr);
extern void draw_netupdatestate ();
extern void draw_netupdatestate (char st);
extern void net_send_servermode ();
extern void net_send_players ();
extern int net_check_timeout (int pl_nr);

@ -396,12 +396,14 @@ config_video ()
gfx.res.x = x;
gfx.res.y = y;
gfx_init ();
draw_logo ();
break;
case (2): // new color depth
gfx_shutdown ();
sscanf (selbpp->text, "%d", &x);
gfx.bpp = x;
gfx_init ();
draw_logo ();
break;
default:
done = 1;

@ -1,4 +1,4 @@
/* $Id: menu.c,v 1.37 2004/01/24 23:47:28 stpohle Exp $
/* $Id: menu.c,v 1.38 2004/02/02 23:30:34 patty21 Exp $
* Menuhandling */
#include "basic.h"
@ -396,7 +396,6 @@ int menu_loop () {
break;
}
else if (event.key.keysym.sym == SDLK_ESCAPE) {
done = 1;
return -1;
break;
}
@ -435,9 +434,10 @@ int menu_loop () {
menu_looprunning = 0;
if (reorder)
if (reorder) {
menu.focus->changed=1;
return -2;
}
return menu.focus->id;
};

@ -1,4 +1,4 @@
/* $Id: menulists.c,v 1.2 2003/12/26 02:20:10 stpohle Exp $
/* $Id: menulists.c,v 1.3 2004/02/02 23:30:35 patty21 Exp $
* Menuhandling: lists */
@ -42,6 +42,7 @@ void menu_create_list (char *name, int x, int y, int w, int h, _charlist *data,
menuitems[i].ptrdata = (char *) selected;
menuitems[i].list = data;
menuitems[i].id = id;
menuitems[i].changed=1;
strncpy (menuitems[i].label, name, MENU_TITLELEN);
};
@ -276,9 +277,11 @@ void menu_draw_list (_menuitem *mi) {
dest.x = MENUOFFSET_X + mi->pos.x + mi->pos.w - menu.listimages[focus][5]->w;
gfx_blit (menu.listimages[focus][5], NULL, gfx.screen, &dest, 10000);
}
if (mi->changed) {
menu_draw_listbackground (mi, NULL);
menu_draw_listtext (mi);
mi->changed=0;
}
};
@ -289,6 +292,7 @@ void menu_draw_list (_menuitem *mi) {
int menu_event_list (_menuitem *mi, SDL_Event *event) {
switch (event->type) {
case (SDL_KEYDOWN): /* key was pressed */
mi->changed=1;
if (event->key.keysym.sym == SDLK_LEFT)
menu_focus_prev ();
else if (event->key.keysym.sym == SDLK_RIGHT)
@ -302,7 +306,7 @@ int menu_event_list (_menuitem *mi, SDL_Event *event) {
break;
case (SDL_KEYUP):
keybinput_loop (&mi->keybi, event);
menu_draw_entry (mi);
// menu_draw_entry (mi);
break;
}

@ -1,4 +1,4 @@
/* $Id: network.c,v 1.59 2004/02/01 02:47:34 stpohle Exp $ */
/* $Id: network.c,v 1.60 2004/02/02 23:30:35 patty21 Exp $ */
/*
network routines.
*/
@ -8,6 +8,7 @@
#include "chat.h"
#include "packets.h"
#include "ogcache-client.h"
#include "menu.h"
int
network_server_port (char *server, char *host, int hostlen, char *port, int portlen)
@ -280,17 +281,20 @@ network_loop ()
this is needed to draw the whole uppdate of everything
*/
void
draw_netupdatestate ()
draw_netupdatestate (char st)
{
char text[255];
int y = 0,
i;
z,
i,
j;
SDL_Rect src,
dest;
z=gfx.res.x-110;
for (i = 0; i < MAX_PLAYERS; i++)
if (PS_IS_used (players[i].state)) {
y += 48;
if (st) {
redraw_logo (0, y, gfx.res.x, y + 48);
if (players[i].gfx_nr != -1) {
@ -306,12 +310,42 @@ draw_netupdatestate ()
gfx_blitupdaterectadd (&dest);
}
if (players[i].net.net_istep == 0)
sprintf (text, "%s - State : READY", players[i].name);
dest.x = 70;
dest.y = y+20;
dest.w = menu.listimages[1][0]->w;
dest.h = menu.listimages[1][0]->h;
gfx_blit (menu.listimages[1][0], NULL, gfx.screen, &dest, 10000);
dest.x = z+70+6;
gfx_blit (menu.listimages[1][2], NULL, gfx.screen, &dest, 10000);
// draw the bottom left and right of the list
dest.y = y+36;
gfx_blit (menu.listimages[1][8], NULL, gfx.screen, &dest, 10000);
dest.x = 70;
gfx_blit (menu.listimages[1][6], NULL, gfx.screen, &dest, 10000);
//top & bottom
for (j=4;j<z;j+=4) {
dest.x=j+70;dest.y=y+20;
gfx_blit (menu.listimages[1][1], NULL, gfx.screen, &dest, 10000);
dest.y = y+36;
gfx_blit (menu.listimages[1][7], NULL, gfx.screen, &dest, 10000);
}
//left &right
for (j=4;j<16;j+=4) {
dest.x=70;dest.y=y+20+j;
gfx_blit (menu.listimages[1][3], NULL, gfx.screen, &dest, 10000);
dest.x = z+70+6;
gfx_blit (menu.listimages[1][5], NULL, gfx.screen, &dest, 10000);
}
}
else
sprintf (text, "%s - State : DOWNLOAD", players[i].name);
font_draw (70, y, text, 0, 4);
redraw_logo(75,y+30,75+z-10,y+40);
if (players[i].net.net_istep == 0)
sprintf (text, "%s", players[i].name);
else
sprintf (text, "%s", players[i].name);
font_draw (80, y, text, 0, 4);
text[0] = 0;
if (players[i].net.net_istep == 3)
sprintf (text, "Getting Tunnel Data %d.", players[i].net.net_status);
@ -324,8 +358,9 @@ draw_netupdatestate ()
sprintf (text, "Getting Player Data %d of %d.", players[i].net.net_status,
MAX_PLAYERS);
font_draw (70, y + 32, text, 0, 4);
font_draw (80, y + 32, text, 0, 4);
}
gfx_blitdraw ();
return;
}
@ -407,6 +442,8 @@ net_transmit_gamedata ()
else
net_istep = 3;
draw_netupdatestate (1);
SDL_Flip (gfx.screen);
while (!done && (bman.state == GS_update || (GT_MP_PTPS && net_istep != 0))) {
/* the network thing */
@ -505,7 +542,7 @@ net_transmit_gamedata ()
}
/* do the grafik work */
draw_netupdatestate ();
draw_netupdatestate (0);
SDL_Flip (gfx.screen);
if (SDL_PollEvent (&event) != 0)

Loading…
Cancel
Save