diff options
author | LaG1924 <12997935+LaG1924@users.noreply.github.com> | 2017-08-27 17:24:28 +0200 |
---|---|---|
committer | LaG1924 <12997935+LaG1924@users.noreply.github.com> | 2018-01-13 03:39:28 +0100 |
commit | 04ab1a3420b46af046a898ee5510e0d9b25ed24c (patch) | |
tree | 4e9d300bb38d434305d00337535c7c4077bc57c4 /src/RendererWorld.cpp | |
parent | 2017-08-23 (diff) | |
download | AltCraft-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.cpp | 8 |
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(); |