From b9a64733eccac3197d0c768050577aa2e6f59249 Mon Sep 17 00:00:00 2001 From: LaG1924 <12997935+LaG1924@users.noreply.github.com> Date: Fri, 30 Mar 2018 03:31:56 +0500 Subject: Replaced fallback model to diamond block model --- src/AssetManager.cpp | 2 +- src/RendererSectionData.cpp | 20 +------------------- 2 files changed, 2 insertions(+), 20 deletions(-) (limited to 'src') diff --git a/src/AssetManager.cpp b/src/AssetManager.cpp index bffc246..f5284a4 100644 --- a/src/AssetManager.cpp +++ b/src/AssetManager.cpp @@ -235,7 +235,7 @@ const BlockModel *AssetManager::GetBlockModelByBlockId(BlockId block) { std::string blockName = blockIdToBlockName[block]; auto modelIt = models.find(blockName); - return (modelIt == models.end()) ? nullptr : &modelIt->second; + return (modelIt == models.end()) ? GetBlockModelByBlockId(BlockId{ 57,0 }) : &modelIt->second; } void AssetManager::LoadBlockModels() { diff --git a/src/RendererSectionData.cpp b/src/RendererSectionData.cpp index 6554d16..ab3812d 100644 --- a/src/RendererSectionData.cpp +++ b/src/RendererSectionData.cpp @@ -183,25 +183,7 @@ RendererSectionData ParseSection(const SectionsData §ions) unsigned char skyLight = sections.GetSkyLight(vec); const BlockModel* model = GetInternalBlockModel(block, idModels); - if (model) { - AddFacesByBlockModel(data, *model, transform, blockVisibility[y * 256 + z * 16 + x], light, skyLight); - } - else { - transform = glm::translate(transform, glm::vec3(0, 1, 0)); - - if (block.id == 8 || block.id == 9) { - data.textures.push_back(AssetManager::Instance().GetTextureByAssetName("minecraft/textures/blocks/water_still")); - data.textures.back().w /= 32.0f; - transform = glm::translate(transform, glm::vec3(0, -0.2, 0)); - } - else - data.textures.push_back(AssetManager::Instance().GetTextureByAssetName("minecraft/textures/blocks/tnt_side")); - - data.models.push_back(transform); - data.colors.push_back(glm::vec3(0, 0, 0)); - data.lights.push_back(glm::vec2(light, skyLight)); - } - + AddFacesByBlockModel(data, *model, transform, blockVisibility[y * 256 + z * 16 + x], light, skyLight); } } } -- cgit v1.2.3