diff options
Diffstat (limited to 'src/resources/sprite/animatedsprite.cpp')
-rw-r--r-- | src/resources/sprite/animatedsprite.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/resources/sprite/animatedsprite.cpp b/src/resources/sprite/animatedsprite.cpp index 30eb4dda3..9d7186335 100644 --- a/src/resources/sprite/animatedsprite.cpp +++ b/src/resources/sprite/animatedsprite.cpp @@ -338,6 +338,27 @@ void AnimatedSprite::draw(Graphics *restrict const graphics, posX + mFrame->offsetX, posY + mFrame->offsetY); } +void AnimatedSprite::drawRescaled(Graphics *restrict const graphics, + const int posX, + const int posY, + const int dx, + const int dy) const restrict2 +{ + if (mFrame == nullptr || + mFrame->image == nullptr) + { + return; + } + + Image *restrict const image = mFrame->image; + image->setAlpha(mAlpha); + graphics->drawRescaledImage(image, + posX + mFrame->offsetX, + posY + mFrame->offsetY, + dx, + dy); +} + void AnimatedSprite::drawRaw(Graphics *restrict const graphics, const int posX, const int posY) const restrict2 |