diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-05-25 01:58:52 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-05-25 01:58:52 +0300 |
commit | e3682e2cdcb59c36792f6f9c39569e0af01088f0 (patch) | |
tree | b4d7a665652e4a8c00f28d557f96b120abc62002 /src/gui/widgets/skilllistbox.h | |
parent | 1b3a9751ae558e45c614f04525d5ff65e3c0fc1e (diff) | |
download | mv-e3682e2cdcb59c36792f6f9c39569e0af01088f0.tar.gz mv-e3682e2cdcb59c36792f6f9c39569e0af01088f0.tar.bz2 mv-e3682e2cdcb59c36792f6f9c39569e0af01088f0.tar.xz mv-e3682e2cdcb59c36792f6f9c39569e0af01088f0.zip |
Dont set global color variables before drawing text.
This allow not set actual OpenGL color on each call
because it useless for drawing text.
Diffstat (limited to 'src/gui/widgets/skilllistbox.h')
-rw-r--r-- | src/gui/widgets/skilllistbox.h | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/src/gui/widgets/skilllistbox.h b/src/gui/widgets/skilllistbox.h index 344bffa59..e012aabd3 100644 --- a/src/gui/widgets/skilllistbox.h +++ b/src/gui/widgets/skilllistbox.h @@ -133,7 +133,6 @@ class SkillListBox final : public ListBox } } - graphics->setColorAll(mTextColor, mTextColor2); for (int i = 0, y = 1 + mPadding; i < model->getNumberOfElements(); ++i, y += getRowHeight()) @@ -144,11 +143,19 @@ class SkillListBox final : public ListBox const SkillData *const data = e->data; const std::string &description = data->description; graphics->drawImage(data->icon, mPadding, y); - font->drawString(graphics, data->name, mTextPadding, y); + font->drawString(graphics, + mTextColor, + mTextColor2, + data->name, + mTextPadding, y); if (!description.empty()) { - font->drawString(graphics, description, - mTextPadding, y + space); + font->drawString(graphics, + mTextColor, + mTextColor2, + description, + mTextPadding, + y + space); } if (e->skillLevelWidth < 0) @@ -157,8 +164,12 @@ class SkillListBox final : public ListBox e->skillLevelWidth = font->getWidth(e->skillLevel) + 1; } - font->drawString(graphics, e->skillLevel, width2 - - e->skillLevelWidth, y); + font->drawString(graphics, + mTextColor, + mTextColor2, + e->skillLevel, + width2 - e->skillLevelWidth, + y); } } } |