1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-02-21 00:39:58 +00:00

Move FindLowestUnusedTexUnitVisitor to unnamed namespace

It's not used anywhere except this translation unit so no need to make the
symbol available everywhere else.
This commit is contained in:
elsid 2023-12-26 12:36:23 +01:00
parent 5ae878c248
commit 4d6350539c
No known key found for this signature in database
GPG Key ID: 4DE04C198CBA7625

View File

@ -37,27 +37,27 @@ namespace SceneUtil
}
const std::array<std::string, 32> glowTextureNames = generateGlowTextureNames();
struct FindLowestUnusedTexUnitVisitor : public osg::NodeVisitor
{
FindLowestUnusedTexUnitVisitor()
: osg::NodeVisitor(TRAVERSE_ALL_CHILDREN)
{
}
void apply(osg::Node& node) override
{
if (osg::StateSet* stateset = node.getStateSet())
mLowestUnusedTexUnit
= std::max(mLowestUnusedTexUnit, int(stateset->getTextureAttributeList().size()));
traverse(node);
}
int mLowestUnusedTexUnit = 0;
};
}
class FindLowestUnusedTexUnitVisitor : public osg::NodeVisitor
{
public:
FindLowestUnusedTexUnitVisitor()
: osg::NodeVisitor(TRAVERSE_ALL_CHILDREN)
, mLowestUnusedTexUnit(0)
{
}
void apply(osg::Node& node) override
{
if (osg::StateSet* stateset = node.getStateSet())
mLowestUnusedTexUnit = std::max(mLowestUnusedTexUnit, int(stateset->getTextureAttributeList().size()));
traverse(node);
}
int mLowestUnusedTexUnit;
};
GlowUpdater::GlowUpdater(int texUnit, const osg::Vec4f& color,
const std::vector<osg::ref_ptr<osg::Texture2D>>& textures, osg::Node* node, float duration,
Resource::ResourceSystem* resourcesystem)