comparison src/video/SDL_blit_N.c @ 1339:62802d9d7c87

*** empty log message ***
author Sam Lantinga <slouken@libsdl.org>
date Tue, 07 Feb 2006 10:40:14 +0000
parents 604d73db6802
children c71e05b4dc2e
comparison
equal deleted inserted replaced
1338:604d73db6802 1339:62802d9d7c87
19 Sam Lantinga 19 Sam Lantinga
20 slouken@libsdl.org 20 slouken@libsdl.org
21 */ 21 */
22 22
23 #include "SDL_types.h" 23 #include "SDL_types.h"
24 #include "SDL_string.h"
24 #include "SDL_video.h" 25 #include "SDL_video.h"
25 #include "SDL_blit.h" 26 #include "SDL_blit.h"
26 #include "SDL_byteorder.h" 27 #include "SDL_byteorder.h"
27 #include "SDL_cpuinfo.h" 28 #include "SDL_cpuinfo.h"
28 29
655 Uint32 *src = (Uint32 *) info->s_pixels; 656 Uint32 *src = (Uint32 *) info->s_pixels;
656 int srcskip = info->s_skip; 657 int srcskip = info->s_skip;
657 Uint32 *dst = (Uint32 *) info->d_pixels; 658 Uint32 *dst = (Uint32 *) info->d_pixels;
658 int dstskip = info->d_skip; 659 int dstskip = info->d_skip;
659 SDL_PixelFormat *srcfmt = info->src; 660 SDL_PixelFormat *srcfmt = info->src;
660 int srcbpp = srcfmt->BytesPerPixel;
661 SDL_PixelFormat *dstfmt = info->dst; 661 SDL_PixelFormat *dstfmt = info->dst;
662 int dstbpp = dstfmt->BytesPerPixel;
663 vector unsigned int vzero = vec_splat_u32(0); 662 vector unsigned int vzero = vec_splat_u32(0);
664 vector unsigned char vpermute = calc_swizzle32(srcfmt, dstfmt); 663 vector unsigned char vpermute = calc_swizzle32(srcfmt, dstfmt);
665 if (dstfmt->Amask && !srcfmt->Amask) { 664 if (dstfmt->Amask && !srcfmt->Amask) {
666 if (srcfmt->alpha) { 665 if (srcfmt->alpha) {
667 vector unsigned char valpha; 666 vector unsigned char valpha;
668 ((unsigned char *)&valpha)[0] = srcfmt->alpha; 667 ((unsigned char *)&valpha)[0] = srcfmt->alpha;
669 vzero = (vector unsigned int)vec_splat(valpha, 0); 668 vzero = (vector unsigned int)vec_splat(valpha, 0);
670 } 669 }
671 } 670 }
672 671
673 assert(srcbpp == 4); 672 assert(srcfmt->BytesPerPixel == 4);
674 assert(dstbpp == 4); 673 assert(dstfmt->BytesPerPixel == 4);
675 674
676 while (height--) { 675 while (height--) {
677 vector unsigned char valigner; 676 vector unsigned char valigner;
678 vector unsigned int vbits; 677 vector unsigned int vbits;
679 vector unsigned int voverflow; 678 vector unsigned int voverflow;
735 Uint32 *src = (Uint32 *) info->s_pixels; 734 Uint32 *src = (Uint32 *) info->s_pixels;
736 int srcskip = info->s_skip; 735 int srcskip = info->s_skip;
737 Uint32 *dst = (Uint32 *) info->d_pixels; 736 Uint32 *dst = (Uint32 *) info->d_pixels;
738 int dstskip = info->d_skip; 737 int dstskip = info->d_skip;
739 SDL_PixelFormat *srcfmt = info->src; 738 SDL_PixelFormat *srcfmt = info->src;
740 int srcbpp = srcfmt->BytesPerPixel;
741 SDL_PixelFormat *dstfmt = info->dst; 739 SDL_PixelFormat *dstfmt = info->dst;
742 int dstbpp = dstfmt->BytesPerPixel;
743 vector unsigned int vzero = vec_splat_u32(0); 740 vector unsigned int vzero = vec_splat_u32(0);
744 vector unsigned char vpermute = calc_swizzle32(srcfmt, dstfmt); 741 vector unsigned char vpermute = calc_swizzle32(srcfmt, dstfmt);
745 if (dstfmt->Amask && !srcfmt->Amask) { 742 if (dstfmt->Amask && !srcfmt->Amask) {
746 if (srcfmt->alpha) { 743 if (srcfmt->alpha) {
747 vector unsigned char valpha; 744 vector unsigned char valpha;
748 ((unsigned char *)&valpha)[0] = srcfmt->alpha; 745 ((unsigned char *)&valpha)[0] = srcfmt->alpha;
749 vzero = (vector unsigned int)vec_splat(valpha, 0); 746 vzero = (vector unsigned int)vec_splat(valpha, 0);
750 } 747 }
751 } 748 }
752 749
753 assert(srcbpp == 4); 750 assert(srcfmt->BytesPerPixel == 4);
754 assert(dstbpp == 4); 751 assert(dstfmt->BytesPerPixel == 4);
755 752
756 while (height--) { 753 while (height--) {
757 vector unsigned char valigner; 754 vector unsigned char valigner;
758 vector unsigned int vbits; 755 vector unsigned int vbits;
759 vector unsigned int voverflow; 756 vector unsigned int voverflow;