diff options
| author | Japa | 2011-01-22 05:05:13 +0000 |
|---|---|---|
| committer | Japa | 2011-01-22 05:05:13 +0000 |
| commit | 3e627f73cdbf1073f56bfc2aee5def4f3ba2678f (patch) | |
| tree | b30bc7eefef25cc61d73ae14b2a26eff00d08683 /VegetationConfiguration.cpp | |
| parent | b17f42822cd3d0766e32f46dea58e36102f8a23e (diff) | |
| download | stonesense-3e627f73cdbf1073f56bfc2aee5def4f3ba2678f.tar.gz stonesense-3e627f73cdbf1073f56bfc2aee5def4f3ba2678f.tar.bz2 stonesense-3e627f73cdbf1073f56bfc2aee5def4f3ba2678f.tar.xz | |
Got meself some wide and tall trees working
Diffstat (limited to 'VegetationConfiguration.cpp')
| -rw-r--r-- | VegetationConfiguration.cpp | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/VegetationConfiguration.cpp b/VegetationConfiguration.cpp index b91c938..cbec0d9 100644 --- a/VegetationConfiguration.cpp +++ b/VegetationConfiguration.cpp @@ -9,10 +9,10 @@ #include "dfhack/depends/tinyxml/tinyxml.h"
-VegetationConfiguration::VegetationConfiguration(int gameID, c_sprite &sprite, bool live, bool grown)
+VegetationConfiguration::VegetationConfiguration(int gameID, c_block_tree &tree, bool live, bool grown)
{
memset(this, 0, sizeof(VegetationConfiguration) );
- this->sprite = sprite;
+ this->tree = tree;
this->gameID = gameID;
this->live = live;
this->grown = grown;
@@ -25,7 +25,6 @@ VegetationConfiguration::~VegetationConfiguration(void) bool addSingleVegetationConfig( TiXmlElement* elemRoot, vector<VegetationConfiguration>* vegetationConfigs, vector<t_matgloss>& plantNames )
{
const char* sheetIndexStr;
- c_sprite sprite;
int basefile = -1;
const char* filename = elemRoot->Attribute("file");
@@ -53,9 +52,9 @@ bool addSingleVegetationConfig( TiXmlElement* elemRoot, vector<VegetationConfig bool dead = (deadstr && deadstr[0]);
const char* saplingstr = elemTree->Attribute("sapling");
bool sapling = (saplingstr && saplingstr[0]);
-
- sprite.set_by_xml(elemTree, basefile);
- VegetationConfiguration vegetationConfiguration(gameID, sprite, !dead, !sapling);
+ c_block_tree tree;
+ tree.set_by_xml(elemTree, basefile);
+ VegetationConfiguration vegetationConfiguration(gameID, tree, !dead, !sapling);
//add a copy to known creatures
vegetationConfigs->push_back( vegetationConfiguration );
}
@@ -63,7 +62,7 @@ bool addSingleVegetationConfig( TiXmlElement* elemRoot, vector<VegetationConfig return true;
}
-c_sprite * getVegetationSprite(vector<VegetationConfiguration>& vegetationConfigs,int index,bool live,bool grown)
+c_block_tree * getVegetationTree(vector<VegetationConfiguration>& vegetationConfigs,int index,bool live,bool grown)
{
int vcmax = (int)vegetationConfigs.size();
for (int i=0;i<vcmax;i++)
@@ -72,10 +71,8 @@ c_sprite * getVegetationSprite(vector<VegetationConfiguration>& vegetationConfig if (current->gameID != INVALID_INDEX && current->gameID != index) continue;
if (current->live != live) continue;
if (current->grown != grown) continue;
- return &(current->sprite);
+ return &(current->tree);
}
- static c_sprite* sprite = new c_sprite;
- sprite->set_sheetindex(-1);
- return sprite;
-}
-
+ static c_block_tree* tree = new c_block_tree;
+ return tree;
+}
\ No newline at end of file |
