diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-09-01 20:50:30 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-09-01 22:38:20 +0300 |
commit | 2ab3f0d8d04374b330c91a9f065efa0f526d7824 (patch) | |
tree | 8bf7abb126fe43374b3a550d36685525bd3b8235 /src/resources/image.cpp | |
parent | a45370aa8bf7a5558801220d625bff89f3f1a185 (diff) | |
download | manaplus-2ab3f0d8d04374b330c91a9f065efa0f526d7824.tar.gz manaplus-2ab3f0d8d04374b330c91a9f065efa0f526d7824.tar.bz2 manaplus-2ab3f0d8d04374b330c91a9f065efa0f526d7824.tar.xz manaplus-2ab3f0d8d04374b330c91a9f065efa0f526d7824.zip |
add software renderer for SDL2.
before it used default renderer with software flags.
Diffstat (limited to 'src/resources/image.cpp')
-rw-r--r-- | src/resources/image.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/resources/image.cpp b/src/resources/image.cpp index c289c90cd..1a327eae1 100644 --- a/src/resources/image.cpp +++ b/src/resources/image.cpp @@ -42,9 +42,7 @@ #include "utils/sdlcheckutils.h" #include <SDL_image.h> -#ifndef USE_SDL2 #include <SDL_rotozoom.h> -#endif #include "debug.h" @@ -388,7 +386,6 @@ Image* Image::SDLgetScaledImage(const int width, const int height) const Image* scaledImage = nullptr; -#ifndef USE_SDL2 if (mSDLSurface) { SDL_Surface *const scaledSurface = zoomSurface(mSDLSurface, @@ -404,7 +401,6 @@ Image* Image::SDLgetScaledImage(const int width, const int height) const MSDL_FreeSurface(scaledSurface); } } -#endif return scaledImage; } @@ -423,7 +419,11 @@ Image *Image::getSubImage(const int x, const int y, #endif #ifdef USE_SDL2 - return new SubImage(this, mTexture, x, y, width, height); + // +++ probably default sdl render is broken here + if (mode == RENDER_SOFTWARE) + return new SubImage(this, mSDLSurface, x, y, width, height); + else + return new SubImage(this, mTexture, x, y, width, height); #else return new SubImage(this, mSDLSurface, x, y, width, height); #endif |