summaryrefslogtreecommitdiff
path: root/src/resources/sprite
diff options
context:
space:
mode:
Diffstat (limited to 'src/resources/sprite')
-rw-r--r--src/resources/sprite/animatedsprite.cpp10
-rw-r--r--src/resources/sprite/imagesprite.cpp2
2 files changed, 4 insertions, 8 deletions
diff --git a/src/resources/sprite/animatedsprite.cpp b/src/resources/sprite/animatedsprite.cpp
index 08d73c2c5..34aca4706 100644
--- a/src/resources/sprite/animatedsprite.cpp
+++ b/src/resources/sprite/animatedsprite.cpp
@@ -323,9 +323,7 @@ void AnimatedSprite::draw(Graphics *restrict const graphics,
return;
Image *restrict const image = mFrame->image;
- if (image->getAlpha() != mAlpha)
- image->setAlpha(mAlpha);
-
+ image->setAlpha(mAlpha);
graphics->drawImage(image,
posX + mFrame->offsetX, posY + mFrame->offsetY);
}
@@ -338,9 +336,7 @@ void AnimatedSprite::drawRaw(Graphics *restrict const graphics,
return;
Image *restrict const image = mFrame->image;
- if (image->getAlpha() != mAlpha)
- image->setAlpha(mAlpha);
-
+ image->setAlpha(mAlpha);
graphics->drawImage(image,
posX,
posY);
@@ -416,7 +412,7 @@ void AnimatedSprite::setAlpha(float alpha) restrict2
if (mFrame)
{
Image *restrict const image = mFrame->image;
- if (image && image->getAlpha() != mAlpha)
+ if (image)
image->setAlpha(mAlpha);
}
}
diff --git a/src/resources/sprite/imagesprite.cpp b/src/resources/sprite/imagesprite.cpp
index c3258ca44..790bcadf8 100644
--- a/src/resources/sprite/imagesprite.cpp
+++ b/src/resources/sprite/imagesprite.cpp
@@ -30,7 +30,7 @@ ImageSprite::ImageSprite(Image *const image) :
{
if (mImage)
{
- mAlpha = mImage->getAlpha();
+ mAlpha = mImage->mAlpha;
mImage->incRef();
}
else