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