diff src/video/SDL_blit_A.c @ 1361:19418e4422cb

New configure-based build system. Still work in progress, but much improved
author Sam Lantinga <slouken@libsdl.org>
date Thu, 16 Feb 2006 10:11:48 +0000
parents c71e05b4dc2e
children d910939febfa
line wrap: on
line diff
--- a/src/video/SDL_blit_A.c	Fri Feb 10 07:29:08 2006 +0000
+++ b/src/video/SDL_blit_A.c	Thu Feb 16 10:11:48 2006 +0000
@@ -23,13 +23,13 @@
 #include "SDL_video.h"
 #include "SDL_blit.h"
 
-#if (defined(i386) || defined(__x86_64__)) && defined(__GNUC__) && defined(USE_ASMBLIT)
-#define MMX_ASMBLIT
+#if (defined(i386) || defined(__x86_64__)) && __GNUC__ && SDL_ASSEMBLY_BLITTERS
+#define MMX_ASMBLIT 1
 #endif
 
 /* Function to check the CPU flags */
 #include "SDL_cpuinfo.h"
-#ifdef MMX_ASMBLIT
+#if MMX_ASMBLIT
 #include "mmx.h"
 #endif
 
@@ -197,7 +197,7 @@
 	}
 }
 
-#ifdef MMX_ASMBLIT
+#if MMX_ASMBLIT
 /* fast RGB888->(A)RGB888 blending with surface alpha=128 special case */
 static void BlitRGBtoRGBSurfaceAlpha128MMX(SDL_BlitInfo *info)
 {
@@ -413,8 +413,8 @@
 }
 #endif
 
-#ifdef USE_ALTIVEC_BLITTERS
-#ifdef HAVE_ALTIVEC_H
+#if SDL_ALTIVEC_BLITTERS
+#if HAVE_ALTIVEC_H
 #include <altivec.h>
 #endif
 #include <assert.h>
@@ -1183,7 +1183,7 @@
         dstp += dstskip;
     }
 }
-#endif /* USE_ALTIVEC_BLITTERS */
+#endif /* SDL_ALTIVEC_BLITTERS */
 
 /* fast RGB888->(A)RGB888 blending with surface alpha=128 special case */
 static void BlitRGBtoRGBSurfaceAlpha128(SDL_BlitInfo *info)
@@ -1325,7 +1325,7 @@
 	}
 }
 
-#ifdef MMX_ASMBLIT
+#if MMX_ASMBLIT
 /* fast (as in MMX with prefetch) ARGB888->(A)RGB888 blending with pixel alpha */
 inline static void BlitRGBtoRGBPixelAlphaMMX3DNOW(SDL_BlitInfo *info)
 {
@@ -1527,7 +1527,7 @@
 	}
 }
 
-#ifdef MMX_ASMBLIT
+#if MMX_ASMBLIT
 /* fast RGB565->RGB565 blending with surface alpha */
 static void Blit565to565SurfaceAlphaMMX(SDL_BlitInfo *info)
 {
@@ -2136,7 +2136,7 @@
 	    if(df->BytesPerPixel == 1)
 		return BlitNto1SurfaceAlphaKey;
 	    else
-#ifdef USE_ALTIVEC_BLITTERS
+#if SDL_ALTIVEC_BLITTERS
 	if (sf->BytesPerPixel == 4 && df->BytesPerPixel == 4 &&
 	    !(surface->map->dst->flags & SDL_HWSURFACE) && SDL_HasAltiVec())
             return Blit32to32SurfaceAlphaKeyAltivec;
@@ -2153,7 +2153,7 @@
 		if(surface->map->identity) {
 		    if(df->Gmask == 0x7e0)
 		    {
-#ifdef MMX_ASMBLIT
+#if MMX_ASMBLIT
 		if(SDL_HasMMX())
 			return Blit565to565SurfaceAlphaMMX;
 		else
@@ -2162,7 +2162,7 @@
 		    }
 		    else if(df->Gmask == 0x3e0)
 		    {
-#ifdef MMX_ASMBLIT
+#if MMX_ASMBLIT
 		if(SDL_HasMMX())
 			return Blit555to555SurfaceAlphaMMX;
 		else
@@ -2179,12 +2179,12 @@
 		   && (sf->Rmask | sf->Gmask | sf->Bmask) == 0xffffff
 		   && sf->BytesPerPixel == 4)
 		{
-#ifdef MMX_ASMBLIT
+#if MMX_ASMBLIT
 		if(SDL_HasMMX())
 		    return BlitRGBtoRGBSurfaceAlphaMMX;
 		else
 #endif
-#ifdef USE_ALTIVEC_BLITTERS
+#if SDL_ALTIVEC_BLITTERS
 	if(!(surface->map->dst->flags & SDL_HWSURFACE) && SDL_HasAltiVec())
             return BlitRGBtoRGBSurfaceAlphaAltivec;
         else
@@ -2192,7 +2192,7 @@
 		    return BlitRGBtoRGBSurfaceAlpha;
 		}
 		else
-#ifdef USE_ALTIVEC_BLITTERS
+#if SDL_ALTIVEC_BLITTERS
         if((sf->BytesPerPixel == 4) &&
 	   !(surface->map->dst->flags & SDL_HWSURFACE) && SDL_HasAltiVec())
             return Blit32to32SurfaceAlphaAltivec;
@@ -2212,7 +2212,7 @@
 	    return BlitNto1PixelAlpha;
 
 	case 2:
-#ifdef USE_ALTIVEC_BLITTERS
+#if SDL_ALTIVEC_BLITTERS
 	if(sf->BytesPerPixel == 4 && !(surface->map->dst->flags & SDL_HWSURFACE) &&
            df->Gmask == 0x7e0 &&
 	   df->Bmask == 0x1f && SDL_HasAltiVec())
@@ -2237,7 +2237,7 @@
 	       && sf->Bmask == df->Bmask
 	       && sf->BytesPerPixel == 4)
 	    {
-#ifdef MMX_ASMBLIT
+#if MMX_ASMBLIT
 		if(SDL_Has3DNow())
 		    return BlitRGBtoRGBPixelAlphaMMX3DNOW;
 		else
@@ -2245,14 +2245,14 @@
 		    return BlitRGBtoRGBPixelAlphaMMX;
 		else
 #endif
-#ifdef USE_ALTIVEC_BLITTERS
+#if SDL_ALTIVEC_BLITTERS
 	if(!(surface->map->dst->flags & SDL_HWSURFACE) && SDL_HasAltiVec())
             return BlitRGBtoRGBPixelAlphaAltivec;
         else
 #endif
 		    return BlitRGBtoRGBPixelAlpha;
 	    }
-#ifdef USE_ALTIVEC_BLITTERS
+#if SDL_ALTIVEC_BLITTERS
         if (sf->Amask && sf->BytesPerPixel == 4 &&
 	    !(surface->map->dst->flags & SDL_HWSURFACE) && SDL_HasAltiVec())
             return Blit32to32PixelAlphaAltivec;