From ec1beaa2ee07368368e9bd45fe400eedc57419eb Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 21 Aug 2013 14:37:03 +0300 Subject: first part of fixes for compilation with SDL2 --- src/compoundsprite.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/compoundsprite.cpp') diff --git a/src/compoundsprite.cpp b/src/compoundsprite.cpp index 0d649e48e..d0bf9bc31 100644 --- a/src/compoundsprite.cpp +++ b/src/compoundsprite.cpp @@ -31,6 +31,7 @@ #include "map.h" #include "sdlgraphics.h" +#include "sdlshared.h" #include "resources/image.h" #include "resources/imagehelper.h" @@ -363,7 +364,11 @@ void CompoundSprite::redraw() const SDL_Surface *const surfaceA = SDL_CreateRGBSurface(SDL_HWSURFACE, BUFFER_WIDTH, BUFFER_HEIGHT, 32, rmask, gmask, bmask, amask); +#ifdef USE_SDL2 + SDL_SetSurfaceAlphaMod(surface, 255); +#else SDL_SetAlpha(surface, 0, SDL_ALPHA_OPAQUE); +#endif SDL_BlitSurface(surface, nullptr, surfaceA, nullptr); delete mImage; -- cgit v1.2.3-60-g2f50