From 4e7096f15eba73e6ea28066df6ab389aab3f052c Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 1 Aug 2011 15:34:45 +0300 Subject: Fix random opacity issue in complex sprites in software mode. --- src/compoundsprite.cpp | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) (limited to 'src/compoundsprite.cpp') diff --git a/src/compoundsprite.cpp b/src/compoundsprite.cpp index 8f6f1f60a..f92358791 100644 --- a/src/compoundsprite.cpp +++ b/src/compoundsprite.cpp @@ -128,7 +128,6 @@ bool CompoundSprite::draw(Graphics* graphics, int posX, int posY) const { drawSprites(graphics, posX, posY); } - return false; } @@ -380,15 +379,6 @@ void CompoundSprite::redraw() const drawSpritesSDL(graphics, posX, posY); -/* - SpriteConstIterator it, it_end; - for (it = begin(), it_end = end(); it != it_end; ++it) - { - if (*it) - (*it)->draw(graphics, posX, posY); - } -*/ - delete graphics; graphics = 0; @@ -409,3 +399,18 @@ void CompoundSprite::redraw() const mNeedsRedraw = false; } + +void CompoundSprite::setAlpha(float alpha) +{ + if (alpha != mAlpha) + { + SpriteConstIterator it, it_end; + for (it = begin(), it_end = end(); it != it_end; ++ it) + { + if (*it) + (*it)->setAlpha(alpha); + } + + mAlpha = alpha; + } +} -- cgit v1.2.3-60-g2f50