Remove recastmesh group for absent tile

esm4-texture
elsid 8 months ago
parent 9e2f3fd0b4
commit 4f5bdbb4fb
No known key found for this signature in database
GPG Key ID: 4DE04C198CBA7625

@ -67,14 +67,22 @@ namespace MWRender
++it;
}
for (const auto& tile : tiles)
for (const auto& [position, mesh] : tiles)
{
if (mGroups.count(tile.first))
continue;
const auto group = SceneUtil::createRecastMeshGroup(*tile.second, settings.mRecast);
const auto it = mGroups.find(position);
if (it != mGroups.end())
{
if (it->second.mVersion == mesh->getVersion())
continue;
mRootNode->removeChild(it->second.mValue);
}
const auto group = SceneUtil::createRecastMeshGroup(*mesh, settings.mRecast);
MWBase::Environment::get().getResourceSystem()->getSceneManager()->recreateShaders(group, "debug");
group->setNodeMask(Mask_Debug);
mGroups.emplace(tile.first, Group{ tile.second->getVersion(), group });
mGroups.insert_or_assign(it, position, Group{ mesh->getVersion(), group });
mRootNode->addChild(group);
}
}

@ -6,8 +6,6 @@
#include <osg/ref_ptr>
#include <vector>
namespace osg
{
class Group;

Loading…
Cancel
Save