Specials will shown in the status screen

origin
stpohle 23 years ago
parent 1a144c9021
commit 6249457afb

@ -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 - Network Option added for people who are playing
behind a firewall. Portforwarding should not anymore behind a firewall. Portforwarding should not anymore

@ -78,17 +78,21 @@ game_draw_info ()
bman.players_nr++; bman.players_nr++;
font_setcolor (255,255,255, 0); font_setcolor (255,255,255, 0);
x = gfx.res.x - 120; x = gfx.res.x - 120;
sprintf (text, "Bombs: %2d", bman.players[bman.p_nr].bombs_n); sprintf (text, "Bombs: %2d", bman.players[bman.p_nr].bombs_n);
font_draw (x, 0, text, 0); font_draw (x, 0, text, 0);
sprintf (text, "Range: %2d", bman.players[bman.p_nr].range); sprintf (text, "Range: %2d", bman.players[bman.p_nr].range);
font_draw (x, 16, text, 0); font_draw (x, 16, text, 0);
sprintf (text, "SP: %d/%d/%d Speed: %2d", bman.players[bman.p_nr].special.type, sprintf (text, "Speed: %2d", bman.players[bman.p_nr].speed);
bman.players[bman.p_nr].special.numuse, font_draw (x, 32, text, 0);
bman.players[bman.p_nr].special.to/TIME_FACTOR, if (bman.players[bman.p_nr].special.type != 0) {
bman.players[bman.p_nr].speed); dest.x = x - 32;
font_draw (x - 140, 32, text, 0); 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) if (bman.state == GS_ready && GT_MP_PTPM)
font_draw (100, 32, "Press F4 to start the game", 0); font_draw (100, 32, "Press F4 to start the game", 0);

@ -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 */ /* gfx.c */
#include <SDL.h> #include <SDL.h>
@ -948,8 +948,15 @@ gfx_load_tileset (char *tilesetname)
getRGBpixel (tmpimage1, 0, 0, &r, &g, &b); getRGBpixel (tmpimage1, 0, 0, &r, &g, &b);
SDL_SetColorKey (tmpimage1, SDL_SRCCOLORKEY, SDL_MapRGB (tmpimage1->format, r, g, b)); SDL_SetColorKey (tmpimage1, SDL_SRCCOLORKEY, SDL_MapRGB (tmpimage1->format, r, g, b));
gfx.field[i].image = SDL_DisplayFormat (tmpimage1); gfx.field[i].image = SDL_DisplayFormat (tmpimage1);
SDL_FreeSurface (tmpimage);
SDL_FreeSurface (tmpimage1); 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; UpdateRects_nr = 0;
@ -964,6 +971,11 @@ gfx_free_tileset ()
if (gfx.field[i].image != NULL) if (gfx.field[i].image != NULL)
SDL_FreeSurface (gfx.field[i].image); SDL_FreeSurface (gfx.field[i].image);
gfx.field[i].image = NULL; 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) if (gfx.bomb.image != NULL)
SDL_FreeSurface (gfx.bomb.image); SDL_FreeSurface (gfx.bomb.image);

@ -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_ #ifndef _GFX_H_
#define _GFX_H_ #define _GFX_H_
@ -19,7 +19,7 @@ struct __gfxplayer {
_gfxani ani; _gfxani ani;
_point offset; _point offset;
_point size; // height of the image.. needed for faster access. _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 SDL_Surface *smal_image; // smal size of the animation
} typedef _gfxplayer; } typedef _gfxplayer;
@ -38,6 +38,8 @@ struct __gfx {
short int postab[256]; // table of points where we need to go to. short int postab[256]; // table of points where we need to go to.
_gfxani field[FT_max]; // the field animations _gfxani field[FT_max]; // the field animations
SDL_Surface *smal_special[FT_max - FT_sp_trigger];
_gfxani powerup[3]; // powerup field animation _gfxani powerup[3]; // powerup field animation
_gfxani fire; // fire (explostion) _gfxani fire; // fire (explostion)
_gfxani bomb; // bomb animation _gfxani bomb; // bomb animation

Loading…
Cancel
Save