diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-06-22 15:55:34 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-06-22 15:55:34 +0300 |
commit | 04f47f060f94ec0e2dfc3cccf62cff167e0ecd68 (patch) | |
tree | 206bd9f2fa3ea57c74c143aa06deddf44d6d0bea /src/gui/widgets/avatarlistbox.cpp | |
parent | 60ae9c1b34a6fe98dfde22e38ec95e65d7cdcf1c (diff) | |
download | manaplus-04f47f060f94ec0e2dfc3cccf62cff167e0ecd68.tar.gz manaplus-04f47f060f94ec0e2dfc3cccf62cff167e0ecd68.tar.bz2 manaplus-04f47f060f94ec0e2dfc3cccf62cff167e0ecd68.tar.xz manaplus-04f47f060f94ec0e2dfc3cccf62cff167e0ecd68.zip |
Reoder some text and image drawing for better batching.
Diffstat (limited to 'src/gui/widgets/avatarlistbox.cpp')
-rw-r--r-- | src/gui/widgets/avatarlistbox.cpp | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/src/gui/widgets/avatarlistbox.cpp b/src/gui/widgets/avatarlistbox.cpp index a9ef12c99..ae7a745bc 100644 --- a/src/gui/widgets/avatarlistbox.cpp +++ b/src/gui/widgets/avatarlistbox.cpp @@ -146,6 +146,23 @@ void AvatarListBox::draw(Graphics *graphics) } } } + } + + if (useCaching) + { + graphics->finalize(&vertexes); + graphics->drawTileCollection(&vertexes); + } + + graphics->setColorAll(mForegroundColor, mForegroundColor2); + + for (int i = 0, y = 0; + i < model->getNumberOfElements(); + ++i, y += fontHeight) + { + const Avatar *const a = model->getAvatarAt(i); + if (!a) + continue; std::string text; @@ -281,8 +298,6 @@ void AvatarListBox::draw(Graphics *graphics) } } - graphics->setColorAll(mForegroundColor, mForegroundColor2); - // Draw Name if (a->getDisplayBold()) { @@ -312,12 +327,6 @@ void AvatarListBox::draw(Graphics *graphics) } } - if (useCaching) - { - graphics->finalize(&vertexes); - graphics->drawTileCollection(&vertexes); - } - setWidth(parent->getWidth() - 10); BLOCK_END("AvatarListBox::draw") } |