From 95c85382030af78854a42d457fbb259e6078402b Mon Sep 17 00:00:00 2001 From: LaG1924 <12997935+LaG1924@users.noreply.github.com> Date: Mon, 6 Nov 2017 18:01:19 +0500 Subject: Section parser now in a separate file --- src/RendererSection.hpp | 41 ++--------------------------------------- 1 file changed, 2 insertions(+), 39 deletions(-) (limited to 'src/RendererSection.hpp') diff --git a/src/RendererSection.hpp b/src/RendererSection.hpp index 26068e4..c9137ce 100644 --- a/src/RendererSection.hpp +++ b/src/RendererSection.hpp @@ -1,49 +1,12 @@ #pragma once -#include -#include - #include #include #include "Vector.hpp" -#include "Block.hpp" -class BlockModel; -class AssetManager; -class World; class RenderState; - -struct RendererSectionData { - std::vector models; - std::vector textures; - std::vector colors; - std::vector lights; - size_t hash; - Vector sectionPos; - - RendererSectionData(World *world, Vector sectionPosition); -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]; - } -}; - +class RendererSectionData; class RendererSection { enum Vbos { @@ -63,7 +26,7 @@ class RendererSection { RendererSection(const RendererSection &other) = delete; public: - RendererSection(RendererSectionData data); + RendererSection(const RendererSectionData &data); RendererSection(RendererSection &&other); -- cgit v1.2.3