summaryrefslogtreecommitdiff
path: root/src/player.cpp
diff options
context:
space:
mode:
authorFate <fate.tmw@googlemail.com>2008-11-01 23:45:48 +0000
committerFate <fate.tmw@googlemail.com>2008-11-01 23:45:48 +0000
commit8f1bf397990729c3a807bbbe0b643bc97446c923 (patch)
treeb2a531da277eeb9b48d3f0342dd96a4963b275d1 /src/player.cpp
parent4cfdb3620ccbd0de6bd53c5f22e7b6d3801627bf (diff)
downloadmana-8f1bf397990729c3a807bbbe0b643bc97446c923.tar.gz
mana-8f1bf397990729c3a807bbbe0b643bc97446c923.tar.bz2
mana-8f1bf397990729c3a807bbbe0b643bc97446c923.tar.xz
mana-8f1bf397990729c3a807bbbe0b643bc97446c923.zip
* Use hair.xml to determine hair colours (#514)
* Auto-detect number of hair styles available (#514)
Diffstat (limited to 'src/player.cpp')
-rw-r--r--src/player.cpp22
1 files changed, 5 insertions, 17 deletions
diff --git a/src/player.cpp b/src/player.cpp
index f86e7179..0e88da0b 100644
--- a/src/player.cpp
+++ b/src/player.cpp
@@ -140,27 +140,13 @@ void Player::setGender(int gender)
void Player::setHairStyle(int style, int color)
{
- style = style < 0 ? mHairStyle : style % NR_HAIR_STYLES;
- color = color < 0 ? mHairColor : color % NR_HAIR_COLORS;
+ style = style < 0 ? mHairStyle : style % getHairStylesNr();
+ color = color < 0 ? mHairColor : color % getHairColorsNr();
if (style == mHairStyle && color == mHairColor) return;
Being::setHairStyle(style, 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
- };
-
- setSprite(HAIR_SPRITE, style * -1, colors[color]);
+ setSprite(HAIR_SPRITE, style * -1, getHairColor(color));
setAction(mAction);
}
@@ -209,3 +195,5 @@ void Player::updateCoords()
mName->adviseXY(mPx + NAME_X_OFFSET, mPy + NAME_Y_OFFSET);
}
}
+
+