diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-03-13 19:33:51 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-03-13 19:53:11 +0300 |
commit | 1c59d2d1999a6dfe3fcc31518c76d27d34fd9b30 (patch) | |
tree | bd0c292da513a5e076217a378d0c820ca2d09724 /src/being/being.cpp | |
parent | 6ca3e7e52584261f9d43de1a68c09f20a762cac1 (diff) | |
download | plus-1c59d2d1999a6dfe3fcc31518c76d27d34fd9b30.tar.gz plus-1c59d2d1999a6dfe3fcc31518c76d27d34fd9b30.tar.bz2 plus-1c59d2d1999a6dfe3fcc31518c76d27d34fd9b30.tar.xz plus-1c59d2d1999a6dfe3fcc31518c76d27d34fd9b30.zip |
Split drawSpriteAt into drawPlayerSpriteAt and drawOtherSpriteAt.
Diffstat (limited to 'src/being/being.cpp')
-rw-r--r-- | src/being/being.cpp | 54 |
1 files changed, 31 insertions, 23 deletions
diff --git a/src/being/being.cpp b/src/being/being.cpp index 80561eabf..45b971399 100644 --- a/src/being/being.cpp +++ b/src/being/being.cpp @@ -2860,7 +2860,7 @@ void Being::drawPlayer(Graphics *restrict const graphics, } drawBeingCursor(graphics, px, py); - drawSpriteAt(graphics, px, py); + drawPlayerSpriteAt(graphics, px, py); for_each_horses(mUpHorseSprites) { @@ -2872,11 +2872,11 @@ void Being::drawPlayer(Graphics *restrict const graphics, else { drawBeingCursor(graphics, px, py); - drawSpriteAt(graphics, px, py); + drawPlayerSpriteAt(graphics, px, py); } #else drawBeingCursor(graphics, px, py); - drawSpriteAt(graphics, px, py); + drawPlayerSpriteAt(graphics, px, py); #endif } } @@ -2912,7 +2912,7 @@ void Being::drawOther(Graphics *restrict const graphics, // getActorY() + offsetY; const int py = mPixelY - mapTileSize + offsetY; drawBeingCursor(graphics, px, py); - drawSpriteAt(graphics, px, py); + drawOtherSpriteAt(graphics, px, py); } void Being::draw(Graphics *restrict const graphics, @@ -2991,9 +2991,33 @@ void Being::drawBasic(Graphics *restrict const graphics, CompoundSprite::draw(graphics, x, y); } -void Being::drawSpriteAt(Graphics *restrict const graphics, - const int x, - const int y) const restrict2 +void Being::drawPlayerSpriteAt(Graphics *restrict const graphics, + const int x, + const int y) const restrict2 +{ + CompoundSprite::draw(graphics, x, y); + + if (mShowOwnHP && + mInfo && + localPlayer == this && + mAction != BeingAction::DEAD) + { + drawHpBar(graphics, + PlayerInfo::getAttribute(Attributes::MAX_HP), + PlayerInfo::getAttribute(Attributes::HP), + 0, + UserColorId::PLAYER_HP, + UserColorId::PLAYER_HP2, + x - 50 + mapTileSize / 2 + mInfo->getHpBarOffsetX(), + y + mapTileSize - 6 + mInfo->getHpBarOffsetY(), + 2 * 50, + 4); + } +} + +void Being::drawOtherSpriteAt(Graphics *restrict const graphics, + const int x, + const int y) const restrict2 { if (mHighlightMapPortals && mMap && @@ -3066,22 +3090,6 @@ void Being::drawSpriteAt(Graphics *restrict const graphics, 2 * 50, 4); } - if (mShowOwnHP && - mInfo && - localPlayer == this && - mAction != BeingAction::DEAD) - { - drawHpBar(graphics, - PlayerInfo::getAttribute(Attributes::MAX_HP), - PlayerInfo::getAttribute(Attributes::HP), - 0, - UserColorId::PLAYER_HP, - UserColorId::PLAYER_HP2, - x - 50 + mapTileSize / 2 + mInfo->getHpBarOffsetX(), - y + mapTileSize - 6 + mInfo->getHpBarOffsetY(), - 2 * 50, - 4); - } } void Being::drawHpBar(Graphics *restrict const graphics, |