|
|
|
@ -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)
|
|
|
|
|