summaryrefslogtreecommitdiff
path: root/src/gui/palette.h
diff options
context:
space:
mode:
authorMajin Sniper <majinsniper@gmx.de>2009-03-27 00:04:04 +0100
committerIra Rice <irarice@gmail.com>2009-03-26 17:38:57 -0600
commitd26a7795fa90c6e26f5302db4a470321bce4a5cb (patch)
tree2d123cf09d5ff8dd80ad9bc56325a56a439bcdde /src/gui/palette.h
parentf883ad28b77a499fa66497158db425ce1db50f78 (diff)
downloadmana-d26a7795fa90c6e26f5302db4a470321bce4a5cb.tar.gz
mana-d26a7795fa90c6e26f5302db4a470321bce4a5cb.tar.bz2
mana-d26a7795fa90c6e26f5302db4a470321bce4a5cb.tar.xz
mana-d26a7795fa90c6e26f5302db4a470321bce4a5cb.zip
Fix the ColorTypes Macro
Diffstat (limited to 'src/gui/palette.h')
-rw-r--r--src/gui/palette.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/gui/palette.h b/src/gui/palette.h
index 16c9338c..e894ba74 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 {