1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-03-03 16:09:39 +00:00

Move is faster

This commit is contained in:
AnyOldName3 2020-12-18 02:11:51 +00:00
parent 05ad44d0b1
commit 0b5d5eab4c

View file

@ -127,11 +127,9 @@ StateGraph* ShadowsBin::cullStateGraph(StateGraph* sg, StateGraph* root, std::un
if (state.mAlphaBlend)
{
sg_new = sg->find_or_insert(mShaderAlphaTestStateSet);
for (RenderLeaf* leaf : sg->_leaves)
{
sg_new->_leaves = std::move(sg->_leaves);
for (RenderLeaf* leaf : sg_new->_leaves)
leaf->_parent = sg_new;
sg_new->_leaves.push_back(leaf);
}
sg = sg_new;
}
@ -139,11 +137,9 @@ StateGraph* ShadowsBin::cullStateGraph(StateGraph* sg, StateGraph* root, std::un
if (state.mAlphaFunc && state.mAlphaFunc->getFunction() != GL_ALWAYS)
{
sg_new = sg->find_or_insert(mAlphaFuncShaders[state.mAlphaFunc->getFunction() - GL_NEVER]);
for (RenderLeaf* leaf : sg->_leaves)
{
sg_new->_leaves = std::move(sg->_leaves);
for (RenderLeaf* leaf : sg_new->_leaves)
leaf->_parent = sg_new;
sg_new->_leaves.push_back(leaf);
}
sg = sg_new;
}