summaryrefslogtreecommitdiff
path: root/src/gui/palette.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-02-07 16:18:13 +0300
committerAndrei Karas <akaras@inbox.ru>2016-02-07 16:18:13 +0300
commit9fe21fcd8883b37bdc30224822e6e42afb35b8f0 (patch)
tree798117abd4dc7e610997d59d530a96ddc1509f53 /src/gui/palette.cpp
parent4429cb14e9e187edef27aba692a4266733f79c17 (diff)
downloadManaVerse-9fe21fcd8883b37bdc30224822e6e42afb35b8f0.tar.gz
ManaVerse-9fe21fcd8883b37bdc30224822e6e42afb35b8f0.tar.bz2
ManaVerse-9fe21fcd8883b37bdc30224822e6e42afb35b8f0.tar.xz
ManaVerse-9fe21fcd8883b37bdc30224822e6e42afb35b8f0.zip
Replace most static_cast<Type> to shorter versions from defines.
Diffstat (limited to 'src/gui/palette.cpp')
-rw-r--r--src/gui/palette.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/gui/palette.cpp b/src/gui/palette.cpp
index a56388120..0e3f9560c 100644
--- a/src/gui/palette.cpp
+++ b/src/gui/palette.cpp
@@ -120,7 +120,7 @@ void Palette::advanceGradient()
if (grad == GradientType::PULSE)
{
- colVal = static_cast<int>(255.0 *
+ colVal = CAST_S32(255.0 *
sin(M_PI * colIndex / numOfColors));
const Color &col = elem->testColor;
@@ -135,12 +135,12 @@ void Palette::advanceGradient()
{ // falling curve
if (delay)
{
- colVal = static_cast<int>(255.0 *
+ colVal = CAST_S32(255.0 *
(cos(M_PI * pos / delay) + 1) / 2);
}
else
{
- colVal = static_cast<int>(255.0 *
+ colVal = CAST_S32(255.0 *
(cos(M_PI * pos) + 1) / 2);
}
}
@@ -148,12 +148,12 @@ void Palette::advanceGradient()
{ // ascending curve
if (delay)
{
- colVal = static_cast<int>(255.0 * (cos(M_PI *
+ colVal = CAST_S32(255.0 * (cos(M_PI *
(delay - pos) / delay) + 1) / 2);
}
else
{
- colVal = static_cast<int>(255.0 * (cos(M_PI *
+ colVal = CAST_S32(255.0 * (cos(M_PI *
(delay - pos)) + 1) / 2);
}
}
@@ -180,13 +180,13 @@ void Palette::advanceGradient()
destColVal = 1 - startColVal;
- color.r = static_cast<int>(startColVal
+ color.r = CAST_S32(startColVal
* startCol.r + destColVal * destCol.r);
- color.g = static_cast<int>(startColVal
+ color.g = CAST_S32(startColVal
* startCol.g + destColVal * destCol.g);
- color.b = static_cast<int>(startColVal
+ color.b = CAST_S32(startColVal
* startCol.b + destColVal * destCol.b);
}
}