# HG changeset patch # User Mike Gorchak # Date 1244613259 0 # Node ID d1436442215f521adc9e11cdfb078db9ba168f68 # Parent 9f82979eaaf0c802174e74a551e2d16a0042f0b9 Support for 15/16/24/32 bpps of icon.bmp has been added, in case if not an original icon.bmp (8bpp with palette) is used for tests. diff -r 9f82979eaaf0 -r d1436442215f test/testsprite2.c --- a/test/testsprite2.c Wed Jun 10 05:51:44 2009 +0000 +++ b/test/testsprite2.c Wed Jun 10 05:54:19 2009 +0000 @@ -58,6 +58,21 @@ /* Set transparent pixel as the pixel at (0,0) */ if (temp->format->palette) { SDL_SetColorKey(temp, SDL_SRCCOLORKEY, *(Uint8 *) temp->pixels); + } else { + switch (temp->format->BitsPerPixel) { + case 15: + SDL_SetColorKey(temp, SDL_SRCCOLORKEY, (*(Uint16 *) temp->pixels) & 0x00007FFF); + break; + case 16: + SDL_SetColorKey(temp, SDL_SRCCOLORKEY, *(Uint16 *) temp->pixels); + break; + case 24: + SDL_SetColorKey(temp, SDL_SRCCOLORKEY, (*(Uint32 *) temp->pixels) & 0x00FFFFFF); + break; + case 32: + SDL_SetColorKey(temp, SDL_SRCCOLORKEY, *(Uint32 *) temp->pixels); + break; + } } /* Create textures from the image */