From f24107368fa47f911f4491f644ff3755525c91e1 Mon Sep 17 00:00:00 2001 From: LaG1924 <12997935+LaG1924@users.noreply.github.com> Date: Sat, 19 Aug 2017 20:20:51 +0500 Subject: 2017-08-19 --- src/RendererWorld.hpp | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'src/RendererWorld.hpp') diff --git a/src/RendererWorld.hpp b/src/RendererWorld.hpp index 54c1826..e7bcdf0 100644 --- a/src/RendererWorld.hpp +++ b/src/RendererWorld.hpp @@ -9,27 +9,26 @@ class RendererWorld: public Renderer { //General - GameState *gs; + std::shared_ptr gs; EventListener listener; - /*static const size_t numOfWorkers = 4; + size_t numOfWorkers; size_t currentWorker = 0; - std::thread workers[numOfWorkers]; - void WorkerFunction(size_t WorkerId);*/ - std::thread resourceLoader; - void LoadedSectionController(); + std::vector workers; + void WorkerFunction(size_t WorkerId); bool isRunning = true; + std::mutex isParsingMutex; + std::map isParsing; //Blocks std::vector renderList; std::mutex sectionsMutex; std::map sections; Shader *blockShader; - void RenderBlocks(RenderState& renderState); + void UpdateAllSections(VectorF playerPos); //Entities Shader *entityShader; std::vector entities; - void RenderEntities(RenderState& renderState); public: - RendererWorld(GameState* ptr); + RendererWorld(std::shared_ptr ptr); ~RendererWorld(); void Render(RenderState& renderState) override; @@ -39,7 +38,7 @@ public: double MaxRenderingDistance; - void Update(); + void Update(double timeToUpdate); std::mutex renderDataMutex; std::queue renderData; -- cgit v1.2.3