diff options
author | Philipp Sehmisch <mana@crushnet.org> | 2011-06-19 14:29:42 +0200 |
---|---|---|
committer | Philipp Sehmisch <mana@crushnet.org> | 2011-06-19 14:29:42 +0200 |
commit | d42f25aa5b8c8f356ab08397d23047e226d57b24 (patch) | |
tree | cc64b36c182a388e9dad9aefba890f31fccc578c /src | |
parent | 98a6003999eb198d9b953c11cca43aad181788c9 (diff) | |
download | mana-d42f25aa5b8c8f356ab08397d23047e226d57b24.tar.gz mana-d42f25aa5b8c8f356ab08397d23047e226d57b24.tar.bz2 mana-d42f25aa5b8c8f356ab08397d23047e226d57b24.tar.xz mana-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')
-rw-r--r-- | src/gui/palette.cpp | 9 | ||||
-rw-r--r-- | src/main.cpp | 2 | ||||
-rw-r--r-- | src/utils/specialfolder.cpp | 2 |
3 files changed, 7 insertions, 6 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 + diff --git a/src/main.cpp b/src/main.cpp index 41f1c3d5..08ae4a8c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -173,7 +173,7 @@ static void initInternationalization() { #if ENABLE_NLS #ifdef WIN32 - putenv(("LANG=" + std::string(_nl_locale_name_default())).c_str()); + SetEnvironmentVariable("LANG", _nl_locale_name_default()); // mingw doesn't like LOCALEDIR to be defined for some reason bindtextdomain("mana", "translations/"); #else diff --git a/src/utils/specialfolder.cpp b/src/utils/specialfolder.cpp index 221aeac2..63337578 100644 --- a/src/utils/specialfolder.cpp +++ b/src/utils/specialfolder.cpp @@ -39,7 +39,7 @@ std::string getSpecialFolderLocation(int folderId) std::string ret; LPITEMIDLIST pItemIdList; LPMALLOC pMalloc; - char szPath[_MAX_PATH]; + char szPath[MAX_PATH]; // get the item ID list for folderId HRESULT hr = SHGetSpecialFolderLocation(NULL, folderId, &pItemIdList); |