diff options
author | LaG1924 <12997935+LaG1924@users.noreply.github.com> | 2017-08-19 17:20:51 +0200 |
---|---|---|
committer | LaG1924 <12997935+LaG1924@users.noreply.github.com> | 2017-08-19 17:20:51 +0200 |
commit | f24107368fa47f911f4491f644ff3755525c91e1 (patch) | |
tree | 02dc3583ed82d81139b17191af9a9bfae40c45a9 /src/RendererWorld.hpp | |
parent | 2017-08-18 (diff) | |
download | AltCraft-f24107368fa47f911f4491f644ff3755525c91e1.tar AltCraft-f24107368fa47f911f4491f644ff3755525c91e1.tar.gz AltCraft-f24107368fa47f911f4491f644ff3755525c91e1.tar.bz2 AltCraft-f24107368fa47f911f4491f644ff3755525c91e1.tar.lz AltCraft-f24107368fa47f911f4491f644ff3755525c91e1.tar.xz AltCraft-f24107368fa47f911f4491f644ff3755525c91e1.tar.zst AltCraft-f24107368fa47f911f4491f644ff3755525c91e1.zip |
Diffstat (limited to 'src/RendererWorld.hpp')
-rw-r--r-- | src/RendererWorld.hpp | 19 |
1 files changed, 9 insertions, 10 deletions
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<GameState> 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<std::thread> workers; + void WorkerFunction(size_t WorkerId); bool isRunning = true; + std::mutex isParsingMutex; + std::map<Vector, bool> isParsing; //Blocks std::vector<Vector> renderList; std::mutex sectionsMutex; std::map<Vector, RendererSection> sections; Shader *blockShader; - void RenderBlocks(RenderState& renderState); + void UpdateAllSections(VectorF playerPos); //Entities Shader *entityShader; std::vector<RendererEntity> entities; - void RenderEntities(RenderState& renderState); public: - RendererWorld(GameState* ptr); + RendererWorld(std::shared_ptr<GameState> 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<RendererSectionData> renderData; |