From ad3ee95f90bfd368a511407c13718b900e44be0f Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 19 May 2014 15:21:11 +0300 Subject: Move spritedirection into separate file. --- src/resources/iteminfo.cpp | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) (limited to 'src/resources/iteminfo.cpp') diff --git a/src/resources/iteminfo.cpp b/src/resources/iteminfo.cpp index a79a678e3..6dbb90d2a 100644 --- a/src/resources/iteminfo.cpp +++ b/src/resources/iteminfo.cpp @@ -249,11 +249,11 @@ const SpriteToItemMap *ItemInfo::getSpriteToItemReplaceMap(const int direction) SpriteToItemMap *const spMap = mSpriteToItemReplaceMap[direction]; if (spMap) return spMap; - if (direction == DIRECTION_UPLEFT || direction == DIRECTION_UPRIGHT) - return mSpriteToItemReplaceMap[DIRECTION_UP]; + if (direction == SpriteDirection::UPLEFT || direction == SpriteDirection::UPRIGHT) + return mSpriteToItemReplaceMap[SpriteDirection::UP]; - if (direction == DIRECTION_DOWNLEFT || direction == DIRECTION_DOWNRIGHT) - return mSpriteToItemReplaceMap[DIRECTION_DOWN]; + if (direction == SpriteDirection::DOWNLEFT || direction == SpriteDirection::DOWNRIGHT) + return mSpriteToItemReplaceMap[SpriteDirection::DOWN]; return nullptr; } @@ -276,16 +276,16 @@ void ItemInfo::setSpriteOrder(int *const ptr, } case -2: { - ptr[DIRECTION_DOWN] = n; - ptr[DIRECTION_DOWNLEFT] = n; - ptr[DIRECTION_DOWNRIGHT] = n; + ptr[SpriteDirection::DOWN] = n; + ptr[SpriteDirection::DOWNLEFT] = n; + ptr[SpriteDirection::DOWNRIGHT] = n; return; } case -3: { - ptr[DIRECTION_UP] = n; - ptr[DIRECTION_UPLEFT] = n; - ptr[DIRECTION_UPRIGHT] = n; + ptr[SpriteDirection::UP] = n; + ptr[SpriteDirection::UPLEFT] = n; + ptr[SpriteDirection::UPRIGHT] = n; return; } default: @@ -294,19 +294,19 @@ void ItemInfo::setSpriteOrder(int *const ptr, if (direction < 0 || direction >= 9) return; - if (direction == DIRECTION_UP) + if (direction == SpriteDirection::UP) { - if (ptr[DIRECTION_UPLEFT] == def) - ptr[DIRECTION_UPLEFT] = n; - if (ptr[DIRECTION_UPRIGHT] == def) - ptr[DIRECTION_UPRIGHT] = n; + if (ptr[SpriteDirection::UPLEFT] == def) + ptr[SpriteDirection::UPLEFT] = n; + if (ptr[SpriteDirection::UPRIGHT] == def) + ptr[SpriteDirection::UPRIGHT] = n; } - else if (direction == DIRECTION_DOWN) + else if (direction == SpriteDirection::DOWN) { - if (ptr[DIRECTION_DOWNLEFT] == def) - ptr[DIRECTION_DOWNLEFT] = n; - if (ptr[DIRECTION_DOWNRIGHT] == def) - ptr[DIRECTION_DOWNRIGHT] = n; + if (ptr[SpriteDirection::DOWNLEFT] == def) + ptr[SpriteDirection::DOWNLEFT] = n; + if (ptr[SpriteDirection::DOWNRIGHT] == def) + ptr[SpriteDirection::DOWNRIGHT] = n; } ptr[direction] = n; } -- cgit v1.2.3-60-g2f50