From 0a6ab30fbef0f339f4bf786a1cc5a9bb2ea169a1 Mon Sep 17 00:00:00 2001 From: Antoine Pilote Date: Sun, 28 Jul 2024 19:04:38 -0400 Subject: [PATCH] Quake map builder skips over empty textures --- Nuake/src/Scene/Systems/QuakeMapBuilder.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Nuake/src/Scene/Systems/QuakeMapBuilder.cpp b/Nuake/src/Scene/Systems/QuakeMapBuilder.cpp index eb6873fa..496703ae 100644 --- a/Nuake/src/Scene/Systems/QuakeMapBuilder.cpp +++ b/Nuake/src/Scene/Systems/QuakeMapBuilder.cpp @@ -127,10 +127,12 @@ namespace Nuake { face* face = &brush->faces[f]; texture_data* texture = &textures[face->texture_idx]; - if (std::string(texture->name) == "__TB_empty") + bool textureIsEmpty = std::string(texture->name) == "__TB_empty" || std::string(texture->name).empty(); + if (textureIsEmpty) { texture->height = 1; texture->width = 1; + continue; } else { @@ -198,7 +200,7 @@ namespace Nuake { Ref material = MaterialManager::Get()->GetMaterial(lastTexturePath); mesh->SetMaterial(material); } - + bsp.Meshes.push_back(mesh); index_offset = 0; @@ -558,6 +560,8 @@ namespace Nuake { } else { + continue; + currentMaterial = MaterialManager::Get()->GetMaterial("resources/Textures/default/Default.png"); texture->height = texture->width = 1; }