summaryrefslogtreecommitdiffstats
path: root/src/RendererWorld.cpp
diff options
context:
space:
mode:
authorLaG1924 <12997935+LaG1924@users.noreply.github.com>2018-03-16 17:19:18 +0100
committerLaG1924 <12997935+LaG1924@users.noreply.github.com>2018-03-16 17:19:18 +0100
commita493d1521a7f6ba19ce411598d6f8814bd2111f5 (patch)
tree65ff2fbf8b7d79ff57e2b8eabe268b1931006622 /src/RendererWorld.cpp
parentOptimized light parsing (diff)
downloadAltCraft-a493d1521a7f6ba19ce411598d6f8814bd2111f5.tar
AltCraft-a493d1521a7f6ba19ce411598d6f8814bd2111f5.tar.gz
AltCraft-a493d1521a7f6ba19ce411598d6f8814bd2111f5.tar.bz2
AltCraft-a493d1521a7f6ba19ce411598d6f8814bd2111f5.tar.lz
AltCraft-a493d1521a7f6ba19ce411598d6f8814bd2111f5.tar.xz
AltCraft-a493d1521a7f6ba19ce411598d6f8814bd2111f5.tar.zst
AltCraft-a493d1521a7f6ba19ce411598d6f8814bd2111f5.zip
Diffstat (limited to '')
-rw-r--r--src/RendererWorld.cpp20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/RendererWorld.cpp b/src/RendererWorld.cpp
index 64cdffc..50d1fce 100644
--- a/src/RendererWorld.cpp
+++ b/src/RendererWorld.cpp
@@ -28,7 +28,15 @@ void RendererWorld::WorkerFunction(size_t workerId) {
if (result != sections.end()) {
if (result->second.GetHash() != gs->world.GetSection(result->first).GetHash() || forced) {
sectionsMutex.unlock();
- auto data = std::make_unique<RendererSectionData>(ParseSection(&gs->world, vec));
+ SectionsData sections;
+ sections.section = gs->world.GetSection(vec);
+ sections.west = gs->world.GetSection(vec + Vector(1, 0, 0));
+ sections.east = gs->world.GetSection(vec + Vector(-1, 0, 0));
+ sections.top = gs->world.GetSection(vec + Vector(0, 1, 0));
+ sections.bottom = gs->world.GetSection(vec + Vector(0, -1, 0));
+ sections.north = gs->world.GetSection(vec + Vector(0, 0, 1));
+ sections.south = gs->world.GetSection(vec + Vector(0, 0, -1));
+ auto data = std::make_unique<RendererSectionData>(ParseSection(sections));
data->forced = true;
renderDataMutex.lock();
renderData.push(std::move(data));
@@ -44,7 +52,15 @@ void RendererWorld::WorkerFunction(size_t workerId) {
}
else {
sectionsMutex.unlock();
- auto data = std::make_unique<RendererSectionData>(ParseSection(&gs->world, vec));
+ SectionsData sections;
+ sections.section = gs->world.GetSection(vec);
+ sections.west = gs->world.GetSection(vec + Vector(1, 0, 0));
+ sections.east = gs->world.GetSection(vec + Vector(-1, 0, 0));
+ sections.top = gs->world.GetSection(vec + Vector(0, 1, 0));
+ sections.bottom = gs->world.GetSection(vec + Vector(0, -1, 0));
+ sections.north = gs->world.GetSection(vec + Vector(0, 0, 1));
+ sections.south = gs->world.GetSection(vec + Vector(0, 0, -1));
+ auto data = std::make_unique<RendererSectionData>(ParseSection(sections));
data->forced = true;
renderDataMutex.lock();
renderData.push(std::move(data));