src/video/SDL_surface.c
changeset 2787 93764fe8601a
parent 2786 6bacfecbf27e
child 2807 365fe1a2aad5
equal deleted inserted replaced
2786:6bacfecbf27e 2787:93764fe8601a
   268 
   268 
   269     return 0;
   269     return 0;
   270 }
   270 }
   271 
   271 
   272 /* This is a fairly slow function to switch from colorkey to alpha */
   272 /* This is a fairly slow function to switch from colorkey to alpha */
   273 void
   273 static void
   274 SDL_ConvertColorkeyToAlpha(SDL_Surface * surface)
   274 SDL_ConvertColorkeyToAlpha(SDL_Surface * surface)
   275 {
   275 {
   276     int x, y;
   276     int x, y;
   277 
   277 
   278     if (!surface) {
   278     if (!surface) {
   811 
   811 
   812         SDL_GetRGBA(surface->map->info.colorkey, surface->format, &keyR,
   812         SDL_GetRGBA(surface->map->info.colorkey, surface->format, &keyR,
   813                     &keyG, &keyB, &keyA);
   813                     &keyG, &keyB, &keyA);
   814         SDL_SetColorKey(convert, 1,
   814         SDL_SetColorKey(convert, 1,
   815                         SDL_MapRGBA(convert->format, keyR, keyG, keyB, keyA));
   815                         SDL_MapRGBA(convert->format, keyR, keyG, keyB, keyA));
       
   816         SDL_ConvertColorkeyToAlpha(convert);
   816     }
   817     }
   817     convert->map->info.r = surface->map->info.r;
   818     convert->map->info.r = surface->map->info.r;
   818     convert->map->info.g = surface->map->info.g;
   819     convert->map->info.g = surface->map->info.g;
   819     convert->map->info.b = surface->map->info.b;
   820     convert->map->info.b = surface->map->info.b;
   820     convert->map->info.a = surface->map->info.a;
   821     convert->map->info.a = surface->map->info.a;