From 55b5e60b189490c33b415e3c956800da21064e3b Mon Sep 17 00:00:00 2001 From: LaG1924 <12997935+LaG1924@users.noreply.github.com> Date: Wed, 8 Aug 2018 07:30:01 +0500 Subject: Basic BlockState support --- src/AssetManager.hpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src/AssetManager.hpp') diff --git a/src/AssetManager.hpp b/src/AssetManager.hpp index 2940b5f..f3d0718 100644 --- a/src/AssetManager.hpp +++ b/src/AssetManager.hpp @@ -92,6 +92,24 @@ struct BlockModel { std::vector parsedFaces; }; +struct BlockStateVariant { + std::string variantName; + + struct Model { + std::string modelName; + int x = 0; + int y = 0; + bool uvLock = false; + int weight = 1; + }; + + std::vector models; +}; + +struct BlockState { + std::map variants; +}; + inline bool operator==(const BlockModel::ElementData::FaceData::Uv &lhs, const BlockModel::ElementData::FaceData::Uv &rhs) { return lhs.x1 == rhs.x1 && lhs.y1 == rhs.y1 && lhs.x2 == rhs.x2 && lhs.y2 == rhs.y2; @@ -113,6 +131,10 @@ struct AssetBlockModel : Asset { BlockModel blockModel; }; +struct AssetBlockState : Asset { + BlockState blockState; +}; + struct AssetTexture : Asset { std::vector textureData; unsigned int realWidth, realHeight; -- cgit v1.2.3