diff --git a/TODO b/TODO index f72f083..a9949f6 100644 --- a/TODO +++ b/TODO @@ -1,7 +1,4 @@ -$Id: TODO,v 1.17 2003/07/24 03:52:11 stpohle Exp $ - -next version (0.9.10): -====================== +$Id: TODO,v 1.18 2003/07/25 21:44:47 stpohle Exp $ - player selection screen for the single player @@ -19,14 +16,8 @@ next version (0.9.10): - add musicfiles with type of mp3, mod, xm, s3m and mid (but i don't know how i can do this) -always change if possible: -========================== - - animated fire + - more players -- we need some more sound for picking up items. -- find better way for menus -- bug: 1024x786 at start time.. and in the game chaning to 800x600 - the game crashs as soon as we want to start a single game. - \ No newline at end of file +- we need some more sound for picking up items. diff --git a/src/bomberclone.h b/src/bomberclone.h index ab18888..1b57d49 100644 --- a/src/bomberclone.h +++ b/src/bomberclone.h @@ -1,4 +1,4 @@ -/* $Id: bomberclone.h,v 1.46 2003/07/24 01:47:48 stpohle Exp $ */ +/* $Id: bomberclone.h,v 1.47 2003/07/25 21:44:47 stpohle Exp $ */ /* bomberclone.h */ #ifndef _BOMBERCLONE_H_ @@ -177,6 +177,7 @@ extern void game_draw_info (); extern void game_loop (); extern void game_end (); extern void game_start(); +extern void game_showresult (); // everything is declared in field.c extern void draw_field (); diff --git a/src/game.c b/src/game.c index fcaa880..3c73fe6 100644 --- a/src/game.c +++ b/src/game.c @@ -27,10 +27,10 @@ game_draw_info () dest; 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; dest.x = dest.y = 0; - dest.h = 3 * 16; + dest.h = 4.5 *16; dest.w = gfx.res.x; gfx_blitupdaterectadd (&dest); @@ -70,7 +70,7 @@ game_draw_info () x = x + 170; if (x >= gfx.res.x - (120 + 170)) { 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; - menu_displaytext ("Freeing..", "Please Wait", 32, 128, 32); gfx_free_players (); tileset_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 */ for (i = 0; i < MAX_PLAYERS; i++) if ((bman.players[i].state & PSF_used) == 0) @@ -276,3 +278,63 @@ game_start () gfx_load_players (gfx.block.x, gfx.block.y); 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); + } +}; \ No newline at end of file diff --git a/src/single.c b/src/single.c index a7b8c9f..3131384 100644 --- a/src/single.c +++ b/src/single.c @@ -1,4 +1,4 @@ -/* $Id: single.c,v 1.38 2003/07/25 12:28:50 stpohle Exp $ */ +/* $Id: single.c,v 1.39 2003/07/25 21:44:47 stpohle Exp $ */ /* single player */ #include "basic.h" @@ -609,6 +609,8 @@ single_playergame () bman.players[p].points = 0; bman.players[p].wins = 0; bman.players[p].state = 0; + bman.players[p].gfx_nr = -1; + bman.players[p].gfx = NULL; } for (bman.p_nr = -1, p = 0; (bman.p_nr == -1 && p < MAX_PLAYERS); p++) @@ -757,7 +759,7 @@ single_select_player () char text[255]; SDL_Event event; Uint8 *keys; - Uint32 timeloop1, timediff; + Uint32 timeloop1; menu_displaytext ("Loading..", "Please Wait", 32, 128, 32); @@ -905,7 +907,7 @@ single_select_player () d = right; } - if (keys[SDLK_RETURN] && (!keypressed) && (event.type = SDL_KEYDOWN) && newplayer == -1) { + if ((keys[SDLK_RETURN] ||keys[SDLK_RCTRL] || keys[SDLK_LCTRL]) && (!keypressed) && (event.type = SDL_KEYDOWN) && newplayer == -1) { done = 1; keypressed = 1; // d_printf("return pressed - done=1\n"); @@ -917,7 +919,6 @@ single_select_player () // calculate time sync. timeloop1 = SDL_GetTicks (); - timediff = timeloop1 - timestamp; // only for debugging needed if (newplayer != -1) i = 17;