1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-01 03:21:41 +00:00

Join variables declaration and usage

This commit is contained in:
Andrei Kortunov 2021-04-14 08:07:56 +04:00
parent 5f6f2c15b1
commit e309f75938

View File

@ -278,8 +278,7 @@ namespace Shader
const osg::StateSet::AttributeList& attributes = stateset->getAttributeList();
osg::StateSet::AttributeList removedAttributes;
osg::ref_ptr<osg::StateSet> removedState;
if (removedState = getRemovedState(*stateset))
if (osg::ref_ptr<osg::StateSet> removedState = getRemovedState(*stateset))
removedAttributes = removedState->getAttributeList();
for (const auto& attributeMap : { attributes, removedAttributes })
{
@ -475,8 +474,7 @@ namespace Shader
writableStateSet->removeAttribute(osg::StateAttribute::PROGRAM);
osg::ref_ptr<osg::StateSet> removedState;
if (removedState = getRemovedState(*writableStateSet))
if (osg::ref_ptr<osg::StateSet> removedState = getRemovedState(*writableStateSet))
{
// user data is normally shallow copied so shared with the original stateset
osg::ref_ptr<osg::UserDataContainer> writableUserData;