summaryrefslogtreecommitdiff
path: root/src/resources
diff options
context:
space:
mode:
authorSteve Cotton <steve@s.cotton.clara.co.uk>2009-03-16 18:35:22 +0000
committerSteve Cotton <steve@s.cotton.clara.co.uk>2009-03-16 19:06:44 +0000
commite90b7ba7d85edf9e5e020f3781f45ac318e7ea22 (patch)
tree4044dd22df73bc2720dbc970f70dfd2e8267531a /src/resources
parent13b064998c0f7142a134817c9dde08ad29db97fe (diff)
downloadmana-e90b7ba7d85edf9e5e020f3781f45ac318e7ea22.tar.gz
mana-e90b7ba7d85edf9e5e020f3781f45ac318e7ea22.tar.bz2
mana-e90b7ba7d85edf9e5e020f3781f45ac318e7ea22.tar.xz
mana-e90b7ba7d85edf9e5e020f3781f45ac318e7ea22.zip
Rename the old Palette class to DyePalette
Having two classes called Palette makes the program crash, when compiled without optimisation.
Diffstat (limited to 'src/resources')
-rw-r--r--src/resources/dye.cpp14
-rw-r--r--src/resources/dye.h6
2 files changed, 10 insertions, 10 deletions
diff --git a/src/resources/dye.cpp b/src/resources/dye.cpp
index 92176852..38249ddb 100644
--- a/src/resources/dye.cpp
+++ b/src/resources/dye.cpp
@@ -26,7 +26,7 @@
#include "../log.h"
-Palette::Palette(const std::string &description)
+DyePalette::DyePalette(const std::string &description)
{
int size = description.length();
if (size == 0) return;
@@ -63,7 +63,7 @@ Palette::Palette(const std::string &description)
logger->log("Error, invalid embedded palette: %s", description.c_str());
}
-void Palette::getColor(int intensity, int color[3]) const
+void DyePalette::getColor(int intensity, int color[3]) const
{
if (intensity == 0)
{
@@ -112,7 +112,7 @@ void Palette::getColor(int intensity, int color[3]) const
Dye::Dye(const std::string &description)
{
for (int i = 0; i < 7; ++i)
- mPalettes[i] = 0;
+ mDyePalettes[i] = 0;
if (description.empty()) return;
@@ -142,7 +142,7 @@ Dye::Dye(const std::string &description)
logger->log("Error, invalid dye: %s", description.c_str());
return;
}
- mPalettes[i] = new Palette(description.substr(pos + 2, next_pos - pos - 2));
+ mDyePalettes[i] = new DyePalette(description.substr(pos + 2, next_pos - pos - 2));
++next_pos;
}
while (next_pos < length);
@@ -151,7 +151,7 @@ Dye::Dye(const std::string &description)
Dye::~Dye()
{
for (int i = 0; i < 7; ++i)
- delete mPalettes[i];
+ delete mDyePalettes[i];
}
void Dye::update(int color[3]) const
@@ -171,8 +171,8 @@ void Dye::update(int color[3]) const
int i = (color[0] != 0) | ((color[1] != 0) << 1) | ((color[2] != 0) << 2);
- if (mPalettes[i - 1])
- mPalettes[i - 1]->getColor(cmax, color);
+ if (mDyePalettes[i - 1])
+ mDyePalettes[i - 1]->getColor(cmax, color);
}
void Dye::instantiate(std::string &target, const std::string &palettes)
diff --git a/src/resources/dye.h b/src/resources/dye.h
index ef867058..f39ba043 100644
--- a/src/resources/dye.h
+++ b/src/resources/dye.h
@@ -29,7 +29,7 @@
/**
* Class for performing a linear interpolation between colors.
*/
-class Palette
+class DyePalette
{
public:
@@ -38,7 +38,7 @@ class Palette
* The string is either a file name or a sequence of hexadecimal RGB
* values separated by ',' and starting with '#'.
*/
- Palette(const std::string &pallete);
+ DyePalette(const std::string &pallete);
/**
* Gets a pixel color depending on its intensity.
@@ -90,7 +90,7 @@ class Dye
*
* Red, Green, Yellow, Blue, Magenta, White (or rather gray).
*/
- Palette *mPalettes[7];
+ DyePalette *mDyePalettes[7];
};
#endif