diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-09-20 00:36:45 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-09-20 03:48:29 +0300 |
commit | f6dbee24b6a16dc4316ee5b7ebb9863723441ec4 (patch) | |
tree | 48341149c625abd74e5a6d6c7ab25f634e8ea22f /src | |
parent | c657b6d4380dcf57634236bdb3b77179b5d81b91 (diff) | |
download | mv-f6dbee24b6a16dc4316ee5b7ebb9863723441ec4.tar.gz mv-f6dbee24b6a16dc4316ee5b7ebb9863723441ec4.tar.bz2 mv-f6dbee24b6a16dc4316ee5b7ebb9863723441ec4.tar.xz mv-f6dbee24b6a16dc4316ee5b7ebb9863723441ec4.zip |
Fix incorrect color access.
Diffstat (limited to 'src')
-rw-r--r-- | src/being.cpp | 2 | ||||
-rw-r--r-- | src/gui/palette.h | 17 |
2 files changed, 12 insertions, 7 deletions
diff --git a/src/being.cpp b/src/being.cpp index 5e52901f6..248b70b80 100644 --- a/src/being.cpp +++ b/src/being.cpp @@ -1636,7 +1636,7 @@ void Being::updateColors() } else { - mTextColor = &userPalette->getColor(Theme::PLAYER); + mTextColor = &Theme::getThemeColor(Theme::PLAYER); mErased = false; diff --git a/src/gui/palette.h b/src/gui/palette.h index 38bd83ffb..b1111c56b 100644 --- a/src/gui/palette.h +++ b/src/gui/palette.h @@ -78,6 +78,11 @@ class Palette */ inline const gcn::Color &getColor(int type, int alpha = 255) { +// if (type >= (signed)mColors.size()) +// { +// logger->log("request type: %d", type); +// logger->log("size: %ld", mColors.size()); +// } gcn::Color* col = &mColors[type].color; col->a = alpha; return *col; @@ -182,12 +187,12 @@ class Palette void set(const int type0, const gcn::Color &color0, const GradientType grad0, const int delay0) { - ColorElem::type = type0; - ColorElem::color = color0; - ColorElem::testColor = color0; - ColorElem::grad = grad0; - ColorElem::delay = delay0; - ColorElem::gradientIndex = rand(); + type = type0; + color = color0; + testColor = color0; + grad = grad0; + delay = delay0; + gradientIndex = rand(); } inline int getRGB() const |