summaryrefslogtreecommitdiff
path: root/src/resources/sdlimagehelper.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/resources/sdlimagehelper.cpp')
-rw-r--r--src/resources/sdlimagehelper.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/resources/sdlimagehelper.cpp b/src/resources/sdlimagehelper.cpp
index bb339ce20..3c1653ca4 100644
--- a/src/resources/sdlimagehelper.cpp
+++ b/src/resources/sdlimagehelper.cpp
@@ -32,15 +32,22 @@
#include "utils/checkutils.h"
#include "utils/sdlcheckutils.h"
-#include <SDL_gfxBlitFunc.h>
#include <SDL_image.h>
-#include "debug.h"
+#include "localconsts.h"
+
+#if SDL_BYTEORDER == SDL_LIL_ENDIAN
+#include "resources/sdlgfxblitfunc.h"
+#else // SDL_BYTEORDER == SDL_LIL_ENDIAN
+#include <SDL_gfxBlitFunc.h>
+#endif // SDL_BYTEORDER == SDL_LIL_ENDIAN
#ifndef SDL_BIG_ENDIAN
#error missing SDL_endian.h
#endif // SDL_BYTEORDER
+#include "debug.h"
+
bool SDLImageHelper::mEnableAlphaCache = false;
Image *SDLImageHelper::load(SDL_RWops *const rw, Dye const &dye)
@@ -289,7 +296,12 @@ int SDLImageHelper::combineSurface(SDL_Surface *restrict const src,
SDL_Surface *restrict const dst,
SDL_Rect *restrict const dstrect)
{
+#if SDL_BYTEORDER == SDL_LIL_ENDIAN
+ return SDLgfxBlitRGBA(src, srcrect, dst, dstrect);
+#else // SDL_BYTEORDER == SDL_LIL_ENDIAN
+
return SDL_gfxBlitRGBA(src, srcrect, dst, dstrect);
+#endif // SDL_BYTEORDER == SDL_LIL_ENDIAN
}
void SDLImageHelper::copySurfaceToImage(const Image *const image,