From 9fe21fcd8883b37bdc30224822e6e42afb35b8f0 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 7 Feb 2016 16:18:13 +0300 Subject: Replace most static_cast to shorter versions from defines. --- src/being/actorsprite.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'src/being/actorsprite.cpp') 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(TargetCursorSize::SMALL); \ - size < static_cast(TargetCursorSize::NUM_TC); \ + for (int size = CAST_S32(TargetCursorSize::SMALL); \ + size < CAST_S32(TargetCursorSize::NUM_TC); \ size ++) \ { \ - for (int type = static_cast(TargetCursorType::NORMAL); \ - type < static_cast(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(TargetCursorType::NUM_TCT)] - [static_cast(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(getTargetCursorSize()); - mUsedTargetCursor = targetCursor[static_cast(type)][sz]; + const size_t sz = CAST_SIZE(getTargetCursorSize()); + mUsedTargetCursor = targetCursor[CAST_S32(type)][sz]; if (mUsedTargetCursor) { - static const int targetWidths[static_cast( + static const int targetWidths[CAST_SIZE( TargetCursorSize::NUM_TC)] = {0, 0, 0}; - static const int targetHeights[static_cast( + static const int targetHeights[CAST_SIZE( TargetCursorSize::NUM_TC)] = {-mapTileSize / 2, -mapTileSize / 2, -mapTileSize}; - mCursorPaddingX = static_cast(targetWidths[sz]); - mCursorPaddingY = static_cast(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(newEffects), i); + offset, CAST_S32(newEffects), i); logger->log(str); DebugMessageListener::distributeEvent(str); } -- cgit v1.2.3-70-g09d2