comparison src/video/SDL_blit_1.c @ 2257:340942cfda48

Moved the colorkey and per-surface alpha into the blit info, in preparation for support for general color channel modulation. Removed and consolidated some data in the blit info.
author Sam Lantinga <slouken@libsdl.org>
date Fri, 17 Aug 2007 00:54:53 +0000
parents c121d94672cb
children bee005ace1bf
comparison
equal deleted inserted replaced
2256:e893d24ad8db 2257:340942cfda48
288 Uint8 *src = info->s_pixels; 288 Uint8 *src = info->s_pixels;
289 int srcskip = info->s_skip; 289 int srcskip = info->s_skip;
290 Uint8 *dst = info->d_pixels; 290 Uint8 *dst = info->d_pixels;
291 int dstskip = info->d_skip; 291 int dstskip = info->d_skip;
292 Uint8 *palmap = info->table; 292 Uint8 *palmap = info->table;
293 Uint32 ckey = info->src->colorkey; 293 Uint32 ckey = info->ckey;
294 294
295 if (palmap) { 295 if (palmap) {
296 while (height--) { 296 while (height--) {
297 /* *INDENT-OFF* */ 297 /* *INDENT-OFF* */
298 DUFFS_LOOP( 298 DUFFS_LOOP(
335 Uint8 *src = info->s_pixels; 335 Uint8 *src = info->s_pixels;
336 int srcskip = info->s_skip; 336 int srcskip = info->s_skip;
337 Uint16 *dstp = (Uint16 *) info->d_pixels; 337 Uint16 *dstp = (Uint16 *) info->d_pixels;
338 int dstskip = info->d_skip; 338 int dstskip = info->d_skip;
339 Uint16 *palmap = (Uint16 *) info->table; 339 Uint16 *palmap = (Uint16 *) info->table;
340 Uint32 ckey = info->src->colorkey; 340 Uint32 ckey = info->ckey;
341 341
342 /* Set up some basic variables */ 342 /* Set up some basic variables */
343 dstskip /= 2; 343 dstskip /= 2;
344 344
345 while (height--) { 345 while (height--) {
367 Uint8 *src = info->s_pixels; 367 Uint8 *src = info->s_pixels;
368 int srcskip = info->s_skip; 368 int srcskip = info->s_skip;
369 Uint8 *dst = info->d_pixels; 369 Uint8 *dst = info->d_pixels;
370 int dstskip = info->d_skip; 370 int dstskip = info->d_skip;
371 Uint8 *palmap = info->table; 371 Uint8 *palmap = info->table;
372 Uint32 ckey = info->src->colorkey; 372 Uint32 ckey = info->ckey;
373 int o; 373 int o;
374 374
375 while (height--) { 375 while (height--) {
376 /* *INDENT-OFF* */ 376 /* *INDENT-OFF* */
377 DUFFS_LOOP( 377 DUFFS_LOOP(
400 Uint8 *src = info->s_pixels; 400 Uint8 *src = info->s_pixels;
401 int srcskip = info->s_skip; 401 int srcskip = info->s_skip;
402 Uint32 *dstp = (Uint32 *) info->d_pixels; 402 Uint32 *dstp = (Uint32 *) info->d_pixels;
403 int dstskip = info->d_skip; 403 int dstskip = info->d_skip;
404 Uint32 *palmap = (Uint32 *) info->table; 404 Uint32 *palmap = (Uint32 *) info->table;
405 Uint32 ckey = info->src->colorkey; 405 Uint32 ckey = info->ckey;
406 406
407 /* Set up some basic variables */ 407 /* Set up some basic variables */
408 dstskip /= 4; 408 dstskip /= 4;
409 409
410 while (height--) { 410 while (height--) {
434 Uint8 *dst = info->d_pixels; 434 Uint8 *dst = info->d_pixels;
435 int dstskip = info->d_skip; 435 int dstskip = info->d_skip;
436 SDL_PixelFormat *dstfmt = info->dst; 436 SDL_PixelFormat *dstfmt = info->dst;
437 const SDL_Color *srcpal = info->src->palette->colors; 437 const SDL_Color *srcpal = info->src->palette->colors;
438 int dstbpp; 438 int dstbpp;
439 const int A = info->src->alpha; 439 const int A = (info->cmod >> 24);
440 440
441 /* Set up some basic variables */ 441 /* Set up some basic variables */
442 dstbpp = dstfmt->BytesPerPixel; 442 dstbpp = dstfmt->BytesPerPixel;
443 443
444 while (height--) { 444 while (height--) {
475 Uint8 *dst = info->d_pixels; 475 Uint8 *dst = info->d_pixels;
476 int dstskip = info->d_skip; 476 int dstskip = info->d_skip;
477 SDL_PixelFormat *srcfmt = info->src; 477 SDL_PixelFormat *srcfmt = info->src;
478 SDL_PixelFormat *dstfmt = info->dst; 478 SDL_PixelFormat *dstfmt = info->dst;
479 const SDL_Color *srcpal = info->src->palette->colors; 479 const SDL_Color *srcpal = info->src->palette->colors;
480 Uint32 ckey = srcfmt->colorkey; 480 Uint32 ckey = info->ckey;
481 int dstbpp; 481 int dstbpp;
482 const int A = srcfmt->alpha; 482 const int A = (info->cmod >> 24);
483 483
484 /* Set up some basic variables */ 484 /* Set up some basic variables */
485 dstbpp = dstfmt->BytesPerPixel; 485 dstbpp = dstfmt->BytesPerPixel;
486 486
487 while (height--) { 487 while (height--) {