summaryrefslogtreecommitdiff
path: root/src/resources/image.cpp
diff options
context:
space:
mode:
authorBjörn Steinbrink <B.Steinbrink@gmx.de>2006-03-16 15:50:00 +0000
committerBjörn Steinbrink <B.Steinbrink@gmx.de>2006-03-16 15:50:00 +0000
commit32badd4b6f843cb74fdc3238fe92119518c8c0ab (patch)
treeade2ace7f5ef62ae9fd14c6409d9c2df43a2348b /src/resources/image.cpp
parent65ccfccfc1e35a2e65638aea61c46e4e51bd874e (diff)
downloadmana-32badd4b6f843cb74fdc3238fe92119518c8c0ab.tar.gz
mana-32badd4b6f843cb74fdc3238fe92119518c8c0ab.tar.bz2
mana-32badd4b6f843cb74fdc3238fe92119518c8c0ab.tar.xz
mana-32badd4b6f843cb74fdc3238fe92119518c8c0ab.zip
A bunch of cosmetic changes.
Diffstat (limited to 'src/resources/image.cpp')
-rw-r--r--src/resources/image.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/resources/image.cpp b/src/resources/image.cpp
index ee2736d4..51899d3f 100644
--- a/src/resources/image.cpp
+++ b/src/resources/image.cpp
@@ -282,14 +282,16 @@ Image *Image::getSubImage(int x, int y, int width, int height)
void Image::setAlpha(float a)
{
- mAlpha = a;
-
- if (!mImage) {
+ if (mAlpha == a) {
return;
}
- // Set the alpha value this image is drawn at
- SDL_SetAlpha(mImage, SDL_SRCALPHA | SDL_RLEACCEL, (int)(255 * mAlpha));
+ mAlpha = a;
+
+ if (mImage) {
+ // Set the alpha value this image is drawn at
+ SDL_SetAlpha(mImage, SDL_SRCALPHA | SDL_RLEACCEL, (int)(255 * mAlpha));
+ }
}
float Image::getAlpha()