diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-08-21 14:37:03 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-08-24 21:08:14 +0300 |
commit | ec1beaa2ee07368368e9bd45fe400eedc57419eb (patch) | |
tree | c8f4792dc2316c7cc852bcf6738dff7557d9b872 /src/resources/image.cpp | |
parent | 8d4af08b165e10d7e82380074ce733ee9d068c6a (diff) | |
download | plus-ec1beaa2ee07368368e9bd45fe400eedc57419eb.tar.gz plus-ec1beaa2ee07368368e9bd45fe400eedc57419eb.tar.bz2 plus-ec1beaa2ee07368368e9bd45fe400eedc57419eb.tar.xz plus-ec1beaa2ee07368368e9bd45fe400eedc57419eb.zip |
first part of fixes for compilation with SDL2
Diffstat (limited to 'src/resources/image.cpp')
-rw-r--r-- | src/resources/image.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
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<unsigned char>(255 * mAlpha)); +#else SDL_SetAlpha(mSDLSurface, SDL_SRCALPHA, - static_cast<unsigned char>(255 * mAlpha)); + static_cast<unsigned char>(255 * mAlpha)); +#endif } else { |