summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--src/player.cpp16
2 files changed, 19 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index d91da7b9..88eee5ca 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -9,6 +9,10 @@
palettes on sprite names.
* data/graphics/sprites/monster-scorpion-black.xml,
data/graphics/sprites/monster-scorpion-red.xml: Removed obsolete files.
+ * src/player.cpp: Added hair colors.
+ * data/graphics/sprites/hairstyle*.xml: Removed sprite variants. Set
+ replaceable color.
+ * data/graphics/sprites/hairstyle*.png: Reduced image sizes.
2007-11-03 Guillaume Melquiond <guillaume.melquiond@gmail.com>
diff --git a/src/player.cpp b/src/player.cpp
index 062c1135..f928aeb1 100644
--- a/src/player.cpp
+++ b/src/player.cpp
@@ -112,8 +112,22 @@ void Player::setHairStyle(int style, int color)
mHairStyle = style;
mHairColor = color;
+ static char const *const colors[NR_HAIR_COLORS] =
+ {
+ "#8c4b41,da9041,ffffff", // light brown
+ "#06372b,489e25,fdedcc", // green
+ "#5f0b33,91191c,f9ad81", // red
+ "#602486,934cc3,fdc689", // purple
+ "#805e74,c6b09b,ffffff", // gray
+ "#8c6625,dab425,ffffff", // yellow
+ "#1d2d6d,1594a3,fdedcc", // blue
+ "#831f2d,be4f2d,f8cc8b", // brown
+ "#432482,584bbc,dae8e5", // light blue
+ "#460850,611967,e7b4ae", // dark purple
+ };
+
AnimatedSprite *newHairSprite = AnimatedSprite::load
- (strprintf("graphics/sprites/hairstyle%d.xml", style), color);
+ (strprintf("graphics/sprites/hairstyle%d.xml|%s", style, colors[color]));
if (newHairSprite)
newHairSprite->setDirection(getSpriteDirection());