test/common.c
changeset 6509 e94d5a5376c1
parent 6508 81a3d541d9a2
child 6513 c781fb99ce39
equal deleted inserted replaced
6508:81a3d541d9a2 6509:e94d5a5376c1
   544     if (icon == NULL) {
   544     if (icon == NULL) {
   545         fprintf(stderr, "Couldn't load %s: %s\n", file, SDL_GetError());
   545         fprintf(stderr, "Couldn't load %s: %s\n", file, SDL_GetError());
   546         return (NULL);
   546         return (NULL);
   547     }
   547     }
   548 
   548 
   549     if (icon->format->palette == NULL) {
   549     if (icon->format->palette) {
   550         fprintf(stderr, "Icon must have a palette!\n");
   550         /* Set the colorkey */
   551         SDL_FreeSurface(icon);
   551         SDL_SetColorKey(icon, 1, *((Uint8 *) icon->pixels));
   552         return (NULL);
   552     }
   553     }
       
   554 
       
   555     /* Set the colorkey */
       
   556     SDL_SetColorKey(icon, 1, *((Uint8 *) icon->pixels));
       
   557 
   553 
   558     return (icon);
   554     return (icon);
   559 }
   555 }
   560 
   556 
   561 SDL_bool
   557 SDL_bool