summaryrefslogtreecommitdiff
path: root/VegetationConfiguration.cpp
diff options
context:
space:
mode:
authorKris Parker2009-12-10 12:30:22 +0000
committerKris Parker2009-12-10 12:30:22 +0000
commitafba6ea721bc363502f07826d2c0cfb184e447fa (patch)
treed8bc5cdbde815131315838ed170b1c47d7c4f618 /VegetationConfiguration.cpp
parent35ea344b23fa77945fcf8a267e04cc2494e71a36 (diff)
downloadstonesense-afba6ea721bc363502f07826d2c0cfb184e447fa.tar.gz
stonesense-afba6ea721bc363502f07826d2c0cfb184e447fa.tar.bz2
stonesense-afba6ea721bc363502f07826d2c0cfb184e447fa.tar.xz
Merge terrain config to the trunk
Diffstat (limited to 'VegetationConfiguration.cpp')
-rw-r--r--VegetationConfiguration.cpp16
1 files changed, 1 insertions, 15 deletions
diff --git a/VegetationConfiguration.cpp b/VegetationConfiguration.cpp
index 98f42bd..c0ac3c8 100644
--- a/VegetationConfiguration.cpp
+++ b/VegetationConfiguration.cpp
@@ -21,20 +21,6 @@ VegetationConfiguration::~VegetationConfiguration(void)
{
}
-int TranslatePlantName(const char* plantName, vector<t_matgloss>& plantNames ){
- if (plantName == NULL)
- {
- return INVALID_INDEX;
- }
- uint32_t numPlants = (uint32_t)plantNames.size();
- for(uint32_t i=0; i < numPlants; i++){
- if (strcmp(plantName,plantNames[i].id) == 0)
- return i;
- }
- WriteErr("Unable to match plant '%s' to anything in-game\n", plantName);
- return INVALID_INDEX;
-}
-
bool addSingleVegetationConfig( TiXmlElement* elemRoot, vector<VegetationConfiguration>* vegetationConfigs, vector<t_matgloss>& plantNames )
{
const char* sheetIndexStr;
@@ -57,7 +43,7 @@ bool addSingleVegetationConfig( TiXmlElement* elemRoot, vector<VegetationConfig
TiXmlElement* elemTree;
for (elemTree = elemRoot->FirstChildElement("plant");
elemTree; elemTree = elemTree->NextSiblingElement("plant") ){
- int gameID = TranslatePlantName(elemTree->Attribute("gameID"),plantNames);
+ int gameID = lookupIndexedType(elemTree->Attribute("gameID"),plantNames);
if (gameID == INVALID_INDEX)
continue;
const char* deadstr = elemTree->Attribute("dead");