Apple's ImageIO framework doesn't properly load alpha for 32-bit BMP files.
authorSam Lantinga <slouken@libsdl.org>
Tue, 25 Sep 2012 20:41:49 -0700
changeset 3325a8a45cd54c9
parent 331 88a0132cfe65
child 333 b446404b2d2b
Apple's ImageIO framework doesn't properly load alpha for 32-bit BMP files.
IMG_ImageIO.m
IMG_bmp.c
     1.1 --- a/IMG_ImageIO.m	Tue Sep 04 23:17:41 2012 -0700
     1.2 +++ b/IMG_ImageIO.m	Tue Sep 25 20:41:49 2012 -0700
     1.3 @@ -571,6 +571,8 @@
     1.4          return Internal_isType_ImageIO(rw_ops, uti_string_to_test);
     1.5  }
     1.6  
     1.7 +#ifdef BMP_USES_IMAGEIO
     1.8 +
     1.9  int IMG_isCUR(SDL_RWops *src)
    1.10  {
    1.11      /* FIXME: Is this a supported type? */
    1.12 @@ -587,6 +589,8 @@
    1.13      return Internal_isType(src, kUTTypeBMP);
    1.14  }
    1.15  
    1.16 +#endif /* BMP_USES_IMAGEIO */
    1.17 +
    1.18  int IMG_isGIF(SDL_RWops *src)
    1.19  {
    1.20      return Internal_isType(src, kUTTypeGIF);
    1.21 @@ -725,6 +729,8 @@
    1.22          return LoadImageFromFile_ImageIO(file);
    1.23  }
    1.24  
    1.25 +#ifdef BMP_USES_IMAGEIO
    1.26 +
    1.27  SDL_Surface* IMG_LoadCUR_RW (SDL_RWops *src)
    1.28  {
    1.29      /* FIXME: Is this a supported type? */
    1.30 @@ -741,6 +747,8 @@
    1.31      return LoadImageFromRWops(src, kUTTypeBMP);
    1.32  }
    1.33  
    1.34 +#endif /* BMP_USES_IMAGEIO */
    1.35 +
    1.36  SDL_Surface* IMG_LoadGIF_RW (SDL_RWops *src)
    1.37  {
    1.38      return LoadImageFromRWops (src, kUTTypeGIF);
     2.1 --- a/IMG_bmp.c	Tue Sep 04 23:17:41 2012 -0700
     2.2 +++ b/IMG_bmp.c	Tue Sep 25 20:41:49 2012 -0700
     2.3 @@ -19,7 +19,7 @@
     2.4    3. This notice may not be removed or altered from any source distribution.
     2.5  */
     2.6  
     2.7 -#if !defined(__APPLE__) || defined(SDL_IMAGE_USE_COMMON_BACKEND)
     2.8 +#if (!defined(__APPLE__) || defined(SDL_IMAGE_USE_COMMON_BACKEND)) || !defined(BMP_USES_IMAGEIO)
     2.9  
    2.10  /* This is a BMP image file loading framework */
    2.11  /* ICO/CUR file support is here as well since it uses similar internal