diff options
author | Ira Rice <irarice@gmail.com> | 2009-01-26 01:56:55 -0700 |
---|---|---|
committer | Ira Rice <irarice@gmail.com> | 2009-01-26 01:56:55 -0700 |
commit | 803e0dae01f09afbe529799cf89a8f57fe518ddb (patch) | |
tree | 6721b01603dcf77934cdb55afa659580a215b56d /src/being.cpp | |
parent | 062f4065f5a2117fc5fd5f408e1f3163e2f63afc (diff) | |
download | mana-client-803e0dae01f09afbe529799cf89a8f57fe518ddb.tar.gz mana-client-803e0dae01f09afbe529799cf89a8f57fe518ddb.tar.bz2 mana-client-803e0dae01f09afbe529799cf89a8f57fe518ddb.tar.xz mana-client-803e0dae01f09afbe529799cf89a8f57fe518ddb.zip |
Bit of code cleanup for the last commit (moved default width and height
out of being.h, so that they aren't included in any classes that don't
need them and cut the number of divisions in half in the being manager)
Signed-off-by: Ira Rice <irarice@gmail.com>
Diffstat (limited to 'src/being.cpp')
-rw-r--r-- | src/being.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/being.cpp b/src/being.cpp index ad5f4204..985be69c 100644 --- a/src/being.cpp +++ b/src/being.cpp @@ -56,6 +56,9 @@ std::vector<AnimatedSprite*> Being::emotionSet; static const int X_SPEECH_OFFSET = 18; static const int Y_SPEECH_OFFSET = 60; +static const int DEFAULT_WIDTH = 32; +static const int DEFAULT_HEIGHT = 32; + Being::Being(int id, int job, Map *map): mJob(job), mX(0), mY(0), @@ -571,14 +574,14 @@ int Being::getWidth() const { if (mSprites[BASE_SPRITE]) { - const int width = mSprites[BASE_SPRITE]->getWidth() > Being::DEFAULT_WIDTH ? + const int width = mSprites[BASE_SPRITE]->getWidth() > DEFAULT_WIDTH ? mSprites[BASE_SPRITE]->getWidth() : - Being::DEFAULT_WIDTH; + DEFAULT_WIDTH; return width; } else { - return Being::DEFAULT_WIDTH; + return DEFAULT_WIDTH; } } @@ -587,14 +590,14 @@ int Being::getHeight() const { if (mSprites[BASE_SPRITE]) { - const int height = mSprites[BASE_SPRITE]->getHeight() > Being::DEFAULT_HEIGHT ? + const int height = mSprites[BASE_SPRITE]->getHeight() > DEFAULT_HEIGHT ? mSprites[BASE_SPRITE]->getHeight() : - Being::DEFAULT_HEIGHT; + DEFAULT_HEIGHT; return height; } else { - return Being::DEFAULT_HEIGHT; + return DEFAULT_HEIGHT; } } |