summaryrefslogtreecommitdiff
path: root/Block.cpp
diff options
context:
space:
mode:
authorJapaMala2011-10-18 00:39:54 +0530
committerJapaMala2011-10-18 00:39:54 +0530
commitee36fbd147e6f96a7c9b49f15ca1d55355e7c0d0 (patch)
tree59a4fa65b6439c04180baabf29d190d5e50cea2b /Block.cpp
parent71e67bc744792d02f01cc882dc21a3be788996b6 (diff)
downloadstonesense-ee36fbd147e6f96a7c9b49f15ca1d55355e7c0d0.tar.gz
stonesense-ee36fbd147e6f96a7c9b49f15ca1d55355e7c0d0.tar.bz2
stonesense-ee36fbd147e6f96a7c9b49f15ca1d55355e7c0d0.tar.xz
added preliminary functions to save volumetric data. Also fixed the large screenshot feature.
Signed-off-by: JapaMala <japa.mala.illo@gmail.com>
Diffstat (limited to 'Block.cpp')
-rw-r--r--Block.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/Block.cpp b/Block.cpp
index 674a37f..575a138 100644
--- a/Block.cpp
+++ b/Block.cpp
@@ -525,6 +525,32 @@ void Block::DrawRamptops()
}
}
+void Block::DrawPixel(int drawx, int drawy)
+{
+ ALLEGRO_COLOR temp;
+ if(floorType > 0 || wallType > 0 || ramp.type > 0 || stairType > 0)
+ {
+ al_put_pixel(drawx, drawy, lookupMaterialColor(this->material.type, this->material.index));
+ }
+ if(this->water.index)
+ {
+ if(this->water.type == 0) //water
+ al_draw_pixel(drawx, drawy, al_map_rgba_f(0.6f, 0.85f, 0.92f, (float)water.index / 7.0f));
+ else
+ al_draw_pixel(drawx, drawy, al_map_rgba_f(1.0f, 0.5f, 0.15f, (float)water.index / 7.0f));
+ }
+ //Grass
+ if(grasslevel > 0 && (
+ (tileTypeTable[floorType].material == GRASS) ||
+ (tileTypeTable[floorType].material == GRASS2) ||
+ (tileTypeTable[floorType].material == GRASS_DEAD) ||
+ (tileTypeTable[floorType].material == GRASS_DRY)))
+ {
+ temp = lookupMaterialColor(WOOD, grassmat);
+ al_draw_pixel(drawx, drawy, al_map_rgba_f(temp.r,temp.g, temp.b, (float)grasslevel/100.0f));
+ }
+}
+
bool hasWall(Block* b){
if(!b) return false;
return b->wallType > 0;