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

Replace a dynamic cast with string comarison

This commit is contained in:
AnyOldName3 2018-03-01 14:37:11 +00:00
parent bc4b4c66e4
commit fc41902798
2 changed files with 12 additions and 3 deletions

View file

@ -301,6 +301,8 @@ MWShadowTechnique::ComputeLightSpaceBounds::ComputeLightSpaceBounds(osg::Viewpor
pushViewport(viewport);
pushProjectionMatrix(new osg::RefMatrix(projectionMatrix));
pushModelViewMatrix(new osg::RefMatrix(viewMatrix), osg::Transform::ABSOLUTE_RF);
setName("SceneUtil::MWShadowTechnique::ComputeLightSpaceBounds,AcceptedByComponentsTerrainQuadTreeWorld");
}
void MWShadowTechnique::ComputeLightSpaceBounds::apply(osg::Node& node)

View file

@ -347,9 +347,16 @@ void QuadTreeWorld::accept(osg::NodeVisitor &nv)
{
if (nv.getVisitorType() != osg::NodeVisitor::CULL_VISITOR && nv.getVisitorType() != osg::NodeVisitor::INTERSECTION_VISITOR)
{
SceneUtil::MWShadowTechnique::ComputeLightSpaceBounds* shadowBoundsVisitor = dynamic_cast<SceneUtil::MWShadowTechnique::ComputeLightSpaceBounds *>(&nv);
if (shadowBoundsVisitor)
shadowBoundsVisitor->apply(*this);
if (nv.getName().find("AcceptedByComponentsTerrainQuadTreeWorld") != std::string::npos)
{
if (nv.getName().find("SceneUtil::MWShadowTechnique::ComputeLightSpaceBounds") != std::string::npos)
{
SceneUtil::MWShadowTechnique::ComputeLightSpaceBounds* clsb = static_cast<SceneUtil::MWShadowTechnique::ComputeLightSpaceBounds*>(&nv);
clsb->apply(*this);
}
else
nv.apply(*mRootNode);
}
return;
}