comparison src/video/SDL_blit_N.c @ 1985:8055185ae4ed

Added source color and alpha modulation support. Added perl script to generate optimized render copy functions.
author Sam Lantinga <slouken@libsdl.org>
date Mon, 28 Aug 2006 03:17:39 +0000
parents c121d94672cb
children 93994f65c74c
comparison
equal deleted inserted replaced
1984:b910bcabec26 1985:8055185ae4ed
2106 2106
2107 while (height--) { 2107 while (height--) {
2108 /* *INDENT-OFF* */ 2108 /* *INDENT-OFF* */
2109 DUFFS_LOOP( 2109 DUFFS_LOOP(
2110 { 2110 {
2111 Uint32 Pixel; 2111 Uint32 Pixel;
2112 unsigned sR; 2112 unsigned sR;
2113 unsigned sG; 2113 unsigned sG;
2114 unsigned sB; 2114 unsigned sB;
2115 DISEMBLE_RGB(src, srcbpp, srcfmt, Pixel, sR, sG, sB); 2115 DISEMBLE_RGB(src, srcbpp, srcfmt, Pixel, sR, sG, sB);
2116 ASSEMBLE_RGBA(dst, dstbpp, dstfmt, sR, sG, sB, alpha); 2116 ASSEMBLE_RGBA(dst, dstbpp, dstfmt, sR, sG, sB, alpha);
2276 2276
2277 while (height--) { 2277 while (height--) {
2278 /* *INDENT-OFF* */ 2278 /* *INDENT-OFF* */
2279 DUFFS_LOOP( 2279 DUFFS_LOOP(
2280 { 2280 {
2281 Uint32 Pixel; 2281 Uint32 Pixel;
2282 unsigned sR; 2282 unsigned sR;
2283 unsigned sG; 2283 unsigned sG;
2284 unsigned sB; 2284 unsigned sB;
2285 RETRIEVE_RGB_PIXEL(src, srcbpp, Pixel); 2285 RETRIEVE_RGB_PIXEL(src, srcbpp, Pixel);
2286 if ( (Pixel & rgbmask) != ckey ) { 2286 if ( (Pixel & rgbmask) != ckey ) {
2287 RGB_FROM_PIXEL(Pixel, srcfmt, sR, sG, sB); 2287 RGB_FROM_PIXEL(Pixel, srcfmt, sR, sG, sB);
2288 ASSEMBLE_RGBA(dst, dstbpp, dstfmt, 2288 ASSEMBLE_RGBA(dst, dstbpp, dstfmt, sR, sG, sB, alpha);
2289 sR, sG, sB, alpha);
2290 } 2289 }
2291 dst += dstbpp; 2290 dst += dstbpp;
2292 src += srcbpp; 2291 src += srcbpp;
2293 }, 2292 },
2294 width); 2293 width);
2325 /* FIXME: should map alpha to [0..255] correctly! */ 2324 /* FIXME: should map alpha to [0..255] correctly! */
2326 while (height--) { 2325 while (height--) {
2327 /* *INDENT-OFF* */ 2326 /* *INDENT-OFF* */
2328 DUFFS_LOOP( 2327 DUFFS_LOOP(
2329 { 2328 {
2330 DISEMBLE_RGBA(src, srcbpp, srcfmt, Pixel, 2329 DISEMBLE_RGBA(src, srcbpp, srcfmt, Pixel, sR, sG, sB, sA);
2331 sR, sG, sB, sA);
2332 if ( (Pixel & rgbmask) != ckey ) { 2330 if ( (Pixel & rgbmask) != ckey ) {
2333 ASSEMBLE_RGBA(dst, dstbpp, dstfmt, 2331 ASSEMBLE_RGBA(dst, dstbpp, dstfmt, sR, sG, sB, sA);
2334 sR, sG, sB, sA);
2335 } 2332 }
2336 dst += dstbpp; 2333 dst += dstbpp;
2337 src += srcbpp; 2334 src += srcbpp;
2338 }, 2335 },
2339 width); 2336 width);