summaryrefslogtreecommitdiff
path: root/src/gui/palette.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-08-27 21:18:46 +0300
committerAndrei Karas <akaras@inbox.ru>2012-08-27 21:44:17 +0300
commit7c79aa2b8e484319e3e511fa21db6d2448347024 (patch)
tree3c4fb4e72414dd8c0d93401a6bf2cc86b65a34a0 /src/gui/palette.cpp
parentde476bb95242e10c833394ef007728072eabe60f (diff)
downloadmanaplus-7c79aa2b8e484319e3e511fa21db6d2448347024.tar.gz
manaplus-7c79aa2b8e484319e3e511fa21db6d2448347024.tar.bz2
manaplus-7c79aa2b8e484319e3e511fa21db6d2448347024.tar.xz
manaplus-7c79aa2b8e484319e3e511fa21db6d2448347024.zip
Add const to more classes.
Diffstat (limited to 'src/gui/palette.cpp')
-rw-r--r--src/gui/palette.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/gui/palette.cpp b/src/gui/palette.cpp
index f0380153f..94604c128 100644
--- a/src/gui/palette.cpp
+++ b/src/gui/palette.cpp
@@ -52,7 +52,7 @@ const gcn::Color Palette::RAINBOW_COLORS[7] =
/** Number of Elemets of RAINBOW_COLORS */
const int Palette::RAINBOW_COLOR_COUNT = 7;
-Palette::Palette(int size) :
+Palette::Palette(const int size) :
mRainbowTime(tick_time),
mColors(Colors(size))
{
@@ -64,9 +64,9 @@ Palette::~Palette()
mInstances.erase(this);
}
-const gcn::Color& Palette::getColor(char c, bool &valid)
+const gcn::Color& Palette::getColor(const char c, bool &valid)
{
- CharColors::const_iterator it = mCharColors.find(c);
+ const CharColors::const_iterator it = mCharColors.find(c);
if (it != mCharColors.end())
{
valid = true;
@@ -94,7 +94,7 @@ void Palette::advanceGradient()
// For slower systems, advance can be greater than one (advance > 1
// skips advance-1 steps). Should make gradient look the same
// independent of the framerate.
- int advance = get_elapsed_time(mRainbowTime) / 5;
+ const int advance = get_elapsed_time(mRainbowTime) / 5;
double startColVal, destColVal;
for (size_t i = 0, sz = mGradVector.size(); i < sz; i++)
@@ -121,7 +121,7 @@ void Palette::advanceGradient()
else
colIndex = mGradVector[i]->gradientIndex;
- ColorElem *elem = mGradVector[i];
+ ColorElem *const elem = mGradVector[i];
gcn::Color &color = elem->color;
if (elem->grad == PULSE)