Fixed bug #220
authorSam Lantinga
Tue, 09 May 2006 15:09:47 +0000
changeset 1795398ac0f88e4d
parent 1794 5605a9820134
child 1796 00ea6cf49a4e
Fixed bug #220

The AltiVec blitters don't compile, since they require __VEC__ to be enabled in
order for the compiler to understand "vector" and friends (i.e. do AltiVec)
But you don't want to turn AltiVec on globally, since then the code would only
run on a G4 (there are already runtime tests, before using the AltiVec
variants)

The solution here is to enable AltiVec locally, for the actual AltiVec code.
src/video/SDL_blit_A.c
src/video/SDL_blit_N.c
     1.1 --- a/src/video/SDL_blit_A.c	Tue May 09 08:52:54 2006 +0000
     1.2 +++ b/src/video/SDL_blit_A.c	Tue May 09 15:09:47 2006 +0000
     1.3 @@ -637,6 +637,9 @@
     1.4  #endif /* GCC_ASMBLIT, MSVC_ASMBLIT */
     1.5  
     1.6  #if SDL_ALTIVEC_BLITTERS
     1.7 +#if __MWERKS__
     1.8 +#pragma altivec_model on
     1.9 +#endif
    1.10  #if HAVE_ALTIVEC_H
    1.11  #include <altivec.h>
    1.12  #endif
    1.13 @@ -1406,6 +1409,9 @@
    1.14          dstp += dstskip;
    1.15      }
    1.16  }
    1.17 +#if __MWERKS__
    1.18 +#pragma altivec_model off
    1.19 +#endif
    1.20  #endif /* SDL_ALTIVEC_BLITTERS */
    1.21  
    1.22  /* fast RGB888->(A)RGB888 blending with surface alpha=128 special case */
     2.1 --- a/src/video/SDL_blit_N.c	Tue May 09 08:52:54 2006 +0000
     2.2 +++ b/src/video/SDL_blit_N.c	Tue May 09 15:09:47 2006 +0000
     2.3 @@ -29,6 +29,9 @@
     2.4  /* Functions to blit from N-bit surfaces to other surfaces */
     2.5  
     2.6  #if SDL_ALTIVEC_BLITTERS
     2.7 +#if __MWERKS__
     2.8 +#pragma altivec_model on
     2.9 +#endif
    2.10  #ifdef HAVE_ALTIVEC_H
    2.11  #include <altivec.h>
    2.12  #endif
    2.13 @@ -830,6 +833,9 @@
    2.14      }
    2.15      return features;
    2.16  }
    2.17 +#if __MWERKS__
    2.18 +#pragma altivec_model off
    2.19 +#endif
    2.20  #else
    2.21  /* Feature 1 is has-MMX */
    2.22  #define GetBlitFeatures() ((Uint32)(SDL_HasMMX() ? 1 : 0))