mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-21 12:53:51 +00:00
Issue #225: Deallocate memory used by actors animations.
This commit is contained in:
parent
f8afc22f04
commit
6d6ed909bf
2 changed files with 11 additions and 1 deletions
|
@ -8,6 +8,15 @@ using namespace Ogre;
|
||||||
using namespace MWRender;
|
using namespace MWRender;
|
||||||
using namespace NifOgre;
|
using namespace NifOgre;
|
||||||
|
|
||||||
|
Actors::~Actors(){
|
||||||
|
|
||||||
|
std::map<MWWorld::Ptr, Animation*>::iterator it = mAllActors.begin();
|
||||||
|
for (; it != mAllActors.end(); ++it) {
|
||||||
|
delete it->second;
|
||||||
|
it->second = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void Actors::setMwRoot(Ogre::SceneNode* root){
|
void Actors::setMwRoot(Ogre::SceneNode* root){
|
||||||
mMwRoot = root;
|
mMwRoot = root;
|
||||||
}
|
}
|
||||||
|
@ -61,6 +70,7 @@ void Actors::insertCreature (const MWWorld::Ptr& ptr){
|
||||||
insertBegin(ptr, true, true);
|
insertBegin(ptr, true, true);
|
||||||
CreatureAnimation* anim = new MWRender::CreatureAnimation(ptr, mEnvironment, mRend);
|
CreatureAnimation* anim = new MWRender::CreatureAnimation(ptr, mEnvironment, mRend);
|
||||||
//mAllActors.insert(std::pair<MWWorld::Ptr, Animation*>(ptr,anim));
|
//mAllActors.insert(std::pair<MWWorld::Ptr, Animation*>(ptr,anim));
|
||||||
|
delete mAllActors[ptr];
|
||||||
mAllActors[ptr] = anim;
|
mAllActors[ptr] = anim;
|
||||||
//mAllActors.push_back(&anim);*/
|
//mAllActors.push_back(&anim);*/
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,7 +30,7 @@ namespace MWRender{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Actors(OEngine::Render::OgreRenderer& _rend, MWWorld::Environment& _env): mRend(_rend), mEnvironment(_env){}
|
Actors(OEngine::Render::OgreRenderer& _rend, MWWorld::Environment& _env): mRend(_rend), mEnvironment(_env){}
|
||||||
~Actors(){}
|
~Actors();
|
||||||
void setMwRoot(Ogre::SceneNode* root);
|
void setMwRoot(Ogre::SceneNode* root);
|
||||||
void insertBegin (const MWWorld::Ptr& ptr, bool enabled, bool static_);
|
void insertBegin (const MWWorld::Ptr& ptr, bool enabled, bool static_);
|
||||||
void insertCreature (const MWWorld::Ptr& ptr);
|
void insertCreature (const MWWorld::Ptr& ptr);
|
||||||
|
|
Loading…
Reference in a new issue