src/video/SDL_surface.c
changeset 3103 7be21a78777e
parent 3013 8cc00819c8d6
child 3434 147d6ef5be03
     1.1 --- a/src/video/SDL_surface.c	Sat Mar 28 06:00:42 2009 +0000
     1.2 +++ b/src/video/SDL_surface.c	Fri Apr 03 13:27:33 2009 +0000
     1.3 @@ -272,6 +272,23 @@
     1.4      return 0;
     1.5  }
     1.6  
     1.7 +int
     1.8 +SDL_GetColorKey(SDL_Surface * surface, Uint32 * key)
     1.9 +{
    1.10 +    if (!surface) {
    1.11 +        return -1;
    1.12 +    }
    1.13 +
    1.14 +    if (!(surface->map->info.flags & SDL_COPY_COLORKEY)) {
    1.15 +        return -1;
    1.16 +    }
    1.17 +
    1.18 +    if (key) {
    1.19 +        *key = surface->map->info.colorkey;
    1.20 +    }
    1.21 +    return 0;
    1.22 +}
    1.23 +
    1.24  /* This is a fairly slow function to switch from colorkey to alpha */
    1.25  static void
    1.26  SDL_ConvertColorkeyToAlpha(SDL_Surface * surface)