summaryrefslogtreecommitdiff
path: root/src/gui/palette.cpp
diff options
context:
space:
mode:
authorPhilipp Sehmisch <mana@crushnet.org>2011-06-19 14:29:42 +0200
committerPhilipp Sehmisch <mana@crushnet.org>2011-06-19 14:29:42 +0200
commitd42f25aa5b8c8f356ab08397d23047e226d57b24 (patch)
treecc64b36c182a388e9dad9aefba890f31fccc578c /src/gui/palette.cpp
parent98a6003999eb198d9b953c11cca43aad181788c9 (diff)
downloadmana-client-d42f25aa5b8c8f356ab08397d23047e226d57b24.tar.gz
mana-client-d42f25aa5b8c8f356ab08397d23047e226d57b24.tar.bz2
mana-client-d42f25aa5b8c8f356ab08397d23047e226d57b24.tar.xz
mana-client-d42f25aa5b8c8f356ab08397d23047e226d57b24.zip
More C++0x Windows compilation fixes.
Another case of M_PI being no longer defined in cmath.h _MAX_PATH doesn't work anymore, but there is still MAX_PATH putenv doesn't work anymore, so I replaced it with a function from the WINApi Reviewed-by: Thorbjorn
Diffstat (limited to 'src/gui/palette.cpp')
-rw-r--r--src/gui/palette.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/gui/palette.cpp b/src/gui/palette.cpp
index 9ddbb34d..53bb505e 100644
--- a/src/gui/palette.cpp
+++ b/src/gui/palette.cpp
@@ -32,6 +32,7 @@
#include <math.h>
+static const double PI = 3.14159265;
const gcn::Color Palette::BLACK = gcn::Color(0, 0, 0);
Palette::Palettes Palette::mInstances;
@@ -116,7 +117,7 @@ void Palette::advanceGradient()
if (mGradVector[i]->grad == PULSE)
{
- colVal = (int) (255.0 * sin(M_PI * colIndex / numOfColors));
+ colVal = (int) (255.0 * sin(PI * colIndex / numOfColors));
const gcn::Color &col = mGradVector[i]->testColor;
@@ -128,11 +129,11 @@ void Palette::advanceGradient()
{
if (colIndex % 2)
{ // falling curve
- colVal = (int)(255.0 * (cos(M_PI * pos / delay) + 1) / 2);
+ colVal = (int)(255.0 * (cos(PI * pos / delay) + 1) / 2);
}
else
{ // ascending curve
- colVal = (int)(255.0 * (cos(M_PI * (delay - pos) / delay) +
+ colVal = (int)(255.0 * (cos(PI * (delay - pos) / delay) +
1) / 2);
}
@@ -152,7 +153,7 @@ void Palette::advanceGradient()
const gcn::Color &destCol =
RAINBOW_COLORS[(colIndex + 1) % numOfColors];
- startColVal = (cos(M_PI * pos / delay) + 1) / 2;
+ startColVal = (cos(PI * pos / delay) + 1) / 2;
destColVal = 1 - startColVal;
mGradVector[i]->color.r =(int)(startColVal * startCol.r +