mirror of
https://github.com/OpenMW/openmw.git
synced 2025-11-08 21:16:40 +00:00
Remove recastmesh group for absent tile
This commit is contained in:
parent
9e2f3fd0b4
commit
4f5bdbb4fb
2 changed files with 13 additions and 7 deletions
|
|
@ -67,14 +67,22 @@ namespace MWRender
|
||||||
++it;
|
++it;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const auto& tile : tiles)
|
for (const auto& [position, mesh] : tiles)
|
||||||
{
|
{
|
||||||
if (mGroups.count(tile.first))
|
const auto it = mGroups.find(position);
|
||||||
continue;
|
|
||||||
const auto group = SceneUtil::createRecastMeshGroup(*tile.second, settings.mRecast);
|
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");
|
MWBase::Environment::get().getResourceSystem()->getSceneManager()->recreateShaders(group, "debug");
|
||||||
group->setNodeMask(Mask_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);
|
mRootNode->addChild(group);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,8 +6,6 @@
|
||||||
|
|
||||||
#include <osg/ref_ptr>
|
#include <osg/ref_ptr>
|
||||||
|
|
||||||
#include <vector>
|
|
||||||
|
|
||||||
namespace osg
|
namespace osg
|
||||||
{
|
{
|
||||||
class Group;
|
class Group;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue