From 363bcc8b277f8c546d9bde4ec2eeae16bcd7f225 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 7 Sep 2013 19:42:14 +0300 Subject: fix for SDL2 software mode if screen surface not have alpha channel. --- src/resources/sdl2softwareimagehelper.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/resources/sdl2softwareimagehelper.h b/src/resources/sdl2softwareimagehelper.h index 907d2242e..99a1a67e9 100644 --- a/src/resources/sdl2softwareimagehelper.h +++ b/src/resources/sdl2softwareimagehelper.h @@ -95,7 +95,14 @@ class SDL2SoftwareImageHelper final : public ImageHelper SDL_Rect *const dstrect); static void setFormat(SDL_PixelFormat *const format) - { mFormat = format; } + { + mFormat = format; + if (mFormat) + { + mFormat->Amask = ~(format->Rmask + | format->Gmask | format->Bmask); + } + } protected: /** SDL_Surface to SDL_Surface Image loader */ -- cgit v1.2.3-70-g09d2