summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorMajin Sniper <majinsniper@gmx.de>2009-03-27 00:04:04 +0100
committerBjørn Lindeijer <bjorn@lindeijer.nl>2009-03-27 00:05:29 +0100
commit2eee8b31f6959902db031e61df6c79249f56c23c (patch)
tree1214361b9cf6a7cb180779344c330fd2769822c6 /src/gui
parent926df5f18460b9c0d273e5c02c984afff7a04079 (diff)
downloadmana-2eee8b31f6959902db031e61df6c79249f56c23c.tar.gz
mana-2eee8b31f6959902db031e61df6c79249f56c23c.tar.bz2
mana-2eee8b31f6959902db031e61df6c79249f56c23c.tar.xz
mana-2eee8b31f6959902db031e61df6c79249f56c23c.zip
Fix the ColorTypes Macro
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/palette.cpp4
-rw-r--r--src/gui/palette.h14
2 files changed, 10 insertions, 8 deletions
diff --git a/src/gui/palette.cpp b/src/gui/palette.cpp
index b1e165aa..b176fcff 100644
--- a/src/gui/palette.cpp
+++ b/src/gui/palette.cpp
@@ -70,11 +70,11 @@ std::string Palette::getConfigName(const std::string &typeName)
return res;
}
-DEFENUMNAMES(ColorType, COLOR_TYPE)
+DEFENUMNAMES(ColorType, COLOR_TYPE);
const int Palette::GRADIENT_DELAY = 40;
-Palette::Palette() :
+Palette::Palette() :
mRainbowTime(tick_time),
mColVector(ColVector(TYPE_COUNT))
{
diff --git a/src/gui/palette.h b/src/gui/palette.h
index fab8cd09..a7172ce0 100644
--- a/src/gui/palette.h
+++ b/src/gui/palette.h
@@ -32,13 +32,15 @@
// Generate strings from an enum ... some preprocessor fun.
#define EDEF(a) a,
+#define LASTEDEF(a) a
#define ECONFIGSTR(a) Palette::getConfigName(#a),
+#define LASTECONFIGSTR(a) Palette::getConfigName(#a)
#define TEXTENUM(name,def)\
- enum name { def(EDEF) };\
- static const std::string name ## Names[];
+ enum name { def(EDEF,LASTEDEF) };\
+ static const std::string name ## Names[]
#define DEFENUMNAMES(name,def)\
- const std::string Palette::name ## Names[] = { def(ECONFIGSTR) "" };
+ const std::string Palette::name ## Names[] = { def(ECONFIGSTR,ECONFIGSTR) "" }
/**
* Class controlling the game's color palette.
@@ -47,7 +49,7 @@ class Palette : public gcn::ListModel
{
public:
/** List of all colors that are configurable. */
- #define COLOR_TYPE(ENTRY)\
+ #define COLOR_TYPE(ENTRY,LASTENTRY)\
ENTRY(TEXT)\
ENTRY(SHADOW)\
ENTRY(OUTLINE)\
@@ -91,9 +93,9 @@ class Palette : public gcn::ListModel
ENTRY(HIT_MONSTER_PLAYER)\
ENTRY(HIT_CRITICAL)\
ENTRY(MISS)\
- ENTRY(TYPE_COUNT)\
+ LASTENTRY(TYPE_COUNT)
- TEXTENUM(ColorType, COLOR_TYPE)
+ TEXTENUM(ColorType, COLOR_TYPE);
/** Colors can be static or can alter over time. */
enum GradientType {