mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-25 13:45:23 +02:00
Various random code cleanups
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -28,7 +28,8 @@ struct NodeToApply
|
||||
E_SHADOW_MODE m = E_SHADOW_MODE::ESM_BOTH) :
|
||||
node(n),
|
||||
shadowMode(m){};
|
||||
bool operator<(const NodeToApply &other) const { return node < other.node; };
|
||||
|
||||
bool operator==(scene::ISceneNode *n) const { return node == n; }
|
||||
|
||||
scene::ISceneNode *node;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user