src/video/SDL_surface.c
changeset 12591 66cd8731c3b1
parent 12590 b50bedb4bca0
equal deleted inserted replaced
12590:b50bedb4bca0 12591:66cd8731c3b1
   118             SDL_FreeSurface(surface);
   118             SDL_FreeSurface(surface);
   119             SDL_OutOfMemory();
   119             SDL_OutOfMemory();
   120             return NULL;
   120             return NULL;
   121         }
   121         }
   122 
   122 
   123         surface->pixels = SDL_malloc((size_t)size);
   123         surface->pixels = SDL_SIMDAlloc((size_t)size);
   124         if (!surface->pixels) {
   124         if (!surface->pixels) {
   125             SDL_FreeSurface(surface);
   125             SDL_FreeSurface(surface);
   126             SDL_OutOfMemory();
   126             SDL_OutOfMemory();
   127             return NULL;
   127             return NULL;
   128         }
   128         }
       
   129         surface->flags |= SDL_SIMD_ALIGNED;
   129         /* This is important for bitmaps */
   130         /* This is important for bitmaps */
   130         SDL_memset(surface->pixels, 0, surface->h * surface->pitch);
   131         SDL_memset(surface->pixels, 0, surface->h * surface->pitch);
   131     }
   132     }
   132 
   133 
   133     /* Allocate an empty mapping */
   134     /* Allocate an empty mapping */