From e3682e2cdcb59c36792f6f9c39569e0af01088f0 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 25 May 2015 01:58:52 +0300 Subject: Dont set global color variables before drawing text. This allow not set actual OpenGL color on each call because it useless for drawing text. --- src/gui/widgets/skilllistbox.h | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'src/gui/widgets/skilllistbox.h') 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); } } } -- cgit v1.2.3-70-g09d2