Skip to content

Commit

Permalink
Fixed bug 2578 - No transparency in XPM files
Browse files Browse the repository at this point in the history
beuc

SDL_image 1.2.12 loads the attached XPM file with transparency.

SDL_image 2.0.0 now uses a white background instead.
  • Loading branch information
slouken committed Jun 16, 2014
1 parent f407342 commit 666b13c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions IMG_xpm.c
Expand Up @@ -178,7 +178,7 @@ static int color_to_rgb(char *spec, int speclen, Uint32 *rgb)
{
/* poor man's rgb.txt */
static struct { char *name; Uint32 rgb; } known[] = {
{ "none", 0xFFFFFF },
{ "none", 0xFFFFFFFF },
{ "black", 0x000000 },
{ "white", 0xFFFFFF },
{ "red", 0xFF0000 },
Expand Down Expand Up @@ -892,11 +892,12 @@ static int color_to_rgb(char *spec, int speclen, Uint32 *rgb)
return 1;
} else {
int i;
for (i = 0; i < SDL_arraysize(known); i++)
for (i = 0; i < SDL_arraysize(known); i++) {
if (SDL_strncasecmp(known[i].name, spec, speclen) == 0) {
*rgb = known[i].rgb;
return 1;
}
}
return 0;
}
}
Expand Down

0 comments on commit 666b13c

Please sign in to comment.