SDL 2.0 supports 32-bit icons with alpha. :)

This commit is contained in:
Sam Lantinga 2012-09-28 15:59:36 -07:00
parent a58d4e8d1a
commit bc8faecadd

View file

@ -546,15 +546,11 @@ LoadIcon(const char *file)
return (NULL); return (NULL);
} }
if (icon->format->palette == NULL) { if (icon->format->palette) {
fprintf(stderr, "Icon must have a palette!\n"); /* Set the colorkey */
SDL_FreeSurface(icon); SDL_SetColorKey(icon, 1, *((Uint8 *) icon->pixels));
return (NULL);
} }
/* Set the colorkey */
SDL_SetColorKey(icon, 1, *((Uint8 *) icon->pixels));
return (icon); return (icon);
} }