From ea12fb0d8ce8a351f4dc559d2357191849be874b Mon Sep 17 00:00:00 2001 From: LaG1924 <12997935+LaG1924@users.noreply.github.com> Date: Sun, 5 Aug 2018 22:17:24 +0500 Subject: Separate lighting for each block face --- src/RendererSectionData.hpp | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'src/RendererSectionData.hpp') diff --git a/src/RendererSectionData.hpp b/src/RendererSectionData.hpp index a60f671..1250d39 100644 --- a/src/RendererSectionData.hpp +++ b/src/RendererSectionData.hpp @@ -9,6 +9,20 @@ class World; +enum BlockDirection { + down, //Y- + up, //Y+ + north, //Z- + south, //Z+ + west, //X- + east, //X+ + none, +}; + +struct BlockLightness { + unsigned char face[BlockDirection::none] = { 0,0,0,0,0,0 }; +}; + struct SectionsData { Section section; Section west; @@ -18,9 +32,9 @@ struct SectionsData { Section north; Section south; - unsigned char GetLight(const Vector &pos) const; + BlockLightness GetLight(const Vector &pos) const; - unsigned char GetSkyLight(const Vector &pos) const; + BlockLightness GetSkyLight(const Vector &pos) const; }; struct RendererSectionData { -- cgit v1.2.3