summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2009-06-08 08:23:48 -0600
committerJared Adams <jaxad0127@gmail.com>2009-06-08 08:25:48 -0600
commitc79406e025a17ec29afca2458f916d3f2d49447d (patch)
tree21e303ea6dd2b1f9bdecae62ed00effd23cfa824 /src
parentc79d89473114756edfc426a2b93149056031fae1 (diff)
downloadmana-c79406e025a17ec29afca2458f916d3f2d49447d.tar.gz
mana-c79406e025a17ec29afca2458f916d3f2d49447d.tar.bz2
mana-c79406e025a17ec29afca2458f916d3f2d49447d.tar.xz
mana-c79406e025a17ec29afca2458f916d3f2d49447d.zip
Remove duplicate code from Being
Diffstat (limited to 'src')
-rw-r--r--src/being.cpp41
-rw-r--r--src/being.h4
2 files changed, 0 insertions, 45 deletions
diff --git a/src/being.cpp b/src/being.cpp
index 3593bb94..4f28425e 100644
--- a/src/being.cpp
+++ b/src/being.cpp
@@ -917,19 +917,6 @@ int Being::getHairStyleCount()
return mNumberOfHairstyles;
}
-int Being::getHairColorCount()
-{
- return mNumberOfHairColors;
-}
-
-std::string Being::getHairColor(int index)
-{
- if (index < 0 || index >= mNumberOfHairColors)
- return "#000000";
-
- return hairColors[index];
-}
-
void Being::load()
{
// Hairstyles are encoded as negative numbers. Count how far negative
@@ -940,32 +927,4 @@ void Being::load()
hairstyles++;
mNumberOfHairstyles = hairstyles;
-
- XML::Document doc(HAIR_FILE);
- xmlNodePtr root = doc.rootNode();
-
- // Add an initial hair color
- hairColors.resize(1, "#000000");
-
- if (!root || !xmlStrEqual(root->name, BAD_CAST "colors"))
- {
- logger->log("Error loading being hair configuration file");
- } else {
- for_each_xml_child_node(node, root)
- {
- if (xmlStrEqual(node->name, BAD_CAST "color"))
- {
- int index = atoi(XML::getProperty(node, "id", "-1").c_str());
- std::string value = XML::getProperty(node, "value", "");
-
- if (index >= 0 && !value.empty()) {
- if (index >= mNumberOfHairColors) {
- mNumberOfHairColors = index + 1;
- hairColors.resize(mNumberOfHairColors, "#000000");
- }
- hairColors[index] = value;
- }
- }
- }
- }
}
diff --git a/src/being.h b/src/being.h
index 040d55a9..a1ab179b 100644
--- a/src/being.h
+++ b/src/being.h
@@ -501,12 +501,8 @@ class Being : public Sprite, public ConfigListener
internalTriggerEffect(effectId, false, true);
}
- static int getHairColorCount();
-
static int getHairStyleCount();
- static std::string getHairColor(int index);
-
virtual AnimatedSprite *getSprite(int index) const
{ return mSprites[index]; }