From a99b10c86eb048c0b0f594029f3de9a3df473aae Mon Sep 17 00:00:00 2001 From: LaG1924 <12997935+LaG1924@users.noreply.github.com> Date: Mon, 5 Mar 2018 23:39:09 +0500 Subject: Minor RendererSectionData parsing memory optimization --- src/RendererSectionData.hpp | 32 +++----------------------------- 1 file changed, 3 insertions(+), 29 deletions(-) (limited to 'src/RendererSectionData.hpp') diff --git a/src/RendererSectionData.hpp b/src/RendererSectionData.hpp index 54b6eea..ca652f4 100644 --- a/src/RendererSectionData.hpp +++ b/src/RendererSectionData.hpp @@ -1,46 +1,20 @@ #pragma once #include -#include #include -#include "Block.hpp" #include "Vector.hpp" class World; -class BlockModel; struct RendererSectionData { std::vector models; std::vector textures; std::vector colors; std::vector lights; - size_t hash; + size_t hash = 0; Vector sectionPos; - - RendererSectionData(World *world, Vector sectionPosition); - - ~RendererSectionData() = default; - - RendererSectionData(RendererSectionData &&other) = default; -private: - - void AddFacesByBlockModel(const std::vector §ionsList, World *world, Vector blockPos, const BlockModel &model, glm::mat4 transform, unsigned char light, unsigned char skyLight, const std::array& visibility); - - std::array GetBlockVisibilityData(World *world); - - std::vector> idModels; - const BlockModel* GetInternalBlockModel(const BlockId& id); - - std::array blockIdData; - void SetBlockIdData(World *world); - - inline const BlockId& GetBlockId(const Vector& pos) { - return blockIdData[pos.y * 256 + pos.z * 16 + pos.x]; - } - - inline const BlockId& GetBlockId(int x, int y, int z) { - return blockIdData[y * 256 + z * 16 + x]; - } }; + +RendererSectionData ParseSection(World *world, Vector sectionPosition); \ No newline at end of file -- cgit v1.2.3