From 7c048bf1e6876e1e1ebd1e605037bd5f9eeb1990 Mon Sep 17 00:00:00 2001 From: stpohle Date: Wed, 31 Dec 2003 01:00:11 +0000 Subject: [PATCH] read at the first menu border image the top left pixel to set as transparent for the image. --- src/gfx.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/gfx.c b/src/gfx.c index 4a8e636..94465eb 100644 --- a/src/gfx.c +++ b/src/gfx.c @@ -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); }