summaryrefslogtreecommitdiff
path: root/src/gui/widgets/emoteshortcutcontainer.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-06-22 15:55:34 +0300
committerAndrei Karas <akaras@inbox.ru>2014-06-22 15:55:34 +0300
commit04f47f060f94ec0e2dfc3cccf62cff167e0ecd68 (patch)
tree206bd9f2fa3ea57c74c143aa06deddf44d6d0bea /src/gui/widgets/emoteshortcutcontainer.cpp
parent60ae9c1b34a6fe98dfde22e38ec95e65d7cdcf1c (diff)
downloadmv-04f47f060f94ec0e2dfc3cccf62cff167e0ecd68.tar.gz
mv-04f47f060f94ec0e2dfc3cccf62cff167e0ecd68.tar.bz2
mv-04f47f060f94ec0e2dfc3cccf62cff167e0ecd68.tar.xz
mv-04f47f060f94ec0e2dfc3cccf62cff167e0ecd68.zip
Reoder some text and image drawing for better batching.
Diffstat (limited to 'src/gui/widgets/emoteshortcutcontainer.cpp')
-rw-r--r--src/gui/widgets/emoteshortcutcontainer.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/gui/widgets/emoteshortcutcontainer.cpp b/src/gui/widgets/emoteshortcutcontainer.cpp
index 0d802034e..1e438f119 100644
--- a/src/gui/widgets/emoteshortcutcontainer.cpp
+++ b/src/gui/widgets/emoteshortcutcontainer.cpp
@@ -96,18 +96,6 @@ void EmoteShortcutContainer::draw(Graphics *graphics)
Font *const font = getFont();
drawBackground(graphics);
- graphics->setColorAll(mForegroundColor, mForegroundColor2);
- for (unsigned i = 0; i < mMaxItems; i++)
- {
- const int emoteX = (i % mGridWidth) * mBoxWidth;
- const int emoteY = (i / mGridWidth) * mBoxHeight;
-
- // Draw emote keyboard shortcut.
- const std::string key = inputManager.getKeyValueString(
- InputAction::EMOTE_1 + i);
-
- font->drawString(graphics, key, emoteX + 2, emoteY + 2);
- }
unsigned sz = static_cast<unsigned>(mEmoteImg.size());
if (sz > mMaxItems)
sz = mMaxItems;
@@ -125,6 +113,18 @@ void EmoteShortcutContainer::draw(Graphics *graphics)
}
}
}
+ graphics->setColorAll(mForegroundColor, mForegroundColor2);
+ for (unsigned i = 0; i < mMaxItems; i++)
+ {
+ const int emoteX = (i % mGridWidth) * mBoxWidth;
+ const int emoteY = (i / mGridWidth) * mBoxHeight;
+
+ // Draw emote keyboard shortcut.
+ const std::string key = inputManager.getKeyValueString(
+ InputAction::EMOTE_1 + i);
+
+ font->drawString(graphics, key, emoteX + 2, emoteY + 2);
+ }
BLOCK_END("EmoteShortcutContainer::draw")
}