summaryrefslogtreecommitdiff
path: root/src/compoundsprite.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-08-21 14:37:03 +0300
committerAndrei Karas <akaras@inbox.ru>2013-08-24 21:08:14 +0300
commitec1beaa2ee07368368e9bd45fe400eedc57419eb (patch)
treec8f4792dc2316c7cc852bcf6738dff7557d9b872 /src/compoundsprite.cpp
parent8d4af08b165e10d7e82380074ce733ee9d068c6a (diff)
downloadmanaplus-ec1beaa2ee07368368e9bd45fe400eedc57419eb.tar.gz
manaplus-ec1beaa2ee07368368e9bd45fe400eedc57419eb.tar.bz2
manaplus-ec1beaa2ee07368368e9bd45fe400eedc57419eb.tar.xz
manaplus-ec1beaa2ee07368368e9bd45fe400eedc57419eb.zip
first part of fixes for compilation with SDL2
Diffstat (limited to 'src/compoundsprite.cpp')
-rw-r--r--src/compoundsprite.cpp5
1 files changed, 5 insertions, 0 deletions
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;