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 <OgreEntity.h>
|
||||||
#include <OgreBone.h>
|
#include <OgreBone.h>
|
||||||
#include <OgreSubMesh.h>
|
#include <OgreSubMesh.h>
|
||||||
|
#include <OgreSceneManager.h>
|
||||||
|
|
||||||
namespace MWRender
|
namespace MWRender
|
||||||
{
|
{
|
||||||
|
@ -28,6 +29,10 @@ Animation::Animation(OEngine::Render::OgreRenderer& _rend)
|
||||||
|
|
||||||
Animation::~Animation()
|
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)
|
void Animation::startScript(std::string groupname, int mode, int loops)
|
||||||
|
|
|
@ -17,6 +17,26 @@ using namespace NifOgre;
|
||||||
namespace MWRender{
|
namespace MWRender{
|
||||||
NpcAnimation::~NpcAnimation()
|
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*> hair;
|
||||||
std::vector<Ogre::Entity*> head;
|
std::vector<Ogre::Entity*> head;
|
||||||
|
|
||||||
Ogre::SceneNode* mInsert;
|
|
||||||
bool isBeast;
|
bool isBeast;
|
||||||
bool isFemale;
|
bool isFemale;
|
||||||
std::string headModel;
|
std::string headModel;
|
||||||
|
|
Loading…
Reference in a new issue