load respawn graphic

origin
stpohle 22 years ago
parent dc0198efbd
commit 643ecc8f17

@ -1,4 +1,4 @@
/* $Id: gfx.c,v 1.30 2004/01/25 02:21:01 stpohle Exp $ */ /* $Id: gfx.c,v 1.31 2004/01/27 20:49:07 stpohle Exp $ */
/* gfx.c */ /* gfx.c */
#include "bomberclone.h" #include "bomberclone.h"
@ -106,6 +106,25 @@ gfx_load_players (int sx, int sy)
gfx.ill.image = SDL_DisplayFormat (tmpimage1); gfx.ill.image = SDL_DisplayFormat (tmpimage1);
SDL_FreeSurface (tmpimage); SDL_FreeSurface (tmpimage);
SDL_FreeSurface (tmpimage1); SDL_FreeSurface (tmpimage1);
/* load the illnessthing */
sprintf (filename, "%s/player/respawn.png", bman.datapath);
tmpimage = IMG_Load (filename);
if (tmpimage == NULL) {
printf ("Can't load image: %s\n", SDL_GetError ());
exit (1);
}
gfx.respawn.frames = tmpimage->h / (2 * GFX_IMGSIZE);
tmpimage1 =
scale_image (tmpimage, (2 * sx * tmpimage->w) / (2 * GFX_IMGSIZE),
gfx.respawn.frames * (2 * sy));
// getRGBpixel (tmpimage1, 0, 0, &r, &g, &b);
// SDL_SetColorKey (tmpimage1, SDL_SRCCOLORKEY, SDL_MapRGB (tmpimage1->format, r, g, b));
gfx.respawn.image = SDL_DisplayFormat (tmpimage1);
SDL_FreeSurface (tmpimage);
SDL_FreeSurface (tmpimage1);
}; };
@ -128,6 +147,8 @@ gfx_free_players ()
SDL_FreeSurface (gfx.dead.image); SDL_FreeSurface (gfx.dead.image);
if (gfx.ill.image != NULL) if (gfx.ill.image != NULL)
SDL_FreeSurface (gfx.ill.image); SDL_FreeSurface (gfx.ill.image);
if (gfx.respawn.image != NULL)
SDL_FreeSurface (gfx.respawn.image);
} }

Loading…
Cancel
Save