diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-08-21 00:45:24 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-08-21 00:45:24 +0300 |
commit | cfa5391c1be51ef49380e398a72c813255d6316e (patch) | |
tree | 32e9f77ae80e72a6388923dddb90721e661394e5 /src/gui/userpalette.cpp | |
parent | 31acb66791e27b6cfa846302156ad2e7a88f5f04 (diff) | |
download | manaverse-cfa5391c1be51ef49380e398a72c813255d6316e.tar.gz manaverse-cfa5391c1be51ef49380e398a72c813255d6316e.tar.bz2 manaverse-cfa5391c1be51ef49380e398a72c813255d6316e.tar.xz manaverse-cfa5391c1be51ef49380e398a72c813255d6316e.zip |
first part of checks and style fixes.
Diffstat (limited to 'src/gui/userpalette.cpp')
-rw-r--r-- | src/gui/userpalette.cpp | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/src/gui/userpalette.cpp b/src/gui/userpalette.cpp index 5d878a0f0..69c2b7093 100644 --- a/src/gui/userpalette.cpp +++ b/src/gui/userpalette.cpp @@ -25,12 +25,10 @@ #include "configuration.h" #include "client.h" -#include "logger.h" #include "gui/gui.h" #include "utils/gettext.h" -#include "utils/stringutils.h" #include <math.h> @@ -192,7 +190,8 @@ UserPalette::~UserPalette() } } -void UserPalette::setColor(int type, int r, int g, int b) +void UserPalette::setColor(const int type, const int r, + const int g, const int b) { gcn::Color &color = mColors[type].color; color.r = r; @@ -200,11 +199,9 @@ void UserPalette::setColor(int type, int r, int g, int b) color.b = b; } -void UserPalette::setGradient(int type, GradientType grad) +void UserPalette::setGradient(const int type, const GradientType grad) { - ColorElem *elem = &mColors[type]; - if (!elem) - return; + ColorElem *const elem = &mColors[type]; if (elem->grad != STATIC && grad == STATIC) { @@ -234,7 +231,7 @@ std::string UserPalette::getElementAt(int i) return mColors[i].text; } -void UserPalette::commit(bool commitNonStatic) +void UserPalette::commit(const bool commitNonStatic) { for (Colors::iterator i = mColors.begin(), iEnd = mColors.end(); i != iEnd; ++i) @@ -279,8 +276,9 @@ int UserPalette::getColorTypeAt(int i) return mColors[i].type; } -void UserPalette::addColor(unsigned type, unsigned rgb, - Palette::GradientType grad, const std::string &text, +void UserPalette::addColor(const unsigned type, const unsigned rgb, + Palette::GradientType grad, + const std::string &text, int delay) { const unsigned maxType = sizeof(ColorTypeNames) |