summaryrefslogtreecommitdiff
path: root/Block.cpp
diff options
context:
space:
mode:
authorJapa2011-08-22 14:14:04 +0000
committerJapa2011-08-22 14:14:04 +0000
commite30a6661982aad7614e12e3bb66248992864d6b7 (patch)
treec39f8f7c59c9b5ca544d110e2ca6a5d2cdcdd562 /Block.cpp
parent3082298368e67933947d00d005821019ded2da81 (diff)
downloadstonesense-e30a6661982aad7614e12e3bb66248992864d6b7.tar.gz
stonesense-e30a6661982aad7614e12e3bb66248992864d6b7.tar.bz2
stonesense-e30a6661982aad7614e12e3bb66248992864d6b7.tar.xz
Got tile occlusion fully working.
Todo: transparent glass.
Diffstat (limited to 'Block.cpp')
-rw-r--r--Block.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/Block.cpp b/Block.cpp
index 7de4bc3..5b6f8a8 100644
--- a/Block.cpp
+++ b/Block.cpp
@@ -104,12 +104,11 @@ void Block::Draw()
material.index = 0;
}
-#ifdef _DEBUG
- if(!(this->designation.bits.hidden) || config.show_hidden_blocks)
+
+ if((!(this->designation.bits.hidden) || config.show_hidden_blocks) && config.block_count)
{
config.tilecount ++;
}
-#endif
bool defaultSnow = 1;
int sheetOffsetX, sheetOffsetY;
@@ -130,9 +129,8 @@ void Block::Draw()
pointToScreen((int*)&drawx, (int*)&drawy, drawz);
drawx -= TILEWIDTH>>1;
- if(((drawx + TILEWIDTH) < 0) || (drawx > al_get_bitmap_width(al_get_target_bitmap())) || ((drawy + TILEHEIGHT + WALLHEIGHT + FLOORHEIGHT) < 0) || (drawy > al_get_bitmap_height(al_get_target_bitmap())))
- visible = false;
- else visible = true;
+ if(((drawx + TILEWIDTH) < 0) || (drawx > al_get_bitmap_width(al_get_target_bitmap())) || ((drawy + TILEHEIGHT + FLOORHEIGHT) < 0) || (drawy - WALLHEIGHT > al_get_bitmap_height(al_get_target_bitmap())))
+ return;
bool chopThisBlock = 0;