Skip to content

Commit

Permalink
Apple's ImageIO framework doesn't properly load alpha for 32-bit BMP …
Browse files Browse the repository at this point in the history
…files.
  • Loading branch information
slouken committed Sep 26, 2012
1 parent 04028df commit 6e38937
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions IMG_ImageIO.m
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,8 @@ static int Internal_isType (SDL_RWops *rw_ops, CFStringRef uti_string_to_test)
return Internal_isType_ImageIO(rw_ops, uti_string_to_test);
}

#ifdef BMP_USES_IMAGEIO

int IMG_isCUR(SDL_RWops *src)
{
/* FIXME: Is this a supported type? */
Expand All @@ -587,6 +589,8 @@ int IMG_isBMP(SDL_RWops *src)
return Internal_isType(src, kUTTypeBMP);
}

#endif /* BMP_USES_IMAGEIO */

int IMG_isGIF(SDL_RWops *src)
{
return Internal_isType(src, kUTTypeGIF);
Expand Down Expand Up @@ -725,6 +729,8 @@ int IMG_isTIF(SDL_RWops *src)
return LoadImageFromFile_ImageIO(file);
}

#ifdef BMP_USES_IMAGEIO

SDL_Surface* IMG_LoadCUR_RW (SDL_RWops *src)
{
/* FIXME: Is this a supported type? */
Expand All @@ -741,6 +747,8 @@ int IMG_isTIF(SDL_RWops *src)
return LoadImageFromRWops(src, kUTTypeBMP);
}

#endif /* BMP_USES_IMAGEIO */

SDL_Surface* IMG_LoadGIF_RW (SDL_RWops *src)
{
return LoadImageFromRWops (src, kUTTypeGIF);
Expand Down
2 changes: 1 addition & 1 deletion IMG_bmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
3. This notice may not be removed or altered from any source distribution.
*/

#if !defined(__APPLE__) || defined(SDL_IMAGE_USE_COMMON_BACKEND)
#if (!defined(__APPLE__) || defined(SDL_IMAGE_USE_COMMON_BACKEND)) || !defined(BMP_USES_IMAGEIO)

/* This is a BMP image file loading framework */
/* ICO/CUR file support is here as well since it uses similar internal
Expand Down

0 comments on commit 6e38937

Please sign in to comment.