mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-28 12:39:41 +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;
|
||||
}
|
||||
|
||||
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…
Reference in a new issue