src/video/SDL_bmp.c
changeset 2967 e4a469d6ddab
parent 2920 cdb01906cb7e
child 2969 1ee69e7e7cea
     1.1 --- a/src/video/SDL_bmp.c	Fri Jan 02 16:38:31 2009 +0000
     1.2 +++ b/src/video/SDL_bmp.c	Fri Jan 02 17:39:48 2009 +0000
     1.3 @@ -397,22 +397,19 @@
     1.4              ) {
     1.5              surface = saveme;
     1.6          } else {
     1.7 -            SDL_PixelFormat *format;
     1.8 +            SDL_PixelFormat format;
     1.9  
    1.10              /* Convert to 24 bits per pixel */
    1.11 -            format = SDL_AllocFormat(24,
    1.12 +            SDL_InitFormat(&format, 24,
    1.13  #if SDL_BYTEORDER == SDL_LIL_ENDIAN
    1.14 -                                     0x00FF0000, 0x0000FF00, 0x000000FF,
    1.15 +                           0x00FF0000, 0x0000FF00, 0x000000FF,
    1.16  #else
    1.17 -                                     0x000000FF, 0x0000FF00, 0x00FF0000,
    1.18 +                           0x000000FF, 0x0000FF00, 0x00FF0000,
    1.19  #endif
    1.20 -                                     0);
    1.21 -            if (format != NULL) {
    1.22 -                surface = SDL_ConvertSurface(saveme, format, 0);
    1.23 -                if (!surface) {
    1.24 -                    SDL_SetError("Couldn't convert image to 24 bpp");
    1.25 -                }
    1.26 -                SDL_FreeFormat(format);
    1.27 +                           0);
    1.28 +            surface = SDL_ConvertSurface(saveme, &format, 0);
    1.29 +            if (!surface) {
    1.30 +                SDL_SetError("Couldn't convert image to 24 bpp");
    1.31              }
    1.32          }
    1.33      }