diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-12-27 01:09:30 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-12-27 23:15:05 +0300 |
commit | 81d317cf80f4c333396c708bbefca16be2362c8c (patch) | |
tree | 1bd2818130625873c50ecbda9b3e826e51c809bb /src/gui/widgets/emoteshortcutcontainer.cpp | |
parent | e56ea6cbf7726b258a4eb6b51a0574cddd862558 (diff) | |
download | manaverse-81d317cf80f4c333396c708bbefca16be2362c8c.tar.gz manaverse-81d317cf80f4c333396c708bbefca16be2362c8c.tar.bz2 manaverse-81d317cf80f4c333396c708bbefca16be2362c8c.tar.xz manaverse-81d317cf80f4c333396c708bbefca16be2362c8c.zip |
Improve containders text draw speed.
Diffstat (limited to 'src/gui/widgets/emoteshortcutcontainer.cpp')
-rw-r--r-- | src/gui/widgets/emoteshortcutcontainer.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/gui/widgets/emoteshortcutcontainer.cpp b/src/gui/widgets/emoteshortcutcontainer.cpp index dcd4fa08e..68296ffc8 100644 --- a/src/gui/widgets/emoteshortcutcontainer.cpp +++ b/src/gui/widgets/emoteshortcutcontainer.cpp @@ -39,6 +39,8 @@ #include "utils/dtor.h" +#include <guichan/font.hpp> + #include "debug.h" static const int MAX_ITEMS = 48; @@ -110,7 +112,8 @@ void EmoteShortcutContainer::draw(gcn::Graphics *graphics) mBackgroundImg->setAlpha(mAlpha); Graphics *const g = static_cast<Graphics *const>(graphics); - graphics->setFont(getFont()); + gcn::Font *const font = getFont(); + graphics->setFont(font); drawBackground(g); graphics->setColor(mForegroundColor); @@ -123,7 +126,7 @@ void EmoteShortcutContainer::draw(gcn::Graphics *graphics) const std::string key = inputManager.getKeyValueString( Input::KEY_EMOTE_1 + i); - g->drawText(key, emoteX + 2, emoteY + 2, gcn::Graphics::LEFT); + font->drawString(g, key, emoteX + 2, emoteY + 2); } const unsigned sz = static_cast<unsigned>(mEmoteImg.size()); for (unsigned i = 0; i < mMaxItems; i++) |