Skip to content

Commit

Permalink
Gautier Portet - Fri, 19 Mar 2004 17:35:12 +0100
Browse files Browse the repository at this point in the history
 * Added support for 32-bit BMP files with alpha
  • Loading branch information
slouken committed Dec 24, 2004
1 parent 0a78919 commit 78a1486
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 7 deletions.
4 changes: 4 additions & 0 deletions CHANGES
@@ -1,3 +1,7 @@
1.2.5:
Gautier Portet - Fri, 19 Mar 2004 17:35:12 +0100
* Added support for 32-bit BMP files with alpha

1.2.4:
Pierre G. Richard - Fri, 30 Jul 2004 11:13:11 +0000 (UTC)
* Added support for RLE encoded BMP files
Expand Down
13 changes: 10 additions & 3 deletions IMG_bmp.c
Expand Up @@ -148,6 +148,7 @@ static SDL_Surface *LoadBMP_RW (SDL_RWops *src, int freesrc)
Uint32 Rmask;
Uint32 Gmask;
Uint32 Bmask;
Uint32 Amask;
SDL_Palette *palette;
Uint8 *bits;
int ExpandBMP;
Expand Down Expand Up @@ -243,7 +244,7 @@ static SDL_Surface *LoadBMP_RW (SDL_RWops *src, int freesrc)
}

/* RLE4 and RLE8 BMP compression is supported */
Rmask = Gmask = Bmask = 0;
Rmask = Gmask = Bmask = Amask = 0;
switch (biCompression) {
case BI_RGB:
/* If there are no masks, use the defaults */
Expand All @@ -261,9 +262,14 @@ static SDL_Surface *LoadBMP_RW (SDL_RWops *src, int freesrc)
Rmask = 0x000000FF;
Gmask = 0x0000FF00;
Bmask = 0x00FF0000;
break;
#else
Rmask = 0x00FF0000;
Gmask = 0x0000FF00;
Bmask = 0x000000FF;
#endif
break;
case 32:
Amask = 0xFF000000;
Rmask = 0x00FF0000;
Gmask = 0x0000FF00;
Bmask = 0x000000FF;
Expand All @@ -283,6 +289,7 @@ static SDL_Surface *LoadBMP_RW (SDL_RWops *src, int freesrc)
Rmask = SDL_ReadLE32(src);
Gmask = SDL_ReadLE32(src);
Bmask = SDL_ReadLE32(src);
Amask = SDL_ReadLE32(src);
break;
default:
break;
Expand All @@ -292,7 +299,7 @@ static SDL_Surface *LoadBMP_RW (SDL_RWops *src, int freesrc)

/* Create a compatible surface, note that the colors are RGB ordered */
surface = SDL_CreateRGBSurface(SDL_SWSURFACE,
biWidth, biHeight, biBitCount, Rmask, Gmask, Bmask, 0);
biWidth, biHeight, biBitCount, Rmask, Gmask, Bmask, Amask);
if ( surface == NULL ) {
was_error = 1;
goto done;
Expand Down
2 changes: 1 addition & 1 deletion SDL_image.h
Expand Up @@ -40,7 +40,7 @@ extern "C" {
*/
#define SDL_IMAGE_MAJOR_VERSION 1
#define SDL_IMAGE_MINOR_VERSION 2
#define SDL_IMAGE_PATCHLEVEL 4
#define SDL_IMAGE_PATCHLEVEL 5

/* This macro can be used to fill a version structure with the compile-time
* version of the SDL_image library.
Expand Down
6 changes: 3 additions & 3 deletions configure.in
Expand Up @@ -13,9 +13,9 @@ dnl Set various version strings - taken gratefully from the GTk sources

MAJOR_VERSION=1
MINOR_VERSION=2
MICRO_VERSION=4
INTERFACE_AGE=3
BINARY_AGE=4
MICRO_VERSION=5
INTERFACE_AGE=4
BINARY_AGE=5
VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION

AC_SUBST(MAJOR_VERSION)
Expand Down

0 comments on commit 78a1486

Please sign in to comment.