From b04e1cb0566ae90cb8fea259db0ca65dd3176d93 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sat, 19 Aug 2017 13:01:01 +0200 Subject: BlockType: allow specifying visible and green value per damage value --- src/World/Block.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src/World/Block.cpp') 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; -- cgit v1.2.3