read at the first menu border image the top left pixel to set as transparent for the image.

origin
stpohle 22 years ago
parent 26644b1af9
commit 7c048bf1e6

@ -1,4 +1,4 @@
/* $Id: gfx.c,v 1.28 2003/12/24 02:38:15 stpohle Exp $ */
/* $Id: gfx.c,v 1.29 2003/12/31 01:00:11 stpohle Exp $ */
/* gfx.c */
#include "bomberclone.h"
@ -158,6 +158,7 @@ void
gfx_loaddata ()
{
int i, j;
int r,g,b;
char filename[255];
SDL_Surface *tmpimage,
*tmpimage1;
@ -190,7 +191,9 @@ gfx_loaddata ()
printf ("Can't load image: %s\n", SDL_GetError ());
exit (1);
}
SDL_SetColorKey (tmpimage, SDL_SRCCOLORKEY, SDL_MapRGB (tmpimage->format, 255, 255, 255));
if (i == 0)
getRGBpixel (tmpimage, 0, 0, &r, &g, &b);
SDL_SetColorKey (tmpimage, SDL_SRCCOLORKEY, SDL_MapRGB (tmpimage->format, r,g,b));
menu.images[i] = SDL_DisplayFormat (tmpimage);
SDL_FreeSurface (tmpimage);
}

Loading…
Cancel
Save