diff options
Diffstat (limited to 'src/resources')
-rw-r--r-- | src/resources/sdl2softwareimagehelper.cpp | 10 | ||||
-rw-r--r-- | src/resources/sdl2softwareimagehelper.h | 10 |
2 files changed, 5 insertions, 15 deletions
diff --git a/src/resources/sdl2softwareimagehelper.cpp b/src/resources/sdl2softwareimagehelper.cpp index 3511b8298..7c4ff3d5d 100644 --- a/src/resources/sdl2softwareimagehelper.cpp +++ b/src/resources/sdl2softwareimagehelper.cpp @@ -40,7 +40,7 @@ #include "debug.h" bool SDL2SoftwareImageHelper::mEnableAlphaCache = false; -SDL_Renderer *SDL2SoftwareImageHelper::mRenderer = nullptr; +SDL_PixelFormat *SDL2SoftwareImageHelper::mFormat = nullptr; Image *SDL2SoftwareImageHelper::load(SDL_RWops *const rw, Dye const &dye) const { @@ -137,13 +137,7 @@ Image *SDL2SoftwareImageHelper::_SDLload(SDL_Surface *tmpImage) const if (!tmpImage) return nullptr; -// SDL_Texture *const texture = SDL_CreateTextureFromSurface( -// mRenderer, tmpImage); -// if (!texture) -// return nullptr; -// SDL_SetTextureBlendMode(texture, SDL_BLENDMODE_BLEND); -// return new Image(texture, tmpImage->w, tmpImage->h); - SDL_Surface *image = convertTo32Bit(tmpImage); + SDL_Surface *image = SDL_ConvertSurface(tmpImage, mFormat, 0); return new Image(image, false, nullptr); } diff --git a/src/resources/sdl2softwareimagehelper.h b/src/resources/sdl2softwareimagehelper.h index 877ae9032..907d2242e 100644 --- a/src/resources/sdl2softwareimagehelper.h +++ b/src/resources/sdl2softwareimagehelper.h @@ -94,19 +94,15 @@ class SDL2SoftwareImageHelper final : public ImageHelper SDL_Surface *const dst, SDL_Rect *const dstrect); -#ifdef USE_SDL2 - static void setRenderer(SDL_Renderer *const renderer) - { mRenderer = renderer; } -#endif + static void setFormat(SDL_PixelFormat *const format) + { mFormat = format; } protected: /** SDL_Surface to SDL_Surface Image loader */ Image *_SDLload(SDL_Surface *tmpImage) const A_WARN_UNUSED; static bool mEnableAlphaCache; -#ifdef USE_SDL2 - static SDL_Renderer *mRenderer; -#endif + static SDL_PixelFormat *mFormat; }; #endif // USE_SDL2 |