From fc0ad97b585a5d3ecab6b2c72473689d7e7bfb9f Mon Sep 17 00:00:00 2001 From: LaG1924 <12997935+LaG1924@users.noreply.github.com> Date: Sun, 5 Aug 2018 19:07:59 +0500 Subject: Added ERROR-texture --- src/AssetManager.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/AssetManager.cpp b/src/AssetManager.cpp index 6a4b3a3..aaa71ed 100644 --- a/src/AssetManager.cpp +++ b/src/AssetManager.cpp @@ -400,13 +400,13 @@ void ParseBlockModels() { TextureCoord texture; textureName = face.second.texture; if (model.Textures.empty()) { - texture = AssetManager::GetTexture("minecraft/texture/blocks/tnt_side"); + texture = AssetManager::GetTexture("minecraft/textures/error"); } else { while (textureName[0] == '#') { textureName.erase(0, 1); auto textureIt = model.Textures.find(textureName); - textureName = textureIt != model.Textures.end() ? textureIt->second : "minecraft/texture/blocks/tnt_side"; + textureName = textureIt != model.Textures.end() ? textureIt->second : "minecraft/textures/error"; } textureName.insert(0, "minecraft/textures/"); texture = AssetManager::GetTexture(textureName); @@ -481,7 +481,7 @@ const BlockModel *AssetManager::GetBlockModelByBlockId(BlockId block) { std::string blockName = blockIdToBlockName[block]; AssetBlockModel *model = GetAsset("/minecraft/models/" + blockName); - return (model == nullptr) ? &GetAsset("/minecraft/models/block/diamond_block")->blockModel : &model->blockModel; + return (model == nullptr) ? &GetAsset("/minecraft/models/block/error")->blockModel : &model->blockModel; } std::string AssetManager::GetAssetNameByBlockId(BlockId block) { @@ -546,6 +546,6 @@ GLuint AssetManager::GetTextureAtlasId() TextureCoord AssetManager::GetTexture(const std::string assetName) { AssetTexture *asset = GetAsset(assetName); if (!asset) - return {}; + return GetTexture("/minecraft/textures/error"); return atlas->GetTexture(asset->id); } -- cgit v1.2.3