diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-07-23 00:10:43 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-07-23 00:10:43 +0300 |
commit | d97189f055798b5b2051c1c5770a3def62747461 (patch) | |
tree | d66a891dba33d2ce1c882e0de7d6145bb2e0326b /src/being.h | |
parent | 25dce1399e40f24809842303d48ef090439de1e5 (diff) | |
download | plus-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.h')
-rw-r--r-- | src/being.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/being.h b/src/being.h index 289c15e9d..d09e97225 100644 --- a/src/being.h +++ b/src/being.h @@ -46,6 +46,9 @@ #define SPEECH_MIN_TIME 200 #define SPEECH_MAX_TIME 800 +static const int DEFAULT_BEING_WIDTH = 32; +static const int DEFAULT_BEING_HEIGHT = 32; + class AnimatedSprite; class BeingCacheEntry; class Being; @@ -539,12 +542,14 @@ class Being : public ActorSprite, public ConfigListener /** * Returns the horizontal size of the current base sprite of the being. */ - virtual int getWidth() const; + virtual int getWidth() const + { return std::max(CompoundSprite::getWidth(), DEFAULT_BEING_WIDTH); } /** * Returns the vertical size of the current base sprite of the being. */ - virtual int getHeight() const; + virtual int getHeight() const + { return std::max(CompoundSprite::getHeight(), DEFAULT_BEING_HEIGHT); } /** * Returns the being's pixel radius used to detect collisions. |