forked from mirror/openmw-tes3mp
Destroy entities when they're done with.
This commit is contained in:
parent
4109d0d923
commit
02d39080c8
3 changed files with 25 additions and 1 deletions
|
@ -5,6 +5,7 @@
|
|||
#include <OgreEntity.h>
|
||||
#include <OgreBone.h>
|
||||
#include <OgreSubMesh.h>
|
||||
#include <OgreSceneManager.h>
|
||||
|
||||
namespace MWRender
|
||||
{
|
||||
|
@ -28,6 +29,10 @@ Animation::Animation(OEngine::Render::OgreRenderer& _rend)
|
|||
|
||||
Animation::~Animation()
|
||||
{
|
||||
Ogre::SceneManager *sceneMgr = mInsert->getCreator();
|
||||
for(size_t i = 0;i < mEntityList.mEntities.size();i++)
|
||||
sceneMgr->destroyEntity(mEntityList.mEntities[i]);
|
||||
mEntityList.mEntities.clear();
|
||||
}
|
||||
|
||||
void Animation::startScript(std::string groupname, int mode, int loops)
|
||||
|
|
|
@ -17,6 +17,26 @@ using namespace NifOgre;
|
|||
namespace MWRender{
|
||||
NpcAnimation::~NpcAnimation()
|
||||
{
|
||||
removeEntities(head);
|
||||
removeEntities(hair);
|
||||
removeEntities(neck);
|
||||
removeEntities(groin);
|
||||
removeEntities(rWrist);
|
||||
removeEntities(lWrist);
|
||||
removeEntities(rForearm);
|
||||
removeEntities(lForearm);
|
||||
removeEntities(rupperArm);
|
||||
removeEntities(lupperArm);
|
||||
removeEntities(rfoot);
|
||||
removeEntities(lfoot);
|
||||
removeEntities(rAnkle);
|
||||
removeEntities(lAnkle);
|
||||
removeEntities(rKnee);
|
||||
removeEntities(lKnee);
|
||||
removeEntities(rUpperLeg);
|
||||
removeEntities(lUpperLeg);
|
||||
removeEntities(rclavicle);
|
||||
removeEntities(lclavicle);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -40,7 +40,6 @@ private:
|
|||
std::vector<Ogre::Entity*> hair;
|
||||
std::vector<Ogre::Entity*> head;
|
||||
|
||||
Ogre::SceneNode* mInsert;
|
||||
bool isBeast;
|
||||
bool isFemale;
|
||||
std::string headModel;
|
||||
|
|
Loading…
Reference in a new issue