summaryrefslogtreecommitdiff
path: root/src/gui/userpalette.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-03-31 16:54:22 +0300
committerAndrei Karas <akaras@inbox.ru>2012-04-01 03:56:16 +0300
commit761682b6254a3d43e65ff45e07683c61afa6f1e4 (patch)
tree2ee462840f3aadb1e96bfa5c6784ec2cc0d2861a /src/gui/userpalette.cpp
parenta39f63cdfa5ce15b22f294a8bb1db3a036ce462d (diff)
downloadplus-761682b6254a3d43e65ff45e07683c61afa6f1e4.tar.gz
plus-761682b6254a3d43e65ff45e07683c61afa6f1e4.tar.bz2
plus-761682b6254a3d43e65ff45e07683c61afa6f1e4.tar.xz
plus-761682b6254a3d43e65ff45e07683c61afa6f1e4.zip
Last part of fixes.
Diffstat (limited to 'src/gui/userpalette.cpp')
-rw-r--r--src/gui/userpalette.cpp23
1 files changed, 13 insertions, 10 deletions
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<char>(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;
}
}
}