summaryrefslogtreecommitdiff
path: root/ConditionalSprite.cpp
diff options
context:
space:
mode:
authorJonas Ask2009-10-21 00:05:12 +0000
committerJonas Ask2009-10-21 00:05:12 +0000
commit94810c064d19b0ffd846a4c3301a70477cc88e4a (patch)
tree0518a28966217a020a4381f8d0cf41f429d5abf9 /ConditionalSprite.cpp
parente4614f535d4be2d015144a6bb2fe57bfdedd7b16 (diff)
downloadstonesense-94810c064d19b0ffd846a4c3301a70477cc88e4a.tar.gz
stonesense-94810c064d19b0ffd846a4c3301a70477cc88e4a.tar.bz2
stonesense-94810c064d19b0ffd846a4c3301a70477cc88e4a.tar.xz
Started the work on a configurable building system.
Buildings are defined using xml files, which are parsed by Stonesense.
Diffstat (limited to 'ConditionalSprite.cpp')
-rw-r--r--ConditionalSprite.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/ConditionalSprite.cpp b/ConditionalSprite.cpp
index 346d13d..7fe6eae 100644
--- a/ConditionalSprite.cpp
+++ b/ConditionalSprite.cpp
@@ -8,7 +8,8 @@ ConditionalSprite::ConditionalSprite(void)
{
memset(this, 0, sizeof(ConditionalSprite));
//
- cMaterial = INVALID_INDEX;
+ cMaterialType = INVALID_INDEX;
+ cMaterialIndex = INVALID_INDEX;
cPositionIndex = INVALID_INDEX;
cNeighbourHasWall = eSimpleInvalid;
}
@@ -22,10 +23,8 @@ bool ConditionalSprite::matchPosition(Block *b){
return pos == cPositionIndex;
}
-bool ConditionalSprite::matchMaterial(Block *b){
- bool material = false;
- material = b->building.material.index == cMaterial;
- return true;
+bool ConditionalSprite::matchMaterialType(Block *b){
+ return b->building.material.type == cMaterialType;
}
@@ -36,8 +35,8 @@ bool ConditionalSprite::matchNeighbourHasWall(Block *b){
}
bool ConditionalSprite::BlockMatches(Block* b){
bool okSoFar = true;
- if(cMaterial != INVALID_INDEX){
- if( !this->matchMaterial(b) ) okSoFar = false;
+ if(cMaterialType != INVALID_INDEX){
+ if( !this->matchMaterialType(b) ) okSoFar = false;
}
if(cPositionIndex != INVALID_INDEX){
if( !this->matchPosition(b) ) okSoFar = false;