From 2ab3f0d8d04374b330c91a9f065efa0f526d7824 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 1 Sep 2013 20:50:30 +0300 Subject: add software renderer for SDL2. before it used default renderer with software flags. --- src/resources/image.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/resources/image.cpp') 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 -#ifndef USE_SDL2 #include -#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 -- cgit v1.2.3-70-g09d2