|
|
@ -27,10 +27,10 @@ game_draw_info ()
|
|
|
|
dest;
|
|
|
|
dest;
|
|
|
|
|
|
|
|
|
|
|
|
if (bman.updatestatusbar) {
|
|
|
|
if (bman.updatestatusbar) {
|
|
|
|
redraw_logo (0, 0, gfx.res.x, 3 * 16);
|
|
|
|
redraw_logo (0, 0, gfx.res.x, (4.5 * 16));
|
|
|
|
bman.updatestatusbar = 0;
|
|
|
|
bman.updatestatusbar = 0;
|
|
|
|
dest.x = dest.y = 0;
|
|
|
|
dest.x = dest.y = 0;
|
|
|
|
dest.h = 3 * 16;
|
|
|
|
dest.h = 4.5 *16;
|
|
|
|
dest.w = gfx.res.x;
|
|
|
|
dest.w = gfx.res.x;
|
|
|
|
gfx_blitupdaterectadd (&dest);
|
|
|
|
gfx_blitupdaterectadd (&dest);
|
|
|
|
|
|
|
|
|
|
|
@ -70,7 +70,7 @@ game_draw_info ()
|
|
|
|
x = x + 170;
|
|
|
|
x = x + 170;
|
|
|
|
if (x >= gfx.res.x - (120 + 170)) {
|
|
|
|
if (x >= gfx.res.x - (120 + 170)) {
|
|
|
|
x = 0;
|
|
|
|
x = 0;
|
|
|
|
j = j + 2 * font[0].size.x;
|
|
|
|
j = j + 1.5 * font[0].size.x;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -245,7 +245,6 @@ game_end ()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
int i;
|
|
|
|
|
|
|
|
|
|
|
|
menu_displaytext ("Freeing..", "Please Wait", 32, 128, 32);
|
|
|
|
|
|
|
|
gfx_free_players ();
|
|
|
|
gfx_free_players ();
|
|
|
|
tileset_free ();
|
|
|
|
tileset_free ();
|
|
|
|
snd_free ();
|
|
|
|
snd_free ();
|
|
|
@ -260,6 +259,9 @@ game_end ()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!GT_MP_PTP)
|
|
|
|
|
|
|
|
game_showresult ();
|
|
|
|
|
|
|
|
|
|
|
|
/* check which player is now free,i.e. disconnected during the game and was playing */
|
|
|
|
/* check which player is now free,i.e. disconnected during the game and was playing */
|
|
|
|
for (i = 0; i < MAX_PLAYERS; i++)
|
|
|
|
for (i = 0; i < MAX_PLAYERS; i++)
|
|
|
|
if ((bman.players[i].state & PSF_used) == 0)
|
|
|
|
if ((bman.players[i].state & PSF_used) == 0)
|
|
|
@ -276,3 +278,63 @@ game_start ()
|
|
|
|
gfx_load_players (gfx.block.x, gfx.block.y);
|
|
|
|
gfx_load_players (gfx.block.x, gfx.block.y);
|
|
|
|
snd_load (map.tileset);
|
|
|
|
snd_load (map.tileset);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* shor result of the game */
|
|
|
|
|
|
|
|
void game_showresult () {
|
|
|
|
|
|
|
|
SDL_Rect dest,
|
|
|
|
|
|
|
|
src;
|
|
|
|
|
|
|
|
char text[255];
|
|
|
|
|
|
|
|
SDL_Event event;
|
|
|
|
|
|
|
|
Uint8 *keys;
|
|
|
|
|
|
|
|
int done = 0, keypressed = 0, x, y;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
draw_logo ();
|
|
|
|
|
|
|
|
strcpy (text, "Game Result");
|
|
|
|
|
|
|
|
x = (gfx.res.x - (font[2].size.x * strlen (text)) - 64) / 2;
|
|
|
|
|
|
|
|
y = 64;
|
|
|
|
|
|
|
|
font_setcolor (128, 128, 0, 2);
|
|
|
|
|
|
|
|
font_draw (x - 2, y, text, 2);
|
|
|
|
|
|
|
|
font_draw (x + 2, y, text, 2);
|
|
|
|
|
|
|
|
font_draw (x, y - 2, text, 2);
|
|
|
|
|
|
|
|
font_draw (x, y + 2, text, 2);
|
|
|
|
|
|
|
|
font_setcolor (255, 255, 128, 2);
|
|
|
|
|
|
|
|
font_draw (x, y, text, 2);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
gfx_blitdraw ();
|
|
|
|
|
|
|
|
SDL_Flip (gfx.screen);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
while (!done) {
|
|
|
|
|
|
|
|
/* do the keyboard handling */
|
|
|
|
|
|
|
|
if (SDL_PollEvent (&event) != 0)
|
|
|
|
|
|
|
|
switch (event.type) {
|
|
|
|
|
|
|
|
case (SDL_QUIT):
|
|
|
|
|
|
|
|
bman.state = GS_quit;
|
|
|
|
|
|
|
|
bman.p_nr = -1;
|
|
|
|
|
|
|
|
done = 1;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
keys = SDL_GetKeyState (NULL);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (keys[SDLK_ESCAPE] && event.type == SDL_KEYDOWN) {
|
|
|
|
|
|
|
|
/* we want to quit */
|
|
|
|
|
|
|
|
done = 1;
|
|
|
|
|
|
|
|
bman.p_nr = -1;
|
|
|
|
|
|
|
|
keypressed = 1;
|
|
|
|
|
|
|
|
bman.state = GS_startup;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ((keys[SDLK_RETURN] || keys[SDLK_LCTRL] || keys[SDLK_RCTRL]) && (!keypressed) && (event.type = SDL_KEYDOWN)) {
|
|
|
|
|
|
|
|
done = 1;
|
|
|
|
|
|
|
|
keypressed = 1;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (event.type == SDL_KEYUP)
|
|
|
|
|
|
|
|
keypressed = 0;
|
|
|
|
|
|
|
|
else if (event.type == SDL_KEYDOWN)
|
|
|
|
|
|
|
|
keypressed = 1;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
s_delay (25);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|