summaryrefslogtreecommitdiffstats
path: root/src/RendererWorld.cpp
diff options
context:
space:
mode:
authorLaG1924 <12997935+LaG1924@users.noreply.github.com>2017-08-27 17:24:28 +0200
committerLaG1924 <12997935+LaG1924@users.noreply.github.com>2018-01-13 03:39:28 +0100
commit04ab1a3420b46af046a898ee5510e0d9b25ed24c (patch)
tree4e9d300bb38d434305d00337535c7c4077bc57c4 /src/RendererWorld.cpp
parent2017-08-23 (diff)
downloadAltCraft-04ab1a3420b46af046a898ee5510e0d9b25ed24c.tar
AltCraft-04ab1a3420b46af046a898ee5510e0d9b25ed24c.tar.gz
AltCraft-04ab1a3420b46af046a898ee5510e0d9b25ed24c.tar.bz2
AltCraft-04ab1a3420b46af046a898ee5510e0d9b25ed24c.tar.lz
AltCraft-04ab1a3420b46af046a898ee5510e0d9b25ed24c.tar.xz
AltCraft-04ab1a3420b46af046a898ee5510e0d9b25ed24c.tar.zst
AltCraft-04ab1a3420b46af046a898ee5510e0d9b25ed24c.zip
Diffstat (limited to 'src/RendererWorld.cpp')
-rw-r--r--src/RendererWorld.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/RendererWorld.cpp b/src/RendererWorld.cpp
index dd5fdb4..7262583 100644
--- a/src/RendererWorld.cpp
+++ b/src/RendererWorld.cpp
@@ -94,7 +94,6 @@ RendererWorld::RendererWorld(std::shared_ptr<GameState> ptr):gs(ptr) {
sectionsMutex.lock();
auto it = sections.find(vec);
if (it == sections.end()) {
- //LOG(ERROR) << "Deleting wrong sectionRenderer";
sectionsMutex.unlock();
return;
}
@@ -124,7 +123,7 @@ RendererWorld::RendererWorld(std::shared_ptr<GameState> ptr):gs(ptr) {
sections.erase(sections.find(data.sectionPos));
}
RendererSection renderer(data);
- sections.insert(std::make_pair(data.sectionPos, renderer));
+ sections.insert(std::make_pair(data.sectionPos, std::move(renderer)));
sectionsMutex.unlock();
renderData.pop();
}
@@ -155,7 +154,6 @@ RendererWorld::RendererWorld(std::shared_ptr<GameState> ptr):gs(ptr) {
if (isParsing.find(vec) == isParsing.end())
isParsing[vec] = false;
if (isParsing[vec] == true) {
- //LOG(WARNING) << "Changed parsing block";
isParsingMutex.unlock();
return;
}
@@ -188,6 +186,8 @@ RendererWorld::RendererWorld(std::shared_ptr<GameState> ptr):gs(ptr) {
for (int i = 0; i < numOfWorkers; i++)
workers.push_back(std::thread(&RendererWorld::WorkerFunction, this, i));
+ EventAgregator::PushEvent(EventType::UpdateSectionsRender, UpdateSectionsRenderData{});
+
//glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
}
@@ -349,7 +349,7 @@ void RendererWorld::PrepareRender() {
}
void RendererWorld::Update(double timeToUpdate) {
- auto timeSincePreviousUpdate = std::chrono::steady_clock::now();
+ static auto timeSincePreviousUpdate = std::chrono::steady_clock::now();
int i = 0;
while (listener.IsEventsQueueIsNotEmpty() && i++ < 50)
listener.HandleEvent();