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