diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-03-13 20:03:22 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-03-13 20:20:27 +0300 |
commit | d2c64cb6995486136be2cd511ff7ad835d57c319 (patch) | |
tree | 4ad19c7dfb1fdb53ebd543b07cf9f61c2d01f8ed /src/being/being.cpp | |
parent | 9cff7e13f21edf3c794085bd9d0fbbdb22ff6896 (diff) | |
download | manaplus-d2c64cb6995486136be2cd511ff7ad835d57c319.tar.gz manaplus-d2c64cb6995486136be2cd511ff7ad835d57c319.tar.bz2 manaplus-d2c64cb6995486136be2cd511ff7ad835d57c319.tar.xz manaplus-d2c64cb6995486136be2cd511ff7ad835d57c319.zip |
Add separate functions for draw monsters.
Diffstat (limited to 'src/being/being.cpp')
-rw-r--r-- | src/being/being.cpp | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/src/being/being.cpp b/src/being/being.cpp index bbd7f63b2..c3e63d41c 100644 --- a/src/being/being.cpp +++ b/src/being/being.cpp @@ -2915,6 +2915,18 @@ void Being::drawOther(Graphics *restrict const graphics, drawOtherSpriteAt(graphics, px, py); } +void Being::drawMonster(Graphics *restrict const graphics, + const int offsetX, + const int offsetY) const restrict2 +{ + // getActorX() + offsetX; + const int px = mPixelX - mapTileSize / 2 + offsetX; + // getActorY() + offsetY; + const int py = mPixelY - mapTileSize + offsetY; + drawBeingCursor(graphics, px, py); + drawMonsterSpriteAt(graphics, px, py); +} + void Being::drawPortal(Graphics *restrict const graphics, const int offsetX, const int offsetY) const restrict2 @@ -2942,8 +2954,12 @@ void Being::draw(Graphics *restrict const graphics, offsetX, offsetY); break; - case ActorType::Npc: case ActorType::Monster: + drawMonster(graphics, + offsetX, + offsetY); + break; + case ActorType::Npc: case ActorType::FloorItem: case ActorType::LocalPet: case ActorType::Avatar: @@ -3034,9 +3050,16 @@ void Being::drawOtherSpriteAt(Graphics *restrict const graphics, const int x, const int y) const restrict2 { + CompoundSprite::draw(graphics, x, y); +} + +void Being::drawMonsterSpriteAt(Graphics *restrict const graphics, + const int x, + const int y) const restrict2 +{ if (mHighlightMonsterAttackRange && mType == ActorType::Monster && - isAlive()) + mAction != BeingAction::DEAD) { if (!userPalette) { @@ -3082,6 +3105,7 @@ void Being::drawOtherSpriteAt(Graphics *restrict const graphics, 2 * 50, 4); } + } void Being::drawPortalSpriteAt(Graphics *restrict const graphics, |