diff --git a/apps/openmw/mwrender/animation.cpp b/apps/openmw/mwrender/animation.cpp index 0bb748572..b3f601270 100644 --- a/apps/openmw/mwrender/animation.cpp +++ b/apps/openmw/mwrender/animation.cpp @@ -35,11 +35,14 @@ void Animation::AnimationValue::setValue(Ogre::Real) void Animation::destroyObjectList(Ogre::SceneManager *sceneMgr, NifOgre::ObjectList &objects) { + for(size_t i = 0;i < objects.mLights.size();i++) + sceneMgr->destroyLight(objects.mLights[i]); for(size_t i = 0;i < objects.mParticles.size();i++) sceneMgr->destroyParticleSystem(objects.mParticles[i]); for(size_t i = 0;i < objects.mEntities.size();i++) sceneMgr->destroyEntity(objects.mEntities[i]); objects.mControllers.clear(); + objects.mLights.clear(); objects.mParticles.clear(); objects.mEntities.clear(); objects.mSkelBase = NULL; diff --git a/apps/openmw/mwrender/objects.cpp b/apps/openmw/mwrender/objects.cpp index b92b17ba8..bede95a26 100644 --- a/apps/openmw/mwrender/objects.cpp +++ b/apps/openmw/mwrender/objects.cpp @@ -159,7 +159,7 @@ void Objects::insertMesh (const MWWorld::Ptr& ptr, const std::string& mesh, bool } if(!mIsStatic || !Settings::Manager::getBool("use static geometry", "Objects") || - anyTransparency || !objects.mParticles.empty()) + anyTransparency || !objects.mParticles.empty() || !objects.mLights.empty()) { for(size_t i = 0;i < objects.mEntities.size();i++) { diff --git a/components/nifogre/ogrenifloader.hpp b/components/nifogre/ogrenifloader.hpp index 45f3cbcd8..edad13a9a 100644 --- a/components/nifogre/ogrenifloader.hpp +++ b/components/nifogre/ogrenifloader.hpp @@ -43,6 +43,7 @@ struct ObjectList { Ogre::Entity *mSkelBase; std::vector mEntities; std::vector mParticles; + std::vector mLights; std::map mTextKeys;