| 165 | } |
| 166 | |
| 167 | inline 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 | |
| 180 | inline void comparePatches(const IPatch& patch, const IPatch& expected, const std::string& infoText) |
| 181 | { |
no test coverage detected