diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-02-07 16:18:13 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-02-07 16:18:13 +0300 |
commit | 9fe21fcd8883b37bdc30224822e6e42afb35b8f0 (patch) | |
tree | 798117abd4dc7e610997d59d530a96ddc1509f53 /src/being/actorsprite.cpp | |
parent | 4429cb14e9e187edef27aba692a4266733f79c17 (diff) | |
download | manaplus-9fe21fcd8883b37bdc30224822e6e42afb35b8f0.tar.gz manaplus-9fe21fcd8883b37bdc30224822e6e42afb35b8f0.tar.bz2 manaplus-9fe21fcd8883b37bdc30224822e6e42afb35b8f0.tar.xz manaplus-9fe21fcd8883b37bdc30224822e6e42afb35b8f0.zip |
Replace most static_cast<Type> to shorter versions from defines.
Diffstat (limited to 'src/being/actorsprite.cpp')
-rw-r--r-- | src/being/actorsprite.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/being/actorsprite.cpp b/src/being/actorsprite.cpp index d31bb9317..02da33367 100644 --- a/src/being/actorsprite.cpp +++ b/src/being/actorsprite.cpp @@ -47,12 +47,12 @@ #include "debug.h" #define for_each_cursors() \ - for (int size = static_cast<int>(TargetCursorSize::SMALL); \ - size < static_cast<int>(TargetCursorSize::NUM_TC); \ + for (int size = CAST_S32(TargetCursorSize::SMALL); \ + size < CAST_S32(TargetCursorSize::NUM_TC); \ size ++) \ { \ - for (int type = static_cast<int>(TargetCursorType::NORMAL); \ - type < static_cast<int>(TargetCursorType::NUM_TCT); \ + for (int type = CAST_S32(TargetCursorType::NORMAL); \ + type < CAST_S32(TargetCursorType::NUM_TCT); \ type ++) \ #define end_foreach } @@ -60,8 +60,8 @@ static const unsigned int STATUS_EFFECTS = 32; AnimatedSprite *ActorSprite::targetCursor - [static_cast<size_t>(TargetCursorType::NUM_TCT)] - [static_cast<size_t>(TargetCursorSize::NUM_TC)]; + [CAST_SIZE(TargetCursorType::NUM_TCT)] + [CAST_SIZE(TargetCursorSize::NUM_TC)]; bool ActorSprite::loaded = false; ActorSprite::ActorSprite(const BeingId id) : @@ -163,19 +163,19 @@ void ActorSprite::setTargetType(const TargetCursorTypeT type) } else { - const size_t sz = static_cast<size_t>(getTargetCursorSize()); - mUsedTargetCursor = targetCursor[static_cast<int>(type)][sz]; + const size_t sz = CAST_SIZE(getTargetCursorSize()); + mUsedTargetCursor = targetCursor[CAST_S32(type)][sz]; if (mUsedTargetCursor) { - static const int targetWidths[static_cast<size_t>( + static const int targetWidths[CAST_SIZE( TargetCursorSize::NUM_TC)] = {0, 0, 0}; - static const int targetHeights[static_cast<size_t>( + static const int targetHeights[CAST_SIZE( TargetCursorSize::NUM_TC)] = {-mapTileSize / 2, -mapTileSize / 2, -mapTileSize}; - mCursorPaddingX = static_cast<int>(targetWidths[sz]); - mCursorPaddingY = static_cast<int>(targetHeights[sz]); + mCursorPaddingX = CAST_S32(targetWidths[sz]); + mCursorPaddingY = CAST_S32(targetHeights[sz]); } } } @@ -219,7 +219,7 @@ void ActorSprite::setStatusEffectBlock(const int offset, const std::string str = strprintf( "Error: unknown effect by block-index. " "Offset: %d, effect int: %d, i: %u", - offset, static_cast<int>(newEffects), i); + offset, CAST_S32(newEffects), i); logger->log(str); DebugMessageListener::distributeEvent(str); } |