summaryrefslogtreecommitdiff
path: root/SpriteMaps.cpp
diff options
context:
space:
mode:
authorJapa Illo2012-02-17 23:54:41 +0530
committerJapa Illo2012-02-17 23:54:41 +0530
commitd219e323689a7ea5d387346b906241f2e999df1e (patch)
tree3db58b33bb9d168aacd8bdad0a702592abf55802 /SpriteMaps.cpp
parentaa921e71bd1a551ced19d29051439e88d2330975 (diff)
downloadstonesense-d219e323689a7ea5d387346b906241f2e999df1e.tar.gz
stonesense-d219e323689a7ea5d387346b906241f2e999df1e.tar.bz2
stonesense-d219e323689a7ea5d387346b906241f2e999df1e.tar.xz
Did some work on making stonesense compatible again.
Signed-off-by: Japa Illo <japa.mala.illo@gmail.com>
Diffstat (limited to 'SpriteMaps.cpp')
-rw-r--r--SpriteMaps.cpp71
1 files changed, 42 insertions, 29 deletions
diff --git a/SpriteMaps.cpp b/SpriteMaps.cpp
index 20b7f19..5e91aa1 100644
--- a/SpriteMaps.cpp
+++ b/SpriteMaps.cpp
@@ -4,6 +4,7 @@
#include "ContentLoader.h"
#include "GUI.h"
#include "BlockTree.h"
+#include "TileTypes.h"
using df::enums::item_type::item_type;
@@ -87,49 +88,61 @@ c_sprite * GetBlockSpriteMap(int in, t_matglossPair material, uint16_t form){
return GetTerrainSpriteMap(in, material, contentLoader->terrainBlockConfigs, form);
}
-c_block_tree * GetTreeVegetation( TileShape type, int index)
+c_block_tree * GetTreeVegetation( df::tiletype_shape shape, df::tiletype_special special, int index)
{
static c_block_tree * defaultTree = new c_block_tree;
int base_sprite = SPRITEOBJECT_BLUEPRINT;
vector<VegetationConfiguration>* graphicSet;
bool live=true;
bool grown=true;
- switch(type)
+ switch(shape)
{
- case TREE_DEAD:
- base_sprite = SPRITEOBJECT_TREE_DEAD;
- graphicSet = &(contentLoader->treeConfigs);
- live = false;
+ case TREE:
+ if(special == DEAD)
+ {
+ base_sprite = SPRITEOBJECT_TREE_DEAD;
+ graphicSet = &(contentLoader->treeConfigs);
+ live = false;
+ }
+ else
+ {
+ base_sprite = SPRITEOBJECT_TREE_OK;
+ graphicSet = &(contentLoader->treeConfigs);
+ }
break;
- case TREE_OK:
- base_sprite = SPRITEOBJECT_TREE_OK;
- graphicSet = &(contentLoader->treeConfigs);
+ case SAPLING:
+ if(special == DEAD)
+ {
+ base_sprite = SPRITEOBJECT_SAPLING_DEAD;
+ live = false;
+ grown = false;
+ graphicSet = &(contentLoader->treeConfigs);
+ }
+ else
+ {
+ base_sprite = SPRITEOBJECT_SAPLING_OK;
+ grown = false;
+ graphicSet = &(contentLoader->treeConfigs);
+ }
break;
- case SAPLING_DEAD:
- base_sprite = SPRITEOBJECT_SAPLING_DEAD;
- live = false;
- grown = false;
- graphicSet = &(contentLoader->treeConfigs);
- break;
- case SAPLING_OK:
- base_sprite = SPRITEOBJECT_SAPLING_OK;
- grown = false;
- graphicSet = &(contentLoader->treeConfigs);
- break;
- case SHRUB_DEAD:
- base_sprite = SPRITEOBJECT_SHRUB_DEAD;
- live = false;
- graphicSet = &(contentLoader->shrubConfigs);
- break;
- case SHRUB_OK:
- base_sprite = SPRITEOBJECT_SHRUB_OK;
- graphicSet = &(contentLoader->shrubConfigs);
+ case SHRUB:
+ if(special == DEAD)
+ {
+ base_sprite = SPRITEOBJECT_SHRUB_DEAD;
+ live = false;
+ graphicSet = &(contentLoader->shrubConfigs);
+ }
+ else
+ {
+ base_sprite = SPRITEOBJECT_SHRUB_OK;
+ graphicSet = &(contentLoader->shrubConfigs);
+ }
break;
default:
defaultTree->set_sheetindex(SPRITEOBJECT_BLANK);
return defaultTree;
}
-
+
c_block_tree * configuredTree = getVegetationTree(*graphicSet,index,live,grown);
if (configuredTree->get_sheetindex() == -1)
{