summaryrefslogtreecommitdiff
path: root/src/being.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-07-23 00:10:43 +0300
committerAndrei Karas <akaras@inbox.ru>2012-07-23 00:10:43 +0300
commitd97189f055798b5b2051c1c5770a3def62747461 (patch)
treed66a891dba33d2ce1c882e0de7d6145bb2e0326b /src/being.cpp
parent25dce1399e40f24809842303d48ef090439de1e5 (diff)
downloadplus-d97189f055798b5b2051c1c5770a3def62747461.tar.gz
plus-d97189f055798b5b2051c1c5770a3def62747461.tar.bz2
plus-d97189f055798b5b2051c1c5770a3def62747461.tar.xz
plus-d97189f055798b5b2051c1c5770a3def62747461.zip
Improve perfomance in some object constructors.
Diffstat (limited to 'src/being.cpp')
-rw-r--r--src/being.cpp19
1 files changed, 2 insertions, 17 deletions
diff --git a/src/being.cpp b/src/being.cpp
index 924ffd9e0..094f01c66 100644
--- a/src/being.cpp
+++ b/src/being.cpp
@@ -80,9 +80,6 @@
#define CACHE_SIZE 50
-static const int DEFAULT_BEING_WIDTH = 32;
-static const int DEFAULT_BEING_HEIGHT = 32;
-
class BeingCacheEntry
{
public:
@@ -228,6 +225,8 @@ Being::Being(int id, Type type, uint16_t subtype, Map *map):
mIsGM(false),
mAttackRange(1),
mType(type),
+ mSpeechBubble(new SpeechBubble),
+ mWalkSpeed(Net::getPlayerHandler()->getDefaultWalkSpeed()),
mX(0),
mY(0),
mDamageTaken(0),
@@ -264,10 +263,6 @@ Being::Being(int id, Type type, uint16_t subtype, Map *map):
setMap(map);
setSubtype(subtype);
- mSpeechBubble = new SpeechBubble;
-
- mWalkSpeed = Net::getPlayerHandler()->getDefaultWalkSpeed();
-
if (mType == PLAYER)
mShowName = config.getBoolValue("visiblenames");
else if (mType != NPC)
@@ -1503,16 +1498,6 @@ int Being::getOffset(char pos, char neg) const
return offset;
}
-int Being::getWidth() const
-{
- return std::max(CompoundSprite::getWidth(), DEFAULT_BEING_WIDTH);
-}
-
-int Being::getHeight() const
-{
- return std::max(CompoundSprite::getHeight(), DEFAULT_BEING_HEIGHT);
-}
-
void Being::updateCoords()
{
if (!mDispName)