diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-12-17 16:23:15 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-12-17 16:23:15 +0300 |
commit | fa1bd85d4461a0a35f8843ac0965e2de5fd6b27e (patch) | |
tree | f7201baebfa949ece2c93130c89f565c202db6cc /src/being/being.cpp | |
parent | a714d83889a34d30b542c3c6ab7c49228fe71f53 (diff) | |
download | plus-fa1bd85d4461a0a35f8843ac0965e2de5fd6b27e.tar.gz plus-fa1bd85d4461a0a35f8843ac0965e2de5fd6b27e.tar.bz2 plus-fa1bd85d4461a0a35f8843ac0965e2de5fd6b27e.tar.xz plus-fa1bd85d4461a0a35f8843ac0965e2de5fd6b27e.zip |
improve a bit draw speed in over head texts.
Diffstat (limited to 'src/being/being.cpp')
-rw-r--r-- | src/being/being.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/being/being.cpp b/src/being/being.cpp index 34f6b64ce..2458f33c4 100644 --- a/src/being/being.cpp +++ b/src/being/being.cpp @@ -500,6 +500,12 @@ void Being::setSpeech(const std::string &text, const std::string &channel, &userPalette->getColor(UserPalette::PARTICLE), true); } + else + { + const bool isShowName = (speech == NAME_IN_BUBBLE); + mSpeechBubble->setCaption(isShowName ? mName : ""); + mSpeechBubble->setText(mSpeech, isShowName); + } } void Being::takeDamage(Being *const attacker, const int amount, @@ -1631,14 +1637,10 @@ void Being::drawSpeech(const int offsetX, const int offsetY) else if (mSpeechTime > 0 && (speech == NAME_IN_BUBBLE || speech == NO_NAME_IN_BUBBLE)) { - const bool isShowName = (speech == NAME_IN_BUBBLE); - delete mText; mText = nullptr; - mSpeechBubble->setCaption(isShowName ? mName : ""); - - mSpeechBubble->setText(mSpeech, isShowName); + const bool isShowName = (speech == NAME_IN_BUBBLE); mSpeechBubble->setPosition(px - (mSpeechBubble->getWidth() / 2), py - getHeight() - (mSpeechBubble->getHeight())); mSpeechBubble->setVisible(true); |