From 598b8c09509b9de579d5f036bc63c79422d5af2a Mon Sep 17 00:00:00 2001 From: codereader Date: Thu, 21 May 2020 07:00:56 +0200 Subject: [PATCH] #5231: Remove dependency on TextureBrowser from clipper algorithm --- radiant/clipper/BrushByPlaneClipper.cpp | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/radiant/clipper/BrushByPlaneClipper.cpp b/radiant/clipper/BrushByPlaneClipper.cpp index f00d3e6209..43a5fb715d 100644 --- a/radiant/clipper/BrushByPlaneClipper.cpp +++ b/radiant/clipper/BrushByPlaneClipper.cpp @@ -2,7 +2,6 @@ #include "scenelib.h" #include "brush/BrushNode.h" -#include "ui/texturebrowser/TextureBrowser.h" namespace algorithm { @@ -128,10 +127,10 @@ void BrushByPlaneClipper::getMostUsedTexturing(const Brush& brush) const _mostUsedProjection = TextureProjection(); // greebo: Get the most used shader of this brush - for (Brush::const_iterator i = brush.begin(); i != brush.end(); ++i) + for (auto& face : brush) { // Get the shadername - const std::string& shader = (*i)->getShader(); + const std::string& shader = face->getShader(); // Insert counter, if necessary if (shaderCount.find(shader) == shaderCount.end()) { @@ -147,21 +146,9 @@ void BrushByPlaneClipper::getMostUsedTexturing(const Brush& brush) const mostUsedShaderCount = shaderCount[shader]; // Copy the TexDef from the face into the local member - (*i)->GetTexdef(_mostUsedProjection); + face->GetTexdef(_mostUsedProjection); } } - - // Fall back to the default shader, if nothing found - if (_mostUsedShader.empty() || mostUsedShaderCount == 1) - { - _mostUsedShader = GlobalTextureBrowser().getSelectedShader(); - - // Use the same texture matrix as the first face of the brush - if (!brush.empty()) - { - (*brush.begin())->GetTexdef(_mostUsedProjection); - } - } } } // namespace algorithm