1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-06 00:55:50 +00:00

Merge pull request #3154 from bosvensson1/patch-29

improves RemoveRedundantNodesVisitor performance for large children vectors
This commit is contained in:
Bret Curtis 2021-10-07 15:00:38 +02:00 committed by GitHub
commit 8d37d79d6c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -913,11 +913,11 @@ void Optimizer::RemoveRedundantNodesVisitor::removeRedundantNodes()
unsigned int childIndex = (*pitr)->getChildIndex(group);
for (unsigned int i=0; i<group->getNumChildren(); ++i)
{
osg::Node* child = group->getChild(i);
(*pitr)->insertChild(childIndex++, child);
if (i==0)
(*pitr)->setChild(childIndex, group->getChild(i));
else
(*pitr)->insertChild(childIndex+i, group->getChild(i));
}
(*pitr)->removeChild(group);
}
group->removeChildren(0, group->getNumChildren());