summaryrefslogtreecommitdiff
path: root/src/resources/sdlimagehelper.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-06-02 20:26:43 +0300
committerAndrei Karas <akaras@inbox.ru>2017-06-03 23:53:31 +0300
commit8340a5b04420d2c456618245371cc6e268e5fa5d (patch)
tree5820375efeb8f522aaa9dd175300715883d20b46 /src/resources/sdlimagehelper.cpp
parent4b41e05deeef6927863601205dd7a0b5563e803a (diff)
downloadmanaverse-8340a5b04420d2c456618245371cc6e268e5fa5d.tar.gz
manaverse-8340a5b04420d2c456618245371cc6e268e5fa5d.tar.bz2
manaverse-8340a5b04420d2c456618245371cc6e268e5fa5d.tar.xz
manaverse-8340a5b04420d2c456618245371cc6e268e5fa5d.zip
Add custom image to image blit function based on fuction from sdl_gfx SDL_gfxBlitRGBA.
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,