From 761682b6254a3d43e65ff45e07683c61afa6f1e4 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 31 Mar 2012 16:54:22 +0300 Subject: Last part of fixes. --- src/gui/userpalette.cpp | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'src/gui/userpalette.cpp') diff --git a/src/gui/userpalette.cpp b/src/gui/userpalette.cpp index a3299fb7b..49a81c4dc 100644 --- a/src/gui/userpalette.cpp +++ b/src/gui/userpalette.cpp @@ -82,7 +82,7 @@ std::string UserPalette::getConfigName(const std::string &typeName) { std::string res = "Color" + typeName; - int pos = 5; + size_t pos = 5; for (size_t i = 0; i < typeName.length(); i++) { if (i == 0 || typeName[i] == '_') @@ -96,7 +96,7 @@ std::string UserPalette::getConfigName(const std::string &typeName) { res[pos] = static_cast(tolower(typeName[i])); } - pos++; + pos ++; } res.erase(pos, res.length() - pos); @@ -191,9 +191,10 @@ UserPalette::~UserPalette() void UserPalette::setColor(int type, int r, int g, int b) { - mColors[type].color.r = r; - mColors[type].color.g = g; - mColors[type].color.b = b; + gcn::Color &color = mColors[type].color; + color.r = r; + color.g = g; + color.b = b; } void UserPalette::setGradient(int type, GradientType grad) @@ -252,15 +253,17 @@ void UserPalette::rollback() if (i->grad != i->committedGrad) setGradient(i->type, i->committedGrad); + const gcn::Color &committedColor = i->committedColor; setGradientDelay(i->type, i->committedDelay); - setColor(i->type, i->committedColor.r, - i->committedColor.g, i->committedColor.b); + setColor(i->type, committedColor.r, + committedColor.g, committedColor.b); if (i->grad == PULSE) { - i->testColor.r = i->committedColor.r; - i->testColor.g = i->committedColor.g; - i->testColor.b = i->committedColor.b; + gcn::Color &testColor = i->testColor; + testColor.r = committedColor.r; + testColor.g = committedColor.g; + testColor.b = committedColor.b; } } } -- cgit v1.2.3-60-g2f50