forked from mirror/openmw-tes3mp
hotfix for CharacterPreview destructor
This commit is contained in:
parent
21bdcc9f20
commit
87ce2110dc
1 changed files with 13 additions and 7 deletions
|
@ -21,13 +21,15 @@ namespace MWRender
|
||||||
|
|
||||||
CharacterPreview::CharacterPreview(MWWorld::Ptr character, int sizeX, int sizeY, const std::string& name,
|
CharacterPreview::CharacterPreview(MWWorld::Ptr character, int sizeX, int sizeY, const std::string& name,
|
||||||
Ogre::Vector3 position, Ogre::Vector3 lookAt)
|
Ogre::Vector3 position, Ogre::Vector3 lookAt)
|
||||||
: mSizeX(sizeX)
|
|
||||||
, mSizeY(sizeY)
|
: mSceneMgr (0)
|
||||||
, mName(name)
|
|
||||||
, mPosition(position)
|
, mPosition(position)
|
||||||
, mLookAt(lookAt)
|
, mLookAt(lookAt)
|
||||||
, mCharacter(character)
|
, mCharacter(character)
|
||||||
, mAnimation(NULL)
|
, mAnimation(NULL)
|
||||||
|
, mName(name)
|
||||||
|
, mSizeX(sizeX)
|
||||||
|
, mSizeY(sizeY)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -87,17 +89,21 @@ namespace MWRender
|
||||||
}
|
}
|
||||||
|
|
||||||
CharacterPreview::~CharacterPreview ()
|
CharacterPreview::~CharacterPreview ()
|
||||||
|
{
|
||||||
|
if (mSceneMgr)
|
||||||
{
|
{
|
||||||
//Ogre::TextureManager::getSingleton().remove(mName);
|
//Ogre::TextureManager::getSingleton().remove(mName);
|
||||||
mSceneMgr->destroyCamera (mName);
|
mSceneMgr->destroyAllCameras();
|
||||||
delete mAnimation;
|
delete mAnimation;
|
||||||
Ogre::Root::getSingleton().destroySceneManager(mSceneMgr);
|
Ogre::Root::getSingleton().destroySceneManager(mSceneMgr);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void CharacterPreview::rebuild()
|
void CharacterPreview::rebuild()
|
||||||
{
|
{
|
||||||
assert(mAnimation);
|
assert(mAnimation);
|
||||||
delete mAnimation;
|
delete mAnimation;
|
||||||
|
mAnimation = 0;
|
||||||
|
|
||||||
mAnimation = new NpcAnimation(mCharacter, mNode, MWWorld::Class::get(mCharacter).getInventoryStore(mCharacter),
|
mAnimation = new NpcAnimation(mCharacter, mNode, MWWorld::Class::get(mCharacter).getInventoryStore(mCharacter),
|
||||||
0, (renderHeadOnly() ? NpcAnimation::VM_HeadOnly : NpcAnimation::VM_Normal));
|
0, (renderHeadOnly() ? NpcAnimation::VM_HeadOnly : NpcAnimation::VM_Normal));
|
||||||
|
|
Loading…
Reference in a new issue