summaryrefslogtreecommitdiff
path: root/src/resources/image.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/resources/image.cpp')
-rw-r--r--src/resources/image.cpp7
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
{