mirror of
https://github.com/OpenMW/openmw.git
synced 2025-03-27 04:10:24 +00:00
Move node when inserting into a nodes map
This commit is contained in:
parent
aecdf04705
commit
d9d8802f3a
1 changed files with 5 additions and 5 deletions
|
@ -711,15 +711,15 @@ namespace MWRender
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto emplaced = nodes.emplace(cnode, InstanceList());
|
const auto emplaced = nodes.emplace(std::move(cnode), InstanceList());
|
||||||
if (emplaced.second)
|
if (emplaced.second)
|
||||||
{
|
{
|
||||||
analyzeVisitor.mDistances = LODRange{ smallestDistanceToChunk, higherDistanceToChunk } / ref.mScale;
|
analyzeVisitor.mDistances = LODRange{ smallestDistanceToChunk, higherDistanceToChunk } / ref.mScale;
|
||||||
const_cast<osg::Node*>(cnode.get())
|
const osg::Node* const nodePtr = emplaced.first->first.get();
|
||||||
->accept(
|
// const-trickery required because there is no const version of NodeVisitor
|
||||||
analyzeVisitor); // const-trickery required because there is no const version of NodeVisitor
|
const_cast<osg::Node*>(nodePtr)->accept(analyzeVisitor);
|
||||||
emplaced.first->second.mAnalyzeResult = analyzeVisitor.retrieveResult();
|
emplaced.first->second.mAnalyzeResult = analyzeVisitor.retrieveResult();
|
||||||
emplaced.first->second.mNeedCompile = compile && cnode->referenceCount() <= 3;
|
emplaced.first->second.mNeedCompile = compile && nodePtr->referenceCount() <= 2;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
analyzeVisitor.addInstance(emplaced.first->second.mAnalyzeResult);
|
analyzeVisitor.addInstance(emplaced.first->second.mAnalyzeResult);
|
||||||
|
|
Loading…
Reference in a new issue