diff options
Diffstat (limited to 'src/being/compoundsprite.cpp')
-rw-r--r-- | src/being/compoundsprite.cpp | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/src/being/compoundsprite.cpp b/src/being/compoundsprite.cpp index f19b479a6..2af54f247 100644 --- a/src/being/compoundsprite.cpp +++ b/src/being/compoundsprite.cpp @@ -137,7 +137,8 @@ bool CompoundSprite::update(const int time) } void CompoundSprite::draw(Graphics *const graphics, - const int posX, const int posY) const + const int posX, + const int posY) const { FUNC_BLOCK("CompoundSprite::draw", 1) if (mNeedsRedraw) @@ -162,6 +163,33 @@ void CompoundSprite::draw(Graphics *const graphics, } } +void CompoundSprite::drawSimple(Graphics *const graphics, + const int posX, + const int posY) const +{ + FUNC_BLOCK("CompoundSprite::draw", 1) + if (mNeedsRedraw) + updateImages(); + + if (mSprites.empty()) // Nothing to draw + return; + + if (mAlpha == 1.0F && mImage) + { + graphics->drawImage(mImage, posX + mOffsetX, posY + mOffsetY); + } + else if (mAlpha && mAlphaImage) + { + mAlphaImage->setAlpha(mAlpha); + graphics->drawImage(mAlphaImage, + posX + mOffsetX, posY + mOffsetY); + } + else + { + CompoundSprite::drawSprites(graphics, posX, posY); + } +} + void CompoundSprite::drawSprites(Graphics *const graphics, const int posX, const int posY) const |