From 75677f03e74c0b695d65ea02a3281ec8a5658074 Mon Sep 17 00:00:00 2001 From: scrawl Date: Fri, 24 Feb 2017 00:43:36 +0100 Subject: [PATCH] Remove SceneManager::notifyAttached --- apps/openmw/mwrender/creatureanimation.cpp | 1 - apps/openmw/mwrender/effectmanager.cpp | 1 - apps/openmw/mwrender/npcanimation.cpp | 1 - components/resource/scenemanager.cpp | 18 +++++++----------- components/resource/scenemanager.hpp | 3 --- 5 files changed, 7 insertions(+), 17 deletions(-) diff --git a/apps/openmw/mwrender/creatureanimation.cpp b/apps/openmw/mwrender/creatureanimation.cpp index a90de2589..24732f866 100644 --- a/apps/openmw/mwrender/creatureanimation.cpp +++ b/apps/openmw/mwrender/creatureanimation.cpp @@ -122,7 +122,6 @@ void CreatureWeaponAnimation::updatePart(PartHolderPtr& scene, int slot) if (found == nodeMap.end()) throw std::runtime_error("Can't find attachment node " + bonename); osg::ref_ptr attached = SceneUtil::attach(node, mObjectRoot, bonename, found->second.get()); - mResourceSystem->getSceneManager()->notifyAttached(attached); scene.reset(new PartHolder(attached)); diff --git a/apps/openmw/mwrender/effectmanager.cpp b/apps/openmw/mwrender/effectmanager.cpp index 340a855fb..3e785a769 100644 --- a/apps/openmw/mwrender/effectmanager.cpp +++ b/apps/openmw/mwrender/effectmanager.cpp @@ -52,7 +52,6 @@ void EffectManager::addEffect(const std::string &model, const std::string& textu overrideTexture(textureOverride, mResourceSystem, node); mParentNode->addChild(trans); - mResourceSystem->getSceneManager()->notifyAttached(node); mEffects[trans] = effect; } diff --git a/apps/openmw/mwrender/npcanimation.cpp b/apps/openmw/mwrender/npcanimation.cpp index aa53c41ac..6ead1611e 100644 --- a/apps/openmw/mwrender/npcanimation.cpp +++ b/apps/openmw/mwrender/npcanimation.cpp @@ -663,7 +663,6 @@ PartHolderPtr NpcAnimation::insertBoundedPart(const std::string& model, const st throw std::runtime_error("Can't find attachment node " + bonename); osg::ref_ptr attached = SceneUtil::attach(instance, mObjectRoot, bonefilter, found->second); - mResourceSystem->getSceneManager()->notifyAttached(attached); if (enchantedGlow) addGlow(attached, *glowColor); diff --git a/components/resource/scenemanager.cpp b/components/resource/scenemanager.cpp index 8d717f7ea..85c27cbc2 100644 --- a/components/resource/scenemanager.cpp +++ b/components/resource/scenemanager.cpp @@ -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 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; } @@ -566,7 +573,6 @@ namespace Resource void SceneManager::attachTo(osg::Node *instance, osg::Group *parentNode) const { parentNode->addChild(instance); - notifyAttached(instance); } void SceneManager::releaseGLObjects(osg::State *state) @@ -580,16 +586,6 @@ namespace Resource 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() { return mImageManager; diff --git a/components/resource/scenemanager.hpp b/components/resource/scenemanager.hpp index 5d54ccb1c..62ffe0871 100644 --- a/components/resource/scenemanager.hpp +++ b/components/resource/scenemanager.hpp @@ -117,9 +117,6 @@ namespace Resource /// Set up an IncrementalCompileOperation for background compiling of loaded scenes. 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(); /// @param mask The node mask to apply to loaded particle system nodes.