SDL 2.0 supports 32-bit icons with alpha. :)
This commit is contained in:
parent
a58d4e8d1a
commit
bc8faecadd
1 changed files with 3 additions and 7 deletions
|
@ -546,15 +546,11 @@ LoadIcon(const char *file)
|
|||
return (NULL);
|
||||
}
|
||||
|
||||
if (icon->format->palette == NULL) {
|
||||
fprintf(stderr, "Icon must have a palette!\n");
|
||||
SDL_FreeSurface(icon);
|
||||
return (NULL);
|
||||
if (icon->format->palette) {
|
||||
/* Set the colorkey */
|
||||
SDL_SetColorKey(icon, 1, *((Uint8 *) icon->pixels));
|
||||
}
|
||||
|
||||
/* Set the colorkey */
|
||||
SDL_SetColorKey(icon, 1, *((Uint8 *) icon->pixels));
|
||||
|
||||
return (icon);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue