src/video/SDL_blit.c
changeset 2250 e1d228456537
parent 2249 5a58b57b6724
child 2253 6d99edd791bf
equal deleted inserted replaced
2249:5a58b57b6724 2250:e1d228456537
   137 {
   137 {
   138     int i;
   138     int i;
   139     static Uint32 features = 0xffffffff;
   139     static Uint32 features = 0xffffffff;
   140 
   140 
   141     if (features == 0xffffffff) {
   141     if (features == 0xffffffff) {
       
   142         const char *override = SDL_getenv("SDL_BLIT_FEATURES");
       
   143 
   142         features = SDL_BLIT_ANY;
   144         features = SDL_BLIT_ANY;
   143 
   145 
   144         /* Provide an override for testing .. */
   146         /* Allow an override for testing .. */
   145         const char *override = SDL_getenv("SDL_BLIT_FEATURES");
       
   146         if (override) {
   147         if (override) {
   147             SDL_sscanf(override, "%u", &features);
   148             SDL_sscanf(override, "%u", &features);
   148         } else {
   149         } else {
   149             if (SDL_HasMMX()) {
   150             if (SDL_HasMMX()) {
   150                 features |= SDL_BLIT_MMX;
   151                 features |= SDL_BLIT_MMX;
   151             }
   152             }
   152             if (SDL_HasSSE()) {
   153             if (SDL_HasSSE()) {
   153                 features |= SDL_BLIT_SSE;
   154                 features |= SDL_BLIT_SSE;
   154             }
   155             }
   155             if (SDL_HasAltivec()) {
   156             if (SDL_HasAltiVec()) {
   156                 if (SDL_UseAltivecPrefetch()) {
   157                 if (SDL_UseAltivecPrefetch()) {
   157                     features |= SDL_BLIT_ALTIVEC_PREFETCH;
   158                     features |= SDL_BLIT_ALTIVEC_PREFETCH;
   158                 } else {
   159                 } else {
   159                     features |= SDL_BLIT_ALTIVEC_NOPREFETCH;
   160                     features |= SDL_BLIT_ALTIVEC_NOPREFETCH;
   160                 }
   161                 }