|
@@ -89,6 +89,7 @@
|
|
|
#include "SDL_sysvideo.h"
|
|
|
#include "SDL_blit.h"
|
|
|
#include "SDL_RLEaccel_c.h"
|
|
|
+#include "../cpuinfo/SDL_simd.h"
|
|
|
|
|
|
#ifndef MIN
|
|
|
#define MIN(a, b) ((a) < (b) ? (a) : (b))
|
|
@@ -1220,8 +1221,9 @@ RLEAlphaSurface(SDL_Surface * surface)
|
|
|
|
|
|
/* Now that we have it encoded, release the original pixels */
|
|
|
if (!(surface->flags & SDL_PREALLOC)) {
|
|
|
- SDL_free(surface->pixels);
|
|
|
+ SDL_SIMDFree(surface->pixels);
|
|
|
surface->pixels = NULL;
|
|
|
+ surface->flags &= ~SDL_SIMD_ALIGNED;
|
|
|
}
|
|
|
|
|
|
/* realloc the buffer to release unused memory */
|
|
@@ -1383,8 +1385,9 @@ RLEColorkeySurface(SDL_Surface * surface)
|
|
|
|
|
|
/* Now that we have it encoded, release the original pixels */
|
|
|
if (!(surface->flags & SDL_PREALLOC)) {
|
|
|
- SDL_free(surface->pixels);
|
|
|
+ SDL_SIMDFree(surface->pixels);
|
|
|
surface->pixels = NULL;
|
|
|
+ surface->flags &= ~SDL_SIMD_ALIGNED;
|
|
|
}
|
|
|
|
|
|
/* realloc the buffer to release unused memory */
|
|
@@ -1484,10 +1487,11 @@ UnRLEAlpha(SDL_Surface * surface)
|
|
|
uncopy_opaque = uncopy_transl = uncopy_32;
|
|
|
}
|
|
|
|
|
|
- surface->pixels = SDL_malloc(surface->h * surface->pitch);
|
|
|
+ surface->pixels = SDL_SIMDAlloc(surface->h * surface->pitch);
|
|
|
if (!surface->pixels) {
|
|
|
return (SDL_FALSE);
|
|
|
}
|
|
|
+ surface->flags |= SDL_SIMD_ALIGNED;
|
|
|
/* fill background with transparent pixels */
|
|
|
SDL_memset(surface->pixels, 0, surface->h * surface->pitch);
|
|
|
|
|
@@ -1549,12 +1553,13 @@ SDL_UnRLESurface(SDL_Surface * surface, int recode)
|
|
|
SDL_Rect full;
|
|
|
|
|
|
/* re-create the original surface */
|
|
|
- surface->pixels = SDL_malloc(surface->h * surface->pitch);
|
|
|
+ surface->pixels = SDL_SIMDAlloc(surface->h * surface->pitch);
|
|
|
if (!surface->pixels) {
|
|
|
/* Oh crap... */
|
|
|
surface->flags |= SDL_RLEACCEL;
|
|
|
return;
|
|
|
}
|
|
|
+ surface->flags |= SDL_SIMD_ALIGNED;
|
|
|
|
|
|
/* fill it with the background color */
|
|
|
SDL_FillRect(surface, NULL, surface->map->info.colorkey);
|