diff options
| author | Japa | 2010-08-31 15:44:46 +0000 |
|---|---|---|
| committer | Japa | 2010-08-31 15:44:46 +0000 |
| commit | fce2e4c3304db3ac29046c769b54ea0f219f3321 (patch) | |
| tree | 9d2a5f1ad63b665eff6e4f5a0b007cdb1ae7d009 /SpriteObjects.cpp | |
| parent | f9cee067c9d5d1a636dbd38a29fcfbda06d60276 (diff) | |
| download | stonesense-fce2e4c3304db3ac29046c769b54ea0f219f3321.tar.gz stonesense-fce2e4c3304db3ac29046c769b54ea0f219f3321.tar.bz2 stonesense-fce2e4c3304db3ac29046c769b54ea0f219f3321.tar.xz | |
Updated DFhack yet again, and added a few more sprite features.
Diffstat (limited to 'SpriteObjects.cpp')
| -rw-r--r-- | SpriteObjects.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/SpriteObjects.cpp b/SpriteObjects.cpp index 24d5732..a116e0c 100644 --- a/SpriteObjects.cpp +++ b/SpriteObjects.cpp @@ -73,10 +73,14 @@ void c_sprite::reset(void) wallborders = ALL_BORDERS;
floorborders = ALL_BORDERS;
rampborders = ALL_BORDERS;
+ upstairborders = ALL_BORDERS;
+ downstairborders = ALL_BORDERS;
notopenborders = 0;
notwallborders = 0;
notfloorborders = 0;
notrampborders = 0;
+ notupstairborders = 0;
+ notdownstairborders = 0;
randomanimation = 0;
animate = 1;
{
@@ -142,6 +146,10 @@ void c_sprite::set_by_xml(TiXmlElement *elemSprite) rampborders = getBorders(elemSprite->Attribute("needramp"));
+ upstairborders = getBorders(elemSprite->Attribute("needupstair"));
+
+ downstairborders = getBorders(elemSprite->Attribute("needdownstair"));
+
notopenborders = getUnBorders(elemSprite->Attribute("neednotopen"));
notfloorborders = getUnBorders(elemSprite->Attribute("neednotfloor"));
@@ -150,6 +158,10 @@ void c_sprite::set_by_xml(TiXmlElement *elemSprite) notrampborders = getUnBorders(elemSprite->Attribute("neednotramp"));
+ notupstairborders = getUnBorders(elemSprite->Attribute("neednotupstair"));
+
+ notdownstairborders = getUnBorders(elemSprite->Attribute("neednotdownstair"));
+
//check for randomised tiles
const char* spriteVariationsStr = elemSprite->Attribute("variations");
if (spriteVariationsStr == NULL || spriteVariationsStr[0] == 0)
@@ -366,7 +378,7 @@ void c_sprite::draw_world_offset(int x, int y, int z, int tileoffset, bool chop) if(variations)
randoffset = rando%variations;
Block* b = viewedSegment->getBlock(x, y, z);
- if(((openborders & b->openborders) || (rampborders & b->rampborders) || (wallborders & b->wallborders) || (floorborders & b->floorborders)) && !((notopenborders & b->openborders) || (notrampborders & b->rampborders) || (notwallborders & b->wallborders) || (notfloorborders & b->floorborders)))
+ if(((openborders & b->openborders) || (upstairborders & b->upstairborders) || (downstairborders & b->downstairborders) || (rampborders & b->rampborders) || (wallborders & b->wallborders) || (floorborders & b->floorborders)) && !((notopenborders & b->openborders) || (notupstairborders & b->upstairborders) || (notdownstairborders & b->downstairborders) || (notrampborders & b->rampborders) || (notwallborders & b->wallborders) || (notfloorborders & b->floorborders)))
{
if((snowmin <= b->snowlevel && (snowmax == -1 || snowmax >= b->snowlevel)) && (bloodmin <= b->bloodlevel && (bloodmax == -1 || bloodmax >= b->bloodlevel)) && (mudmin <= b->mudlevel && (mudmax == -1 || mudmax >= b->mudlevel)))
{
|
