1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-13 08:35:20 +02:00

Various random code cleanups

This commit is contained in:
sfan5
2025-03-01 11:53:37 +01:00
parent 358658fa34
commit 7892541383
73 changed files with 216 additions and 285 deletions

View File

@@ -177,14 +177,15 @@ void ShadowRenderer::removeNodeFromShadowList(scene::ISceneNode *node)
node->forEachMaterial([] (auto &mat) {
mat.setTexture(TEXTURE_LAYER_SHADOW, nullptr);
});
for (auto it = m_shadow_node_array.begin(); it != m_shadow_node_array.end();) {
if (it->node == node) {
it = m_shadow_node_array.erase(it);
break;
} else {
++it;
}
auto it = std::find(m_shadow_node_array.begin(), m_shadow_node_array.end(), node);
if (it == m_shadow_node_array.end()) {
infostream << "removeNodeFromShadowList: " << node << " not found" << std::endl;
return;
}
// swap with last, then remove
*it = m_shadow_node_array.back();
m_shadow_node_array.pop_back();
}
void ShadowRenderer::updateSMTextures()