diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-05-06 18:55:26 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-05-06 18:55:26 +0300 |
commit | a86bdc28fb8bc8a70c6a19523789495d87c7a56d (patch) | |
tree | 18ebdbac9d236a3358af836e70544f0da905ee45 | |
parent | c25141f02a5b3dcddcc93ca5d2bd2fcdad5efb31 (diff) | |
download | plus-a86bdc28fb8bc8a70c6a19523789495d87c7a56d.tar.gz plus-a86bdc28fb8bc8a70c6a19523789495d87c7a56d.tar.bz2 plus-a86bdc28fb8bc8a70c6a19523789495d87c7a56d.tar.xz plus-a86bdc28fb8bc8a70c6a19523789495d87c7a56d.zip |
Add strong type bool type ForceDisplay.
-rw-r--r-- | src/being/actorsprite.cpp | 4 | ||||
-rw-r--r-- | src/being/actorsprite.h | 3 | ||||
-rw-r--r-- | src/being/being.cpp | 22 | ||||
-rw-r--r-- | src/enums/simpletypes.h | 1 | ||||
-rw-r--r-- | src/flooritem.cpp | 4 |
5 files changed, 23 insertions, 11 deletions
diff --git a/src/being/actorsprite.cpp b/src/being/actorsprite.cpp index b305b35a7..0def1ea5b 100644 --- a/src/being/actorsprite.cpp +++ b/src/being/actorsprite.cpp @@ -249,7 +249,7 @@ void ActorSprite::handleStatusEffect(const StatusEffect *const effect, } void ActorSprite::setupSpriteDisplay(const SpriteDisplay &display, - const bool forceDisplay, + const ForceDisplay forceDisplay, const int imageType, const std::string &color) { @@ -267,7 +267,7 @@ void ActorSprite::setupSpriteDisplay(const SpriteDisplay &display, } // Ensure that something is shown, if desired - if (empty() && forceDisplay) + if (empty() && forceDisplay == ForceDisplay_true) { if (display.image.empty()) { diff --git a/src/being/actorsprite.h b/src/being/actorsprite.h index f5d4f0214..24051ea2c 100644 --- a/src/being/actorsprite.h +++ b/src/being/actorsprite.h @@ -200,7 +200,8 @@ class ActorSprite notfinal : public CompoundSprite, public Actor const int effectId); void setupSpriteDisplay(const SpriteDisplay &display, - const bool forceDisplay = true, + const ForceDisplay forceDisplay + = ForceDisplay_true, const int imageType = 0, const std::string &color = ""); diff --git a/src/being/being.cpp b/src/being/being.cpp index a493d9a1a..472836140 100644 --- a/src/being/being.cpp +++ b/src/being/being.cpp @@ -336,7 +336,9 @@ void Being::setSubtype(const uint16_t subtype, const uint16_t look) if (mInfo) { setName(mInfo->getName()); - setupSpriteDisplay(mInfo->getDisplay(), true, 0, + setupSpriteDisplay(mInfo->getDisplay(), + ForceDisplay_true, + 0, mInfo->getColor(mLook)); mYDiff = mInfo->getSortOffsetY(); } @@ -348,7 +350,9 @@ void Being::setSubtype(const uint16_t subtype, const uint16_t look) if (mInfo) { setName(mInfo->getName()); - setupSpriteDisplay(mInfo->getDisplay(), true, 0, + setupSpriteDisplay(mInfo->getDisplay(), + ForceDisplay_true, + 0, mInfo->getColor(mLook)); mYDiff = mInfo->getSortOffsetY(); } @@ -359,7 +363,9 @@ void Being::setSubtype(const uint16_t subtype, const uint16_t look) if (mInfo) { setName(mInfo->getName()); - setupSpriteDisplay(mInfo->getDisplay(), true, 0, + setupSpriteDisplay(mInfo->getDisplay(), + ForceDisplay_true, + 0, mInfo->getColor(mLook)); mYDiff = mInfo->getSortOffsetY(); } @@ -370,7 +376,9 @@ void Being::setSubtype(const uint16_t subtype, const uint16_t look) if (mInfo) { setName(mInfo->getName()); - setupSpriteDisplay(mInfo->getDisplay(), true, 0, + setupSpriteDisplay(mInfo->getDisplay(), + ForceDisplay_true, + 0, mInfo->getColor(mLook)); mYDiff = mInfo->getSortOffsetY(); } @@ -381,7 +389,7 @@ void Being::setSubtype(const uint16_t subtype, const uint16_t look) mInfo = NPCDB::get(mSubType); if (mInfo) { - setupSpriteDisplay(mInfo->getDisplay(), false); + setupSpriteDisplay(mInfo->getDisplay(), ForceDisplay_false); mYDiff = mInfo->getSortOffsetY(); } } @@ -389,7 +397,7 @@ void Being::setSubtype(const uint16_t subtype, const uint16_t look) { mInfo = AvatarDB::get(mSubType); if (mInfo) - setupSpriteDisplay(mInfo->getDisplay(), false); + setupSpriteDisplay(mInfo->getDisplay(), ForceDisplay_false); } else if (mType == ActorType::LocalPet) { @@ -397,7 +405,7 @@ void Being::setSubtype(const uint16_t subtype, const uint16_t look) if (mInfo) { setName(mInfo->getName()); - setupSpriteDisplay(mInfo->getDisplay(), false); + setupSpriteDisplay(mInfo->getDisplay(), ForceDisplay_false); mYDiff = mInfo->getSortOffsetY(); const int speed = mInfo->getWalkSpeed(); if (!speed) diff --git a/src/enums/simpletypes.h b/src/enums/simpletypes.h index 698e5a531..652ddf630 100644 --- a/src/enums/simpletypes.h +++ b/src/enums/simpletypes.h @@ -63,5 +63,6 @@ defBoolEnum(AllPlayers); defBoolEnum(AllowSort); defBoolEnum(NpcNames); defBoolEnum(Enable); +defBoolEnum(ForceDisplay); #endif // ENUMS_SIMPLETYPES_H diff --git a/src/flooritem.cpp b/src/flooritem.cpp index eacccb054..c28b0a239 100644 --- a/src/flooritem.cpp +++ b/src/flooritem.cpp @@ -90,7 +90,9 @@ void FloorItem::postInit(Map *const map, int subX, int subY) } mCursor = info.getPickupCursor(); - setupSpriteDisplay(info.getDisplay(), true, 1, + setupSpriteDisplay(info.getDisplay(), + ForceDisplay_true, + 1, info.getDyeColorsString(mColor)); } |