Remove SceneManager::notifyAttached

pull/167/head
scrawl 8 years ago
parent afa39d121f
commit 75677f03e7

@ -122,7 +122,6 @@ void CreatureWeaponAnimation::updatePart(PartHolderPtr& scene, int slot)
if (found == nodeMap.end()) if (found == nodeMap.end())
throw std::runtime_error("Can't find attachment node " + bonename); throw std::runtime_error("Can't find attachment node " + bonename);
osg::ref_ptr<osg::Node> attached = SceneUtil::attach(node, mObjectRoot, bonename, found->second.get()); osg::ref_ptr<osg::Node> attached = SceneUtil::attach(node, mObjectRoot, bonename, found->second.get());
mResourceSystem->getSceneManager()->notifyAttached(attached);
scene.reset(new PartHolder(attached)); scene.reset(new PartHolder(attached));

@ -52,7 +52,6 @@ void EffectManager::addEffect(const std::string &model, const std::string& textu
overrideTexture(textureOverride, mResourceSystem, node); overrideTexture(textureOverride, mResourceSystem, node);
mParentNode->addChild(trans); mParentNode->addChild(trans);
mResourceSystem->getSceneManager()->notifyAttached(node);
mEffects[trans] = effect; mEffects[trans] = effect;
} }

@ -663,7 +663,6 @@ PartHolderPtr NpcAnimation::insertBoundedPart(const std::string& model, const st
throw std::runtime_error("Can't find attachment node " + bonename); throw std::runtime_error("Can't find attachment node " + bonename);
osg::ref_ptr<osg::Node> attached = SceneUtil::attach(instance, mObjectRoot, bonefilter, found->second); osg::ref_ptr<osg::Node> attached = SceneUtil::attach(instance, mObjectRoot, bonefilter, found->second);
mResourceSystem->getSceneManager()->notifyAttached(attached);
if (enchantedGlow) if (enchantedGlow)
addGlow(attached, *glowColor); addGlow(attached, *glowColor);

@ -540,6 +540,13 @@ namespace Resource
// add a ref to the original template, to hint to the cache that it's still being used and should be kept in cache // add a ref to the original template, to hint to the cache that it's still being used and should be kept in cache
cloned->getOrCreateUserDataContainer()->addUserObject(new TemplateRef(scene)); cloned->getOrCreateUserDataContainer()->addUserObject(new TemplateRef(scene));
// we can skip any scene graphs without update callbacks since we know that particle emitters will have an update callback set
if (cloned->getNumChildrenRequiringUpdateTraversal() > 0)
{
InitParticlesVisitor visitor (mParticleSystemMask);
cloned->accept(visitor);
}
return cloned; return cloned;
} }
@ -566,7 +573,6 @@ namespace Resource
void SceneManager::attachTo(osg::Node *instance, osg::Group *parentNode) const void SceneManager::attachTo(osg::Node *instance, osg::Group *parentNode) const
{ {
parentNode->addChild(instance); parentNode->addChild(instance);
notifyAttached(instance);
} }
void SceneManager::releaseGLObjects(osg::State *state) void SceneManager::releaseGLObjects(osg::State *state)
@ -580,16 +586,6 @@ namespace Resource
mIncrementalCompileOperation = ico; mIncrementalCompileOperation = ico;
} }
void SceneManager::notifyAttached(osg::Node *node) const
{
// we can skip any scene graphs without update callbacks since we know that particle emitters will have an update callback set
if (node->getNumChildrenRequiringUpdateTraversal() > 0)
{
InitParticlesVisitor visitor (mParticleSystemMask);
node->accept(visitor);
}
}
Resource::ImageManager* SceneManager::getImageManager() Resource::ImageManager* SceneManager::getImageManager()
{ {
return mImageManager; return mImageManager;

@ -117,9 +117,6 @@ namespace Resource
/// Set up an IncrementalCompileOperation for background compiling of loaded scenes. /// Set up an IncrementalCompileOperation for background compiling of loaded scenes.
void setIncrementalCompileOperation(osgUtil::IncrementalCompileOperation* ico); void setIncrementalCompileOperation(osgUtil::IncrementalCompileOperation* ico);
/// @note SceneManager::attachTo calls this method automatically, only needs to be called by users if manually attaching
void notifyAttached(osg::Node* node) const;
Resource::ImageManager* getImageManager(); Resource::ImageManager* getImageManager();
/// @param mask The node mask to apply to loaded particle system nodes. /// @param mask The node mask to apply to loaded particle system nodes.

Loading…
Cancel
Save