SDL 2.0 supports 32-bit icons with alpha. :)
authorSam Lantinga
Fri, 28 Sep 2012 15:59:36 -0700
changeset 6509e94d5a5376c1
parent 6508 81a3d541d9a2
child 6510 32432af683cf
SDL 2.0 supports 32-bit icons with alpha. :)
test/common.c
     1.1 --- a/test/common.c	Fri Sep 28 14:42:47 2012 -0700
     1.2 +++ b/test/common.c	Fri Sep 28 15:59:36 2012 -0700
     1.3 @@ -546,15 +546,11 @@
     1.4          return (NULL);
     1.5      }
     1.6  
     1.7 -    if (icon->format->palette == NULL) {
     1.8 -        fprintf(stderr, "Icon must have a palette!\n");
     1.9 -        SDL_FreeSurface(icon);
    1.10 -        return (NULL);
    1.11 +    if (icon->format->palette) {
    1.12 +        /* Set the colorkey */
    1.13 +        SDL_SetColorKey(icon, 1, *((Uint8 *) icon->pixels));
    1.14      }
    1.15  
    1.16 -    /* Set the colorkey */
    1.17 -    SDL_SetColorKey(icon, 1, *((Uint8 *) icon->pixels));
    1.18 -
    1.19      return (icon);
    1.20  }
    1.21