summaryrefslogtreecommitdiff
path: root/src/being/actorsprite.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-05-13 12:56:09 +0300
committerAndrei Karas <akaras@inbox.ru>2014-05-13 12:56:09 +0300
commit7b4b302ffe79cdba0fa35b66741a9d6c3d9184f2 (patch)
tree1be01271ab942e0e6e321fa2ce45a6b527f97b07 /src/being/actorsprite.cpp
parentea0b61e18f36f28806940b00a2cddaef912c3340 (diff)
downloadplus-7b4b302ffe79cdba0fa35b66741a9d6c3d9184f2.tar.gz
plus-7b4b302ffe79cdba0fa35b66741a9d6c3d9184f2.tar.bz2
plus-7b4b302ffe79cdba0fa35b66741a9d6c3d9184f2.tar.xz
plus-7b4b302ffe79cdba0fa35b66741a9d6c3d9184f2.zip
Move targetcursorsize into separate file.
Diffstat (limited to 'src/being/actorsprite.cpp')
-rw-r--r--src/being/actorsprite.cpp23
1 files changed, 14 insertions, 9 deletions
diff --git a/src/being/actorsprite.cpp b/src/being/actorsprite.cpp
index eb695a0e2..6d5702da0 100644
--- a/src/being/actorsprite.cpp
+++ b/src/being/actorsprite.cpp
@@ -42,7 +42,7 @@
#include "debug.h"
-AnimatedSprite *ActorSprite::targetCursor[NUM_TCT][NUM_TC];
+AnimatedSprite *ActorSprite::targetCursor[NUM_TCT][TargetCursorSize::NUM_TC];
bool ActorSprite::loaded = false;
ActorSprite::ActorSprite(const int id) :
@@ -144,12 +144,13 @@ void ActorSprite::setTargetType(const TargetCursorType type)
}
else
{
- const TargetCursorSize sz = getTargetCursorSize();
+ const TargetCursorSize::Size sz = getTargetCursorSize();
mUsedTargetCursor = targetCursor[static_cast<int>(type)][sz];
if (mUsedTargetCursor)
{
- static const int targetWidths[ActorSprite::NUM_TC] = {0, 0, 0};
- static const int targetHeights[ActorSprite::NUM_TC]
+ static const int targetWidths[TargetCursorSize::NUM_TC]
+ = {0, 0, 0};
+ static const int targetHeights[TargetCursorSize::NUM_TC]
= {-mapTileSize / 2, -mapTileSize / 2, -mapTileSize};
mCursorPaddingX = static_cast<int>(targetWidths[sz]);
@@ -345,12 +346,12 @@ static const char *cursorSize(const int size)
{
switch (size)
{
- case ActorSprite::TC_LARGE:
+ case TargetCursorSize::LARGE:
return "l";
- case ActorSprite::TC_MEDIUM:
+ case TargetCursorSize::MEDIUM:
return "m";
default:
- case ActorSprite::TC_SMALL:
+ case TargetCursorSize::SMALL:
return "s";
}
}
@@ -360,7 +361,9 @@ void ActorSprite::initTargetCursor()
static const std::string targetCursorFile("target-cursor-%s-%s.xml");
// Load target cursors
- for (int size = TC_SMALL; size < NUM_TC; size++)
+ for (int size = TargetCursorSize::SMALL;
+ size < TargetCursorSize::NUM_TC;
+ size ++)
{
for (int type = TCT_NORMAL; type < NUM_TCT; type++)
{
@@ -375,7 +378,9 @@ void ActorSprite::initTargetCursor()
void ActorSprite::cleanupTargetCursors()
{
- for (int size = TC_SMALL; size < NUM_TC; size++)
+ for (int size = TargetCursorSize::SMALL;
+ size < TargetCursorSize::NUM_TC;
+ size ++)
{
for (int type = TCT_NORMAL; type < NUM_TCT; type++)
{