comparison src/video/SDL_bmp.c @ 2967:e4a469d6ddab

Implemented SDL_SetWindowIcon(), with translucent icon support under X11.
author Sam Lantinga <slouken@libsdl.org>
date Fri, 02 Jan 2009 17:39:48 +0000
parents cdb01906cb7e
children 1ee69e7e7cea
comparison
equal deleted inserted replaced
2966:c1e3621ba959 2967:e4a469d6ddab
395 (saveme->format->Bmask == 0x00FF0000) 395 (saveme->format->Bmask == 0x00FF0000)
396 #endif 396 #endif
397 ) { 397 ) {
398 surface = saveme; 398 surface = saveme;
399 } else { 399 } else {
400 SDL_PixelFormat *format; 400 SDL_PixelFormat format;
401 401
402 /* Convert to 24 bits per pixel */ 402 /* Convert to 24 bits per pixel */
403 format = SDL_AllocFormat(24, 403 SDL_InitFormat(&format, 24,
404 #if SDL_BYTEORDER == SDL_LIL_ENDIAN 404 #if SDL_BYTEORDER == SDL_LIL_ENDIAN
405 0x00FF0000, 0x0000FF00, 0x000000FF, 405 0x00FF0000, 0x0000FF00, 0x000000FF,
406 #else 406 #else
407 0x000000FF, 0x0000FF00, 0x00FF0000, 407 0x000000FF, 0x0000FF00, 0x00FF0000,
408 #endif 408 #endif
409 0); 409 0);
410 if (format != NULL) { 410 surface = SDL_ConvertSurface(saveme, &format, 0);
411 surface = SDL_ConvertSurface(saveme, format, 0); 411 if (!surface) {
412 if (!surface) { 412 SDL_SetError("Couldn't convert image to 24 bpp");
413 SDL_SetError("Couldn't convert image to 24 bpp");
414 }
415 SDL_FreeFormat(format);
416 } 413 }
417 } 414 }
418 } 415 }
419 416
420 if (surface && (SDL_LockSurface(surface) == 0)) { 417 if (surface && (SDL_LockSurface(surface) == 0)) {