From 5bbb77f636dd09b4e3665160bae9fc390c9aae9c Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Fri, 28 Sep 2012 15:59:36 -0700 Subject: [PATCH] SDL 2.0 supports 32-bit icons with alpha. :) --- test/common.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/test/common.c b/test/common.c index 311b93dd0..0d8f98fc9 100644 --- a/test/common.c +++ b/test/common.c @@ -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); }