From d97189f055798b5b2051c1c5770a3def62747461 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 23 Jul 2012 00:10:43 +0300 Subject: Improve perfomance in some object constructors. --- src/being.cpp | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) (limited to 'src/being.cpp') 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) -- cgit v1.2.3-60-g2f50