src/video/SDL_blit_N.c
changeset 1543 98f9b16f565c
parent 1487 dc6b59e925a2
child 1544 ab1e4c41ab71
equal deleted inserted replaced
1542:a8bf1aa21020 1543:98f9b16f565c
  2192 	SDL_PixelFormat *srcfmt = info->src;
  2192 	SDL_PixelFormat *srcfmt = info->src;
  2193 	SDL_PixelFormat *dstfmt = info->dst;
  2193 	SDL_PixelFormat *dstfmt = info->dst;
  2194 	int srcbpp = srcfmt->BytesPerPixel;
  2194 	int srcbpp = srcfmt->BytesPerPixel;
  2195 	int dstbpp = dstfmt->BytesPerPixel;
  2195 	int dstbpp = dstfmt->BytesPerPixel;
  2196 	unsigned alpha = dstfmt->Amask ? srcfmt->alpha : 0;
  2196 	unsigned alpha = dstfmt->Amask ? srcfmt->alpha : 0;
       
  2197 	Uint32 rgbmask = ~srcfmt->Amask;
       
  2198 
       
  2199 	/* Set up some basic variables */
       
  2200 	ckey &= rgbmask;
  2197 
  2201 
  2198 	while ( height-- ) {
  2202 	while ( height-- ) {
  2199 		DUFFS_LOOP(
  2203 		DUFFS_LOOP(
  2200 		{
  2204 		{
  2201 		        Uint32 Pixel;
  2205 		        Uint32 Pixel;
  2202 			unsigned sR;
  2206 			unsigned sR;
  2203 			unsigned sG;
  2207 			unsigned sG;
  2204 			unsigned sB;
  2208 			unsigned sB;
  2205 			RETRIEVE_RGB_PIXEL(src, srcbpp, Pixel);
  2209 			RETRIEVE_RGB_PIXEL(src, srcbpp, Pixel);
  2206 			if ( Pixel != ckey ) {
  2210 			if ( (Pixel & rgbmask) != ckey ) {
  2207 			        RGB_FROM_PIXEL(Pixel, srcfmt, sR, sG, sB);
  2211 			        RGB_FROM_PIXEL(Pixel, srcfmt, sR, sG, sB);
  2208 				ASSEMBLE_RGBA(dst, dstbpp, dstfmt,
  2212 				ASSEMBLE_RGBA(dst, dstbpp, dstfmt,
  2209 					      sR, sG, sB, alpha);
  2213 					      sR, sG, sB, alpha);
  2210 			}
  2214 			}
  2211 			dst += dstbpp;
  2215 			dst += dstbpp;