Navigation Menu

Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
SDL 2.0 supports 32-bit icons with alpha. :)
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Sep 28, 2012
1 parent f6ba100 commit 5bbb77f
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions test/common.c
Expand Up @@ -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);
}

Expand Down

0 comments on commit 5bbb77f

Please sign in to comment.