From ad0e1575e9532b027e7ad46d5e450fe7ed4389a7 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 13 Mar 2016 17:51:41 +0300 Subject: Simplify drawing beings in playerbox control. --- src/being/being.cpp | 7 +++++++ src/being/being.h | 4 ++++ src/gui/widgets/playerbox.cpp | 2 +- 3 files changed, 12 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/being/being.cpp b/src/being/being.cpp index 9b8be8ec8..4565e6f01 100644 --- a/src/being/being.cpp +++ b/src/being/being.cpp @@ -2918,6 +2918,13 @@ void Being::drawSpritesSDL(Graphics *restrict const graphics, } } +void Being::drawBasic(Graphics *restrict const graphics, + const int x, + const int y) const restrict2 +{ + CompoundSprite::draw(graphics, x, y); +} + void Being::drawSpriteAt(Graphics *restrict const graphics, const int x, const int y) const restrict2 diff --git a/src/being/being.h b/src/being/being.h index 31c28d28f..8d95205fd 100644 --- a/src/being/being.h +++ b/src/being/being.h @@ -631,6 +631,10 @@ class Being notfinal : public ActorSprite, const int offsetY) const restrict2 override final A_NONNULL(2); + void drawBasic(Graphics *restrict const graphics, + const int x, + const int y) const restrict2 A_NONNULL(2); + void drawSpriteAt(Graphics *restrict const graphics, const int x, const int y) const restrict2 A_NONNULL(2); diff --git a/src/gui/widgets/playerbox.cpp b/src/gui/widgets/playerbox.cpp index 62d4b6bf9..75d1dc872 100644 --- a/src/gui/widgets/playerbox.cpp +++ b/src/gui/widgets/playerbox.cpp @@ -125,7 +125,7 @@ void PlayerBox::draw(Graphics *const graphics) const int bs = mFrameSize; const int x = mDimension.width / 2 + bs + mOffsetX; const int y = mDimension.height - bs + mOffsetY; - mBeing->drawSpriteAt(graphics, x, y); + mBeing->drawBasic(graphics, x, y); } if (settings.guiAlpha != mAlpha) -- cgit v1.2.3-70-g09d2