mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-26 15:39:51 +00:00
Merge branch 'ObjectPagingMergeIssue' into 'master'
Share state See merge request OpenMW/openmw!879
This commit is contained in:
commit
c4fde03542
@ -651,6 +651,7 @@ namespace MWRender
|
|||||||
}
|
}
|
||||||
optimizer.setIsOperationPermissibleForObjectCallback(new CanOptimizeCallback);
|
optimizer.setIsOperationPermissibleForObjectCallback(new CanOptimizeCallback);
|
||||||
unsigned int options = SceneUtil::Optimizer::FLATTEN_STATIC_TRANSFORMS|SceneUtil::Optimizer::REMOVE_REDUNDANT_NODES|SceneUtil::Optimizer::MERGE_GEOMETRY;
|
unsigned int options = SceneUtil::Optimizer::FLATTEN_STATIC_TRANSFORMS|SceneUtil::Optimizer::REMOVE_REDUNDANT_NODES|SceneUtil::Optimizer::MERGE_GEOMETRY;
|
||||||
|
mSceneManager->shareState(mergeGroup);
|
||||||
optimizer.optimize(mergeGroup, options);
|
optimizer.optimize(mergeGroup, options);
|
||||||
|
|
||||||
group->addChild(mergeGroup);
|
group->addChild(mergeGroup);
|
||||||
|
@ -514,6 +514,12 @@ namespace Resource
|
|||||||
return options;
|
return options;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SceneManager::shareState(osg::ref_ptr<osg::Node> node) {
|
||||||
|
mSharedStateMutex.lock();
|
||||||
|
mSharedStateManager->share(node.get());
|
||||||
|
mSharedStateMutex.unlock();
|
||||||
|
}
|
||||||
|
|
||||||
osg::ref_ptr<const osg::Node> SceneManager::getTemplate(const std::string &name, bool compile)
|
osg::ref_ptr<const osg::Node> SceneManager::getTemplate(const std::string &name, bool compile)
|
||||||
{
|
{
|
||||||
std::string normalized = name;
|
std::string normalized = name;
|
||||||
|
@ -135,7 +135,7 @@ namespace Resource
|
|||||||
osg::ref_ptr<osg::Node> createInstance(const std::string& name);
|
osg::ref_ptr<osg::Node> createInstance(const std::string& name);
|
||||||
|
|
||||||
osg::ref_ptr<osg::Node> createInstance(const osg::Node* base);
|
osg::ref_ptr<osg::Node> createInstance(const osg::Node* base);
|
||||||
|
void shareState(osg::ref_ptr<osg::Node> node);
|
||||||
/// Get an instance of the given scene template
|
/// Get an instance of the given scene template
|
||||||
/// @see getTemplate
|
/// @see getTemplate
|
||||||
/// @note Thread safe.
|
/// @note Thread safe.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user