comparison src/video/SDL_surface.c @ 3103:7be21a78777e

Added SDL_GetColorKey()
author Sam Lantinga <slouken@libsdl.org>
date Fri, 03 Apr 2009 13:27:33 +0000
parents 8cc00819c8d6
children 147d6ef5be03
comparison
equal deleted inserted replaced
3102:73fe1f73a56f 3103:7be21a78777e
270 } 270 }
271 271
272 return 0; 272 return 0;
273 } 273 }
274 274
275 int
276 SDL_GetColorKey(SDL_Surface * surface, Uint32 * key)
277 {
278 if (!surface) {
279 return -1;
280 }
281
282 if (!(surface->map->info.flags & SDL_COPY_COLORKEY)) {
283 return -1;
284 }
285
286 if (key) {
287 *key = surface->map->info.colorkey;
288 }
289 return 0;
290 }
291
275 /* This is a fairly slow function to switch from colorkey to alpha */ 292 /* This is a fairly slow function to switch from colorkey to alpha */
276 static void 293 static void
277 SDL_ConvertColorkeyToAlpha(SDL_Surface * surface) 294 SDL_ConvertColorkeyToAlpha(SDL_Surface * surface)
278 { 295 {
279 int x, y; 296 int x, y;