src/video/SDL_blit.h
author Sam Lantinga
Sat, 18 Aug 2007 01:44:21 +0000
changeset 2266 e61ad15a205f
parent 2263 900c35d8e8fd
child 2267 c785543d1843
permissions -rw-r--r--
More work in progress integrating SDL_Surface and the new SDL_Texture API
     1 /*
     2     SDL - Simple DirectMedia Layer
     3     Copyright (C) 1997-2006 Sam Lantinga
     4 
     5     This library is free software; you can redistribute it and/or
     6     modify it under the terms of the GNU Lesser General Public
     7     License as published by the Free Software Foundation; either
     8     version 2.1 of the License, or (at your option) any later version.
     9 
    10     This library is distributed in the hope that it will be useful,
    11     but WITHOUT ANY WARRANTY; without even the implied warranty of
    12     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    13     Lesser General Public License for more details.
    14 
    15     You should have received a copy of the GNU Lesser General Public
    16     License along with this library; if not, write to the Free Software
    17     Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    18 
    19     Sam Lantinga
    20     slouken@libsdl.org
    21 */
    22 #include "SDL_config.h"
    23 
    24 #ifndef _SDL_blit_h
    25 #define _SDL_blit_h
    26 
    27 #ifdef __MMX__
    28 #include <mmintrin.h>
    29 #endif
    30 #ifdef __3dNOW__
    31 #include <mm3dnow.h>
    32 #endif
    33 #ifdef __SSE__
    34 #include <xmmintrin.h>
    35 #endif
    36 #ifdef __SSE2__
    37 #include <emmintrin.h>
    38 #endif
    39 
    40 #include "SDL_cpuinfo.h"
    41 #include "SDL_endian.h"
    42 
    43 /* SDL blit copy flags */
    44 #define SDL_COPY_MODULATE_COLOR     0x00000001
    45 #define SDL_COPY_MODULATE_ALPHA     0x00000002
    46 #define SDL_COPY_MASK               0x00000010
    47 #define SDL_COPY_BLEND              0x00000020
    48 #define SDL_COPY_ADD                0x00000040
    49 #define SDL_COPY_MOD                0x00000080
    50 #define SDL_COPY_COLORKEY           0x00000100
    51 #define SDL_COPY_NEAREST            0x00000200
    52 #define SDL_COPY_RLE_DESIRED        0x00001000
    53 #define SDL_COPY_RLE_COLORKEY       0x00002000
    54 #define SDL_COPY_RLE_ALPHAKEY       0x00004000
    55 
    56 /* SDL blit CPU flags */
    57 #define SDL_CPU_ANY                 0x00000000
    58 #define SDL_CPU_MMX                 0x00000001
    59 #define SDL_CPU_3DNOW               0x00000002
    60 #define SDL_CPU_SSE                 0x00000004
    61 #define SDL_CPU_SSE2                0x00000008
    62 #define SDL_CPU_ALTIVEC_PREFETCH    0x00000010
    63 #define SDL_CPU_ALTIVEC_NOPREFETCH  0x00000020
    64 
    65 typedef struct {
    66     Uint8 *src;
    67     int src_w, src_h;
    68     int src_pitch;
    69     Uint8 *dst;
    70     int dst_w, dst_h;
    71     int dst_pitch;
    72     SDL_PixelFormat *src_fmt;
    73     SDL_PixelFormat *dst_fmt;
    74     Uint8 *table;
    75     int flags;
    76     Uint32 colorkey;
    77     Uint8 r, g, b, a;
    78 } SDL_BlitInfo;
    79 
    80 typedef void (SDLCALL * SDL_BlitFunc)(SDL_BlitInfo *info);
    81 
    82 typedef struct {
    83     Uint32 src_format;
    84     Uint32 dst_format;
    85     int flags;
    86     int cpu;
    87     SDL_BlitFunc func;
    88 } SDL_BlitFuncEntry;
    89 
    90 /* Blit mapping definition */
    91 typedef struct SDL_BlitMap
    92 {
    93     SDL_Surface *dst;
    94     int identity;
    95     SDL_blit blit;
    96     void *data;
    97     SDL_BlitInfo info;
    98 
    99     /* the version count matches the destination; mismatch indicates
   100        an invalid mapping */
   101     unsigned int format_version;
   102 } SDL_BlitMap;
   103 
   104 /* Functions found in SDL_blit.c */
   105 extern int SDL_CalculateBlit(SDL_Surface * surface);
   106 
   107 /* Blit function tables in SDL_blit_*.c */
   108 extern SDL_BlitFuncEntry SDL_BlitFuncTable0[];
   109 extern SDL_BlitFuncEntry SDL_BlitFuncTable1[];
   110 extern SDL_BlitFuncEntry SDL_BlitFuncTableN[];
   111 
   112 /*
   113  * Useful macros for blitting routines
   114  */
   115 
   116 #if defined(__GNUC__)
   117 #define DECLARE_ALIGNED(t,v,a)  t __attribute__((aligned(a))) v
   118 #elif defined(_MSC_VER)
   119 #define DECLARE_ALIGNED(t,v,a)  __declspec(align(a)) t v
   120 #else
   121 #define DECLARE_ALIGNED(t,v,a)  t v
   122 #endif
   123 
   124 #define FORMAT_EQUAL(A, B)						\
   125     ((A)->BitsPerPixel == (B)->BitsPerPixel				\
   126      && ((A)->Rmask == (B)->Rmask) && ((A)->Amask == (B)->Amask))
   127 
   128 /* Load pixel of the specified format from a buffer and get its R-G-B values */
   129 /* FIXME: rescale values to 0..255 here? */
   130 #define RGB_FROM_PIXEL(Pixel, fmt, r, g, b)				\
   131 {									\
   132 	r = (((Pixel&fmt->Rmask)>>fmt->Rshift)<<fmt->Rloss); 		\
   133 	g = (((Pixel&fmt->Gmask)>>fmt->Gshift)<<fmt->Gloss); 		\
   134 	b = (((Pixel&fmt->Bmask)>>fmt->Bshift)<<fmt->Bloss); 		\
   135 }
   136 #define RGB_FROM_RGB565(Pixel, r, g, b)					\
   137 {									\
   138 	r = (((Pixel&0xF800)>>11)<<3);		 			\
   139 	g = (((Pixel&0x07E0)>>5)<<2); 					\
   140 	b = ((Pixel&0x001F)<<3); 					\
   141 }
   142 #define RGB_FROM_RGB555(Pixel, r, g, b)					\
   143 {									\
   144 	r = (((Pixel&0x7C00)>>10)<<3);		 			\
   145 	g = (((Pixel&0x03E0)>>5)<<3); 					\
   146 	b = ((Pixel&0x001F)<<3); 					\
   147 }
   148 #define RGB_FROM_RGB888(Pixel, r, g, b)					\
   149 {									\
   150 	r = ((Pixel&0xFF0000)>>16);		 			\
   151 	g = ((Pixel&0xFF00)>>8);		 			\
   152 	b = (Pixel&0xFF);			 			\
   153 }
   154 #define RETRIEVE_RGB_PIXEL(buf, bpp, Pixel)				   \
   155 do {									   \
   156 	switch (bpp) {							   \
   157 		case 2:							   \
   158 			Pixel = *((Uint16 *)(buf));			   \
   159 		break;							   \
   160 									   \
   161 		case 3: {						   \
   162 		        Uint8 *B = (Uint8 *)(buf);			   \
   163 			if(SDL_BYTEORDER == SDL_LIL_ENDIAN) {		   \
   164 			        Pixel = B[0] + (B[1] << 8) + (B[2] << 16); \
   165 			} else {					   \
   166 			        Pixel = (B[0] << 16) + (B[1] << 8) + B[2]; \
   167 			}						   \
   168 		}							   \
   169 		break;							   \
   170 									   \
   171 		case 4:							   \
   172 			Pixel = *((Uint32 *)(buf));			   \
   173 		break;							   \
   174 									   \
   175 		default:						   \
   176 			Pixel = 0; /* appease gcc */			   \
   177 		break;							   \
   178 	}								   \
   179 } while(0)
   180 
   181 #define DISEMBLE_RGB(buf, bpp, fmt, Pixel, r, g, b)			   \
   182 do {									   \
   183 	switch (bpp) {							   \
   184 		case 2:							   \
   185 			Pixel = *((Uint16 *)(buf));			   \
   186 		break;							   \
   187 									   \
   188 		case 3: {						   \
   189 		        Uint8 *B = (Uint8 *)buf;			   \
   190 			if(SDL_BYTEORDER == SDL_LIL_ENDIAN) {		   \
   191 			        Pixel = B[0] + (B[1] << 8) + (B[2] << 16); \
   192 			} else {					   \
   193 			        Pixel = (B[0] << 16) + (B[1] << 8) + B[2]; \
   194 			}						   \
   195 		}							   \
   196 		break;							   \
   197 									   \
   198 		case 4:							   \
   199 			Pixel = *((Uint32 *)(buf));			   \
   200 		break;							   \
   201 									   \
   202 	        default:						   \
   203 		        Pixel = 0;	/* prevent gcc from complaining */ \
   204 		break;							   \
   205 	}								   \
   206 	RGB_FROM_PIXEL(Pixel, fmt, r, g, b);				   \
   207 } while(0)
   208 
   209 /* Assemble R-G-B values into a specified pixel format and store them */
   210 #define PIXEL_FROM_RGB(Pixel, fmt, r, g, b)				\
   211 {									\
   212 	Pixel = ((r>>fmt->Rloss)<<fmt->Rshift)|				\
   213 		((g>>fmt->Gloss)<<fmt->Gshift)|				\
   214 		((b>>fmt->Bloss)<<fmt->Bshift);				\
   215 }
   216 #define RGB565_FROM_RGB(Pixel, r, g, b)					\
   217 {									\
   218 	Pixel = ((r>>3)<<11)|((g>>2)<<5)|(b>>3);			\
   219 }
   220 #define RGB555_FROM_RGB(Pixel, r, g, b)					\
   221 {									\
   222 	Pixel = ((r>>3)<<10)|((g>>3)<<5)|(b>>3);			\
   223 }
   224 #define RGB888_FROM_RGB(Pixel, r, g, b)					\
   225 {									\
   226 	Pixel = (r<<16)|(g<<8)|b;					\
   227 }
   228 #define ASSEMBLE_RGB(buf, bpp, fmt, r, g, b) 				\
   229 {									\
   230 	switch (bpp) {							\
   231 		case 2: {						\
   232 			Uint16 Pixel;					\
   233 									\
   234 			PIXEL_FROM_RGB(Pixel, fmt, r, g, b);		\
   235 			*((Uint16 *)(buf)) = Pixel;			\
   236 		}							\
   237 		break;							\
   238 									\
   239 		case 3: {						\
   240                         if(SDL_BYTEORDER == SDL_LIL_ENDIAN) {		\
   241 			        *((buf)+fmt->Rshift/8) = r;		\
   242 				*((buf)+fmt->Gshift/8) = g;		\
   243 				*((buf)+fmt->Bshift/8) = b;		\
   244 			} else {					\
   245 			        *((buf)+2-fmt->Rshift/8) = r;		\
   246 				*((buf)+2-fmt->Gshift/8) = g;		\
   247 				*((buf)+2-fmt->Bshift/8) = b;		\
   248 			}						\
   249 		}							\
   250 		break;							\
   251 									\
   252 		case 4: {						\
   253 			Uint32 Pixel;					\
   254 									\
   255 			PIXEL_FROM_RGB(Pixel, fmt, r, g, b);		\
   256 			*((Uint32 *)(buf)) = Pixel;			\
   257 		}							\
   258 		break;							\
   259 	}								\
   260 }
   261 #define ASSEMBLE_RGB_AMASK(buf, bpp, fmt, r, g, b, Amask)		\
   262 {									\
   263 	switch (bpp) {							\
   264 		case 2: {						\
   265 			Uint16 *bufp;					\
   266 			Uint16 Pixel;					\
   267 									\
   268 			bufp = (Uint16 *)buf;				\
   269 			PIXEL_FROM_RGB(Pixel, fmt, r, g, b);		\
   270 			*bufp = Pixel | (*bufp & Amask);		\
   271 		}							\
   272 		break;							\
   273 									\
   274 		case 3: {						\
   275                         if(SDL_BYTEORDER == SDL_LIL_ENDIAN) {		\
   276 			        *((buf)+fmt->Rshift/8) = r;		\
   277 				*((buf)+fmt->Gshift/8) = g;		\
   278 				*((buf)+fmt->Bshift/8) = b;		\
   279 			} else {					\
   280 			        *((buf)+2-fmt->Rshift/8) = r;		\
   281 				*((buf)+2-fmt->Gshift/8) = g;		\
   282 				*((buf)+2-fmt->Bshift/8) = b;		\
   283 			}						\
   284 		}							\
   285 		break;							\
   286 									\
   287 		case 4: {						\
   288 			Uint32 *bufp;					\
   289 			Uint32 Pixel;					\
   290 									\
   291 			bufp = (Uint32 *)buf;				\
   292 			PIXEL_FROM_RGB(Pixel, fmt, r, g, b);		\
   293 			*bufp = Pixel | (*bufp & Amask);		\
   294 		}							\
   295 		break;							\
   296 	}								\
   297 }
   298 
   299 /* FIXME: Should we rescale alpha into 0..255 here? */
   300 #define RGBA_FROM_PIXEL(Pixel, fmt, r, g, b, a)				\
   301 {									\
   302 	r = ((Pixel&fmt->Rmask)>>fmt->Rshift)<<fmt->Rloss; 		\
   303 	g = ((Pixel&fmt->Gmask)>>fmt->Gshift)<<fmt->Gloss; 		\
   304 	b = ((Pixel&fmt->Bmask)>>fmt->Bshift)<<fmt->Bloss; 		\
   305 	a = ((Pixel&fmt->Amask)>>fmt->Ashift)<<fmt->Aloss;	 	\
   306 }
   307 #define RGBA_FROM_8888(Pixel, fmt, r, g, b, a)	\
   308 {						\
   309 	r = (Pixel&fmt->Rmask)>>fmt->Rshift;	\
   310 	g = (Pixel&fmt->Gmask)>>fmt->Gshift;	\
   311 	b = (Pixel&fmt->Bmask)>>fmt->Bshift;	\
   312 	a = (Pixel&fmt->Amask)>>fmt->Ashift;	\
   313 }
   314 #define RGBA_FROM_RGBA8888(Pixel, r, g, b, a)				\
   315 {									\
   316 	r = (Pixel>>24);						\
   317 	g = ((Pixel>>16)&0xFF);						\
   318 	b = ((Pixel>>8)&0xFF);						\
   319 	a = (Pixel&0xFF);						\
   320 }
   321 #define RGBA_FROM_ARGB8888(Pixel, r, g, b, a)				\
   322 {									\
   323 	r = ((Pixel>>16)&0xFF);						\
   324 	g = ((Pixel>>8)&0xFF);						\
   325 	b = (Pixel&0xFF);						\
   326 	a = (Pixel>>24);						\
   327 }
   328 #define RGBA_FROM_ABGR8888(Pixel, r, g, b, a)				\
   329 {									\
   330 	r = (Pixel&0xFF);						\
   331 	g = ((Pixel>>8)&0xFF);						\
   332 	b = ((Pixel>>16)&0xFF);						\
   333 	a = (Pixel>>24);						\
   334 }
   335 #define DISEMBLE_RGBA(buf, bpp, fmt, Pixel, r, g, b, a)			   \
   336 do {									   \
   337 	switch (bpp) {							   \
   338 		case 2:							   \
   339 			Pixel = *((Uint16 *)(buf));			   \
   340 		break;							   \
   341 									   \
   342 		case 3:	{/* FIXME: broken code (no alpha) */		   \
   343 		        Uint8 *b = (Uint8 *)buf;			   \
   344 			if(SDL_BYTEORDER == SDL_LIL_ENDIAN) {		   \
   345 			        Pixel = b[0] + (b[1] << 8) + (b[2] << 16); \
   346 			} else {					   \
   347 			        Pixel = (b[0] << 16) + (b[1] << 8) + b[2]; \
   348 			}						   \
   349 		}							   \
   350 		break;							   \
   351 									   \
   352 		case 4:							   \
   353 			Pixel = *((Uint32 *)(buf));			   \
   354 		break;							   \
   355 									   \
   356 		default:						   \
   357 		        Pixel = 0; /* stop gcc complaints */		   \
   358 		break;							   \
   359 	}								   \
   360 	RGBA_FROM_PIXEL(Pixel, fmt, r, g, b, a);			   \
   361 	Pixel &= ~fmt->Amask;						   \
   362 } while(0)
   363 
   364 /* FIXME: this isn't correct, especially for Alpha (maximum != 255) */
   365 #define PIXEL_FROM_RGBA(Pixel, fmt, r, g, b, a)				\
   366 {									\
   367 	Pixel = ((r>>fmt->Rloss)<<fmt->Rshift)|				\
   368 		((g>>fmt->Gloss)<<fmt->Gshift)|				\
   369 		((b>>fmt->Bloss)<<fmt->Bshift)|				\
   370 		((a>>fmt->Aloss)<<fmt->Ashift);				\
   371 }
   372 #define ASSEMBLE_RGBA(buf, bpp, fmt, r, g, b, a)			\
   373 {									\
   374 	switch (bpp) {							\
   375 		case 2: {						\
   376 			Uint16 Pixel;					\
   377 									\
   378 			PIXEL_FROM_RGBA(Pixel, fmt, r, g, b, a);	\
   379 			*((Uint16 *)(buf)) = Pixel;			\
   380 		}							\
   381 		break;							\
   382 									\
   383 		case 3: { /* FIXME: broken code (no alpha) */		\
   384                         if(SDL_BYTEORDER == SDL_LIL_ENDIAN) {		\
   385 			        *((buf)+fmt->Rshift/8) = r;		\
   386 				*((buf)+fmt->Gshift/8) = g;		\
   387 				*((buf)+fmt->Bshift/8) = b;		\
   388 			} else {					\
   389 			        *((buf)+2-fmt->Rshift/8) = r;		\
   390 				*((buf)+2-fmt->Gshift/8) = g;		\
   391 				*((buf)+2-fmt->Bshift/8) = b;		\
   392 			}						\
   393 		}							\
   394 		break;							\
   395 									\
   396 		case 4: {						\
   397 			Uint32 Pixel;					\
   398 									\
   399 			PIXEL_FROM_RGBA(Pixel, fmt, r, g, b, a);	\
   400 			*((Uint32 *)(buf)) = Pixel;			\
   401 		}							\
   402 		break;							\
   403 	}								\
   404 }
   405 
   406 /* Blend the RGB values of two Pixels based on a source alpha value */
   407 #define ALPHA_BLEND(sR, sG, sB, A, dR, dG, dB)	\
   408 do {						\
   409 	dR = (((sR-dR)*(A))>>8)+dR;		\
   410 	dG = (((sG-dG)*(A))>>8)+dG;		\
   411 	dB = (((sB-dB)*(A))>>8)+dB;		\
   412 } while(0)
   413 
   414 /* Blend the RGB values of two Pixels based on a source alpha value */
   415 #define ACCURATE_ALPHA_BLEND(sR, sG, sB, sA, dR, dG, dB)	\
   416 do {						\
   417     unsigned tR, tG, tB, tA; \
   418     tA = 255 - sA; \
   419     tR = 1 + (sR * sA) + (dR * tA); \
   420     dR = (tR + (tR >> 8)) >> 8; \
   421     tG = 1 + (sG * sA) + (dG * tA); \
   422     dG = (tG + (tG >> 8)) >> 8; \
   423     tB = 1 + (sB * sA) + (dB * tA); \
   424     dB = (tB + (tB >> 8)) >> 8; \
   425 } while(0)
   426 
   427 
   428 /* This is a very useful loop for optimizing blitters */
   429 #if defined(_MSC_VER) && (_MSC_VER == 1300)
   430 /* There's a bug in the Visual C++ 7 optimizer when compiling this code */
   431 #else
   432 #define USE_DUFFS_LOOP
   433 #endif
   434 #ifdef USE_DUFFS_LOOP
   435 
   436 /* 8-times unrolled loop */
   437 #define DUFFS_LOOP8(pixel_copy_increment, width)			\
   438 { int n = (width+7)/8;							\
   439 	switch (width & 7) {						\
   440 	case 0: do {	pixel_copy_increment;				\
   441 	case 7:		pixel_copy_increment;				\
   442 	case 6:		pixel_copy_increment;				\
   443 	case 5:		pixel_copy_increment;				\
   444 	case 4:		pixel_copy_increment;				\
   445 	case 3:		pixel_copy_increment;				\
   446 	case 2:		pixel_copy_increment;				\
   447 	case 1:		pixel_copy_increment;				\
   448 		} while ( --n > 0 );					\
   449 	}								\
   450 }
   451 
   452 /* 4-times unrolled loop */
   453 #define DUFFS_LOOP4(pixel_copy_increment, width)			\
   454 { int n = (width+3)/4;							\
   455 	switch (width & 3) {						\
   456 	case 0: do {	pixel_copy_increment;				\
   457 	case 3:		pixel_copy_increment;				\
   458 	case 2:		pixel_copy_increment;				\
   459 	case 1:		pixel_copy_increment;				\
   460 		} while ( --n > 0 );					\
   461 	}								\
   462 }
   463 
   464 /* 2 - times unrolled loop */
   465 #define DUFFS_LOOP_DOUBLE2(pixel_copy_increment,			\
   466 				double_pixel_copy_increment, width)	\
   467 { int n, w = width;							\
   468 	if( w & 1 ) {							\
   469 	    pixel_copy_increment;					\
   470 	    w--;							\
   471 	}								\
   472 	if ( w > 0 )	{						\
   473 	    n = ( w + 2) / 4;						\
   474 	    switch( w & 2 ) {						\
   475 	    case 0: do {	double_pixel_copy_increment;		\
   476 	    case 2:		double_pixel_copy_increment;		\
   477 		    } while ( --n > 0 );					\
   478 	    }								\
   479 	}								\
   480 }
   481 
   482 /* 2 - times unrolled loop 4 pixels */
   483 #define DUFFS_LOOP_QUATRO2(pixel_copy_increment,			\
   484 				double_pixel_copy_increment,		\
   485 				quatro_pixel_copy_increment, width)	\
   486 { int n, w = width;								\
   487         if(w & 1) {							\
   488 	  pixel_copy_increment;						\
   489 	  w--;								\
   490 	}								\
   491 	if(w & 2) {							\
   492 	  double_pixel_copy_increment;					\
   493 	  w -= 2;							\
   494 	}								\
   495 	if ( w > 0 ) {							\
   496 	    n = ( w + 7 ) / 8;						\
   497 	    switch( w & 4 ) {						\
   498 	    case 0: do {	quatro_pixel_copy_increment;		\
   499 	    case 4:		quatro_pixel_copy_increment;		\
   500 		    } while ( --n > 0 );					\
   501 	    }								\
   502 	}								\
   503 }
   504 
   505 /* Use the 8-times version of the loop by default */
   506 #define DUFFS_LOOP(pixel_copy_increment, width)				\
   507 	DUFFS_LOOP8(pixel_copy_increment, width)
   508 
   509 #else
   510 
   511 /* Don't use Duff's device to unroll loops */
   512 #define DUFFS_LOOP_DOUBLE2(pixel_copy_increment,			\
   513 			 double_pixel_copy_increment, width)		\
   514 { int n = width;								\
   515     if( n & 1 ) {							\
   516 	pixel_copy_increment;						\
   517 	n--;								\
   518     }									\
   519     n=n>>1;								\
   520     for(; n > 0; --n) {   						\
   521 	double_pixel_copy_increment;					\
   522     }									\
   523 }
   524 
   525 /* Don't use Duff's device to unroll loops */
   526 #define DUFFS_LOOP_QUATRO2(pixel_copy_increment,			\
   527 				double_pixel_copy_increment,		\
   528 				quatro_pixel_copy_increment, width)	\
   529 { int n = width;								\
   530         if(n & 1) {							\
   531 	  pixel_copy_increment;						\
   532 	  n--;								\
   533 	}								\
   534 	if(n & 2) {							\
   535 	  double_pixel_copy_increment;					\
   536 	  n -= 2;							\
   537 	}								\
   538 	n=n>>2;								\
   539 	for(; n > 0; --n) {   						\
   540 	  quatro_pixel_copy_increment;					\
   541         }								\
   542 }
   543 
   544 /* Don't use Duff's device to unroll loops */
   545 #define DUFFS_LOOP(pixel_copy_increment, width)				\
   546 { int n;								\
   547 	for ( n=width; n > 0; --n ) {					\
   548 		pixel_copy_increment;					\
   549 	}								\
   550 }
   551 #define DUFFS_LOOP8(pixel_copy_increment, width)			\
   552 	DUFFS_LOOP(pixel_copy_increment, width)
   553 #define DUFFS_LOOP4(pixel_copy_increment, width)			\
   554 	DUFFS_LOOP(pixel_copy_increment, width)
   555 
   556 #endif /* USE_DUFFS_LOOP */
   557 
   558 /* Prevent Visual C++ 6.0 from printing out stupid warnings */
   559 #if defined(_MSC_VER) && (_MSC_VER >= 600)
   560 #pragma warning(disable: 4550)
   561 #endif
   562 
   563 #endif /* _SDL_blit_h */
   564 /* vi: set ts=4 sw=4 expandtab: */