MCPcopy Create free account
hub / github.com/codereader/DarkRadiant / findPatchInLayerWithMaterial

Function findPatchInLayerWithMaterial

test/Patch.cpp:167–178  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

165}
166
167inline IPatch* findPatchInLayerWithMaterial(const std::string& layerName, const std::string& shaderName)
168{
169 auto worldspawn = GlobalMapModule().findOrInsertWorldspawn();
170 auto layerId = GlobalMapModule().getRoot()->getLayerManager().getLayerID(layerName);
171
172 return Node_getIPatch(algorithm::findFirstNode(worldspawn, [&](const auto& node)
173 {
174 const auto& layers = node->getLayers();
175
176 return layers.find(layerId) != layers.end() && Node_getIPatch(node)->getShader() == shaderName;
177 }));
178}
179
180inline void comparePatches(const IPatch& patch, const IPatch& expected, const std::string& infoText)
181{

Callers 1

TEST_FFunction · 0.85

Calls 7

Node_getIPatchFunction · 0.85
findFirstNodeFunction · 0.85
getShaderMethod · 0.80
getLayerIDMethod · 0.45
getRootMethod · 0.45
findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected