src/video/SDL_blit_N.c
changeset 1543 98f9b16f565c
parent 1487 dc6b59e925a2
child 1544 ab1e4c41ab71
     1.1 --- a/src/video/SDL_blit_N.c	Wed Mar 15 15:39:29 2006 +0000
     1.2 +++ b/src/video/SDL_blit_N.c	Wed Mar 15 15:43:15 2006 +0000
     1.3 @@ -2194,6 +2194,10 @@
     1.4  	int srcbpp = srcfmt->BytesPerPixel;
     1.5  	int dstbpp = dstfmt->BytesPerPixel;
     1.6  	unsigned alpha = dstfmt->Amask ? srcfmt->alpha : 0;
     1.7 +	Uint32 rgbmask = ~srcfmt->Amask;
     1.8 +
     1.9 +	/* Set up some basic variables */
    1.10 +	ckey &= rgbmask;
    1.11  
    1.12  	while ( height-- ) {
    1.13  		DUFFS_LOOP(
    1.14 @@ -2203,7 +2207,7 @@
    1.15  			unsigned sG;
    1.16  			unsigned sB;
    1.17  			RETRIEVE_RGB_PIXEL(src, srcbpp, Pixel);
    1.18 -			if ( Pixel != ckey ) {
    1.19 +			if ( (Pixel & rgbmask) != ckey ) {
    1.20  			        RGB_FROM_PIXEL(Pixel, srcfmt, sR, sG, sB);
    1.21  				ASSEMBLE_RGBA(dst, dstbpp, dstfmt,
    1.22  					      sR, sG, sB, alpha);