summaryrefslogtreecommitdiff
path: root/src/gui/palette.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-05-30 16:04:27 +0300
committerAndrei Karas <akaras@inbox.ru>2015-05-30 16:04:27 +0300
commitdc8422dbac2c45a082153240138d699c1bfc3b88 (patch)
treed073286b567fe45179440e678be779c8eb8c0f0e /src/gui/palette.cpp
parentaa86dbe6a7c966a4bfa7aa6c81218fe58f0bf92d (diff)
downloadmanaverse-dc8422dbac2c45a082153240138d699c1bfc3b88.tar.gz
manaverse-dc8422dbac2c45a082153240138d699c1bfc3b88.tar.bz2
manaverse-dc8422dbac2c45a082153240138d699c1bfc3b88.tar.xz
manaverse-dc8422dbac2c45a082153240138d699c1bfc3b88.zip
Move gradient type into separate file.
Diffstat (limited to 'src/gui/palette.cpp')
-rw-r--r--src/gui/palette.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/gui/palette.cpp b/src/gui/palette.cpp
index 4935ce60d..88de9d5d0 100644
--- a/src/gui/palette.cpp
+++ b/src/gui/palette.cpp
@@ -108,13 +108,13 @@ void Palette::advanceGradient()
continue;
int delay = elem->delay;
- const GradientType &grad = elem->grad;
+ const GradientTypeT &grad = elem->grad;
- if (grad == PULSE)
+ if (grad == GradientType::PULSE)
delay = delay / 20;
- const int numOfColors = (elem->grad == SPECTRUM ? 6 :
- grad == PULSE ? 127 :
+ const int numOfColors = (elem->grad == GradientType::SPECTRUM ? 6 :
+ grad == GradientType::PULSE ? 127 :
RAINBOW_COLOR_COUNT);
elem->gradientIndex = (elem->gradientIndex + advance)
@@ -131,7 +131,7 @@ void Palette::advanceGradient()
Color &color = elem->color;
int colVal;
- if (grad == PULSE)
+ if (grad == GradientType::PULSE)
{
colVal = static_cast<int>(255.0 *
sin(M_PI * colIndex / numOfColors));
@@ -142,7 +142,7 @@ void Palette::advanceGradient()
color.g = ((colVal * col.g) / 255) % (col.g + 1);
color.b = ((colVal * col.b) / 255) % (col.b + 1);
}
- else if (grad == SPECTRUM)
+ else if (grad == GradientType::SPECTRUM)
{
if (colIndex % 2)
{ // falling curve
@@ -178,7 +178,7 @@ void Palette::advanceGradient()
color.b = (colIndex == 3 || colIndex == 4) ? 255 :
(colIndex == 2 || colIndex == 5) ? colVal : 0;
}
- else if (elem->grad == RAINBOW)
+ else if (elem->grad == GradientType::RAINBOW)
{
const Color &startCol = RAINBOW_COLORS[colIndex];
const Color &destCol