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/resources/image.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/resources/image.cpp') diff --git a/src/resources/image.cpp b/src/resources/image.cpp index c19d92d2d..f6d80e61e 100644 --- a/src/resources/image.cpp +++ b/src/resources/image.cpp @@ -245,8 +245,13 @@ void Image::setAlpha(const float alpha) if (!mHasAlphaChannel) { // Set the alpha value this image is drawn at +#ifdef USE_SDL2 + SDL_SetSurfaceAlphaMod(mSDLSurface, + static_cast(255 * mAlpha)); +#else SDL_SetAlpha(mSDLSurface, SDL_SRCALPHA, - static_cast(255 * mAlpha)); + static_cast(255 * mAlpha)); +#endif } else { -- cgit v1.2.3-60-g2f50