diff --git a/ChangeLog b/ChangeLog index dae6bc8..444bbde 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,5 @@ +- New Font Drawing enginge, so we can draw in with + diffrent fonts and colors. - Network Option added for people who are playing behind a firewall. Portforwarding should not anymore diff --git a/src/game.c b/src/game.c index 3fdf954..1a272b9 100644 --- a/src/game.c +++ b/src/game.c @@ -78,17 +78,21 @@ game_draw_info () bman.players_nr++; font_setcolor (255,255,255, 0); - x = gfx.res.x - 120; sprintf (text, "Bombs: %2d", bman.players[bman.p_nr].bombs_n); font_draw (x, 0, text, 0); sprintf (text, "Range: %2d", bman.players[bman.p_nr].range); font_draw (x, 16, text, 0); - sprintf (text, "SP: %d/%d/%d Speed: %2d", bman.players[bman.p_nr].special.type, - bman.players[bman.p_nr].special.numuse, - bman.players[bman.p_nr].special.to/TIME_FACTOR, - bman.players[bman.p_nr].speed); - font_draw (x - 140, 32, text, 0); + sprintf (text, "Speed: %2d", bman.players[bman.p_nr].speed); + font_draw (x, 32, text, 0); + if (bman.players[bman.p_nr].special.type != 0) { + dest.x = x - 32; + dest.y = 16; + dest.w = gfx.smal_special[bman.players[bman.p_nr].special.type - 1]->w; + dest.h = gfx.smal_special[bman.players[bman.p_nr].special.type - 1]->h; + + SDL_BlitSurface (gfx.smal_special[bman.players[bman.p_nr].special.type - 1], NULL, gfx.screen, &dest); + } if (bman.state == GS_ready && GT_MP_PTPM) font_draw (100, 32, "Press F4 to start the game", 0); diff --git a/src/gfx.c b/src/gfx.c index affbca7..1ab86f9 100644 --- a/src/gfx.c +++ b/src/gfx.c @@ -1,4 +1,4 @@ -/* $Id: gfx.c,v 1.19 2003/06/06 23:22:03 stpohle Exp $ */ +/* $Id: gfx.c,v 1.20 2003/06/07 14:25:46 stpohle Exp $ */ /* gfx.c */ #include @@ -948,8 +948,15 @@ gfx_load_tileset (char *tilesetname) getRGBpixel (tmpimage1, 0, 0, &r, &g, &b); SDL_SetColorKey (tmpimage1, SDL_SRCCOLORKEY, SDL_MapRGB (tmpimage1->format, r, g, b)); gfx.field[i].image = SDL_DisplayFormat (tmpimage1); - SDL_FreeSurface (tmpimage); SDL_FreeSurface (tmpimage1); + if (i >= FT_sp_trigger && i < FT_max) { + // create the smal special thing + tmpimage1 = scale_image (tmpimage, 32, 32); + getRGBpixel (tmpimage1, 0, 0, &r, &g, &b); + SDL_SetColorKey (tmpimage1, SDL_SRCCOLORKEY, SDL_MapRGB (tmpimage1->format, r, g, b)); + gfx.smal_special[i - FT_sp_trigger] = SDL_DisplayFormat (tmpimage1); + }; + SDL_FreeSurface (tmpimage); } } UpdateRects_nr = 0; @@ -964,6 +971,11 @@ gfx_free_tileset () if (gfx.field[i].image != NULL) SDL_FreeSurface (gfx.field[i].image); gfx.field[i].image = NULL; + if (i >= FT_sp_trigger && i < FT_max) { + if (gfx.smal_special[i - FT_sp_trigger] != NULL) + SDL_FreeSurface (gfx.smal_special[i - FT_sp_trigger]); + gfx.smal_special[i - FT_sp_trigger] = NULL; + } } if (gfx.bomb.image != NULL) SDL_FreeSurface (gfx.bomb.image); diff --git a/src/gfx.h b/src/gfx.h index 07a8beb..3acc846 100644 --- a/src/gfx.h +++ b/src/gfx.h @@ -1,4 +1,4 @@ -/* $Id: gfx.h,v 1.10 2003/06/06 23:22:03 stpohle Exp $ */ +/* $Id: gfx.h,v 1.11 2003/06/07 14:25:46 stpohle Exp $ */ #ifndef _GFX_H_ #define _GFX_H_ @@ -19,7 +19,7 @@ struct __gfxplayer { _gfxani ani; _point offset; _point size; // height of the image.. needed for faster access. - _point smal_size; // smal size of the image + _point smal_size; SDL_Surface *smal_image; // smal size of the animation } typedef _gfxplayer; @@ -38,6 +38,8 @@ struct __gfx { short int postab[256]; // table of points where we need to go to. _gfxani field[FT_max]; // the field animations + SDL_Surface *smal_special[FT_max - FT_sp_trigger]; + _gfxani powerup[3]; // powerup field animation _gfxani fire; // fire (explostion) _gfxani bomb; // bomb animation