From b5368211afefa2c2586e1979e382ef6a4dc79bdd Mon Sep 17 00:00:00 2001 From: Jared Adams Date: Fri, 21 May 2010 14:38:55 -0600 Subject: Fix transparent overlays under OpenGL MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This was accidentally broken in the SDL buffer commit. Reviewed-by: Thorbjørn Lindeijer --- src/compoundsprite.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/compoundsprite.cpp b/src/compoundsprite.cpp index c01b11c3..d6731e5d 100644 --- a/src/compoundsprite.cpp +++ b/src/compoundsprite.cpp @@ -99,7 +99,9 @@ bool CompoundSprite::draw(Graphics* graphics, int posX, int posY) const redraw(); if (mAlpha == 1.0f && mImage) + { return graphics->drawImage(mImage, posX + mOffsetX, posY + mOffsetY); + } else if (mAlpha && mAlphaImage) { if (mAlphaImage->getAlpha() != mAlpha) @@ -115,6 +117,8 @@ bool CompoundSprite::draw(Graphics* graphics, int posX, int posY) const { if (*it) { + if ((*it)->getAlpha() != mAlpha) + (*it)->setAlpha(mAlpha); (*it)->draw(graphics, posX, posY); } } -- cgit v1.2.3-70-g09d2