mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-19 22:23:51 +00:00
Fix crash when multiple scenewidgets were closed. BtOgre was destroying resources each time.
This commit is contained in:
parent
70b5d6857a
commit
37a050873c
2 changed files with 13 additions and 2 deletions
|
@ -11,6 +11,8 @@
|
||||||
|
|
||||||
#include <components/nifbullet/bulletnifloader.hpp>
|
#include <components/nifbullet/bulletnifloader.hpp>
|
||||||
#include <openengine/bullet/BulletShapeLoader.h>
|
#include <openengine/bullet/BulletShapeLoader.h>
|
||||||
|
#include <OgreSceneNode.h>
|
||||||
|
#include <openengine/bullet/BtOgreExtras.h> // needs Ogre::SceneNode defined
|
||||||
|
|
||||||
// PLEASE NOTE:
|
// PLEASE NOTE:
|
||||||
//
|
//
|
||||||
|
@ -199,6 +201,17 @@ namespace CSVWorld
|
||||||
{
|
{
|
||||||
delete (*iter).second;
|
delete (*iter).second;
|
||||||
mDebugDrawers.erase(iter);
|
mDebugDrawers.erase(iter);
|
||||||
|
|
||||||
|
// BtOgre::DebugDrawer destroys the resources leading to crashes in some
|
||||||
|
// situations. Workaround by recreating them each time.
|
||||||
|
if (!Ogre::ResourceGroupManager::getSingleton().resourceGroupExists("BtOgre"))
|
||||||
|
Ogre::ResourceGroupManager::getSingleton().createResourceGroup("BtOgre");
|
||||||
|
if (!Ogre::MaterialManager::getSingleton().resourceExists("BtOgre/DebugLines"))
|
||||||
|
{
|
||||||
|
Ogre::MaterialPtr mat = Ogre::MaterialManager::getSingleton().create("BtOgre/DebugLines", "BtOgre");
|
||||||
|
mat->setReceiveShadows(false);
|
||||||
|
mat->setSelfIllumination(1,1,1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::map<Ogre::SceneManager *, Ogre::SceneNode *>::iterator it =
|
std::map<Ogre::SceneManager *, Ogre::SceneNode *>::iterator it =
|
||||||
|
|
|
@ -9,8 +9,6 @@
|
||||||
//#include <string>
|
//#include <string>
|
||||||
//#include "BulletCollision/CollisionShapes/btScaledBvhTriangleMeshShape.h"
|
//#include "BulletCollision/CollisionShapes/btScaledBvhTriangleMeshShape.h"
|
||||||
//#include <boost/shared_ptr.hpp>
|
//#include <boost/shared_ptr.hpp>
|
||||||
#include <OgreSceneNode.h>
|
|
||||||
#include <openengine/bullet/BtOgreExtras.h> // needs Ogre::SceneNode defined
|
|
||||||
|
|
||||||
//#include <OgreVector3.h>
|
//#include <OgreVector3.h>
|
||||||
//#include <OgreQuaternion.h>
|
//#include <OgreQuaternion.h>
|
||||||
|
|
Loading…
Reference in a new issue