summaryrefslogtreecommitdiff
path: root/src/actormanager.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-02-07 16:18:13 +0300
committerAndrei Karas <akaras@inbox.ru>2016-02-07 16:18:13 +0300
commit9fe21fcd8883b37bdc30224822e6e42afb35b8f0 (patch)
tree798117abd4dc7e610997d59d530a96ddc1509f53 /src/actormanager.cpp
parent4429cb14e9e187edef27aba692a4266733f79c17 (diff)
downloadplus-9fe21fcd8883b37bdc30224822e6e42afb35b8f0.tar.gz
plus-9fe21fcd8883b37bdc30224822e6e42afb35b8f0.tar.bz2
plus-9fe21fcd8883b37bdc30224822e6e42afb35b8f0.tar.xz
plus-9fe21fcd8883b37bdc30224822e6e42afb35b8f0.zip
Replace most static_cast<Type> to shorter versions from defines.
Diffstat (limited to 'src/actormanager.cpp')
-rw-r--r--src/actormanager.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/actormanager.cpp b/src/actormanager.cpp
index 1152324c2..c41f97c71 100644
--- a/src/actormanager.cpp
+++ b/src/actormanager.cpp
@@ -87,9 +87,9 @@ class FindBeingFunctor final
const unsigned other_y = y
+ ((b->getType() == ActorType::Npc) ? 1 : 0);
const Vector &pos = b->getPosition();
- return (static_cast<unsigned>(pos.x) / mapTileSize == x &&
- (static_cast<unsigned>(pos.y) / mapTileSize == y
- || static_cast<unsigned>(pos.y) / mapTileSize == other_y) &&
+ return (CAST_U32(pos.x) / mapTileSize == x &&
+ (CAST_U32(pos.y) / mapTileSize == y
+ || CAST_U32(pos.y) / mapTileSize == other_y) &&
b->isAlive() && (type == ActorType::Unknown
|| b->getType() == type));
}
@@ -397,8 +397,8 @@ Being *ActorManager::findBeing(const BeingId id) const
Being *ActorManager::findBeing(const int x, const int y,
const ActorTypeT type) const
{
- beingActorFinder.x = static_cast<uint16_t>(x);
- beingActorFinder.y = static_cast<uint16_t>(y);
+ beingActorFinder.x = CAST_U16(x);
+ beingActorFinder.y = CAST_U16(y);
beingActorFinder.type = type;
const ActorSpritesConstIterator it = std::find_if(
@@ -1697,7 +1697,7 @@ void ActorManager::parseLevels(std::string levels) const
being->addToCache();
}
}
- f = static_cast<size_t>(pos + brkEnd.length());
+ f = CAST_SIZE(pos + brkEnd.length());
pos = levels.find(brkEnd, f);
}
updatePlayerNames();
@@ -1977,7 +1977,7 @@ Being *ActorManager::cloneBeing(const Being *const srcBeing,
srcBeing->getTileY() + dy);
dstBeing->setName(srcBeing->getName());
dstBeing->setDirection(srcBeing->getDirection());
- const int sz = static_cast<int>(srcBeing->getSpritesCount());
+ const int sz = CAST_S32(srcBeing->getSpritesCount());
for (int slot = 0; slot < sz; slot ++)
{
const int spriteId = srcBeing->getSpriteID(slot);
@@ -1995,7 +1995,7 @@ Being *ActorManager::cloneBeing(const Being *const srcBeing,
void ActorManager::updateBadges()
{
- const uint8_t showBadges = static_cast<uint8_t>(
+ const uint8_t showBadges = CAST_U8(
config.getIntValue("showBadges"));
Being::mShowBadges = showBadges;
for_actors
@@ -2014,7 +2014,7 @@ void ActorManager::updateNameId(const std::string &name,
{
if (!mEnableIdCollecting)
return;
- const int id = static_cast<int>(beingId);
+ const int id = CAST_S32(beingId);
if (id &&
(id < 2000000 ||
id >= 110000000))