test/testgamecontroller.c
changeset 8687 1d2ca48523a7
parent 8202 b84a1f55075e
child 9102 a22458d5eed9
     1.1 --- a/test/testgamecontroller.c	Sat Mar 29 12:27:02 2014 -0700
     1.2 +++ b/test/testgamecontroller.c	Sat Mar 29 12:27:27 2014 -0700
     1.3 @@ -85,9 +85,13 @@
     1.4      } else {
     1.5          /* Set transparent pixel as the pixel at (0,0) */
     1.6          if (transparent) {
     1.7 -            SDL_assert(!temp->format->palette);
     1.8 -            SDL_assert(temp->format->BitsPerPixel == 24);
     1.9 -            SDL_SetColorKey(temp, SDL_TRUE, (*(Uint32 *) temp->pixels) & 0x00FFFFFF);
    1.10 +            if (temp->format->BytesPerPixel == 1) {
    1.11 +                SDL_SetColorKey(temp, SDL_TRUE, *(Uint8 *)temp->pixels);
    1.12 +            } else {
    1.13 +                SDL_assert(!temp->format->palette);
    1.14 +                SDL_assert(temp->format->BitsPerPixel == 24);
    1.15 +                SDL_SetColorKey(temp, SDL_TRUE, (*(Uint32 *)temp->pixels) & 0x00FFFFFF);
    1.16 +            }
    1.17          }
    1.18  
    1.19          texture = SDL_CreateTextureFromSurface(renderer, temp);