Oops, back it out...
authorSam Lantinga <slouken@lokigames.com>
Thu, 07 Jun 2001 15:04:04 +0000
changeset 50 eda2f15ffb70
parent 49 6f3c474f9abd
child 51 fba28d77901f
Oops, back it out...
src/video/SDL_pixels.c
--- a/src/video/SDL_pixels.c	Thu Jun 07 14:57:07 2001 +0000
+++ b/src/video/SDL_pixels.c	Thu Jun 07 15:04:04 2001 +0000
@@ -464,6 +464,7 @@
 	Uint8 *map;
 	int i;
 	int  bpp;
+	unsigned alpha;
 
 	bpp = ((dst->BytesPerPixel == 3) ? 4 : dst->BytesPerPixel);
 	map = (Uint8 *)malloc(src->ncolors*bpp);
@@ -472,11 +473,12 @@
 		return(NULL);
 	}
 
+	alpha = dst->Amask ? SDL_ALPHA_OPAQUE : 0;
 	/* We memory copy to the pixel map so the endianness is preserved */
 	for ( i=0; i<src->ncolors; ++i ) {
 		ASSEMBLE_RGBA(&map[i*bpp], dst->BytesPerPixel, dst,
 			      src->colors[i].r, src->colors[i].g,
-			      src->colors[i].b, SDL_ALPHA_OPAQUE);
+			      src->colors[i].b, alpha);
 	}
 	return(map);
 }