summaryrefslogtreecommitdiffstats
path: root/src/World
diff options
context:
space:
mode:
Diffstat (limited to 'src/World')
-rw-r--r--src/World/Block.cpp10
-rw-r--r--src/World/Chunk.cpp3
2 files changed, 6 insertions, 7 deletions
diff --git a/src/World/Block.cpp b/src/World/Block.cpp
index 3c295d4..c47e2bc 100644
--- a/src/World/Block.cpp
+++ b/src/World/Block.cpp
@@ -33,16 +33,14 @@ namespace MinedMap {
namespace World {
uint32_t Block::getColor() const {
- const Resource::BlockType &t = Resource::BLOCK_TYPES[id];
+ const Resource::BlockType &t = Resource::BLOCK_TYPES[id][data];
if (!t.opaque)
return 0;
- uint32_t color = t.colors[data];
-
- unsigned r = uint8_t(color >> 16);
- unsigned g = uint8_t(color >> 8);
- unsigned b = uint8_t(color);
+ unsigned r = uint8_t(t.color >> 16);
+ unsigned g = uint8_t(t.color >> 8);
+ unsigned b = uint8_t(t.color);
float heightCoef = height/255.0f + 0.5f;
diff --git a/src/World/Chunk.cpp b/src/World/Chunk.cpp
index f722655..bf59068 100644
--- a/src/World/Chunk.cpp
+++ b/src/World/Chunk.cpp
@@ -182,7 +182,8 @@ Chunk::Blocks Chunk::getTopLayer() const {
continue;
uint8_t id = getBlockAt(x, y, z);
- if (!Resource::BLOCK_TYPES[id].opaque)
+ uint8_t data = getDataAt(x, y, z);
+ if (!Resource::BLOCK_TYPES[id][data].opaque)
continue;
ret.blocks[x][z] = getBlock(x, y, z);