mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-19 21:23:52 +00:00
Don't create entities and particles when only the skeleton base is needed
This commit is contained in:
parent
4a42f89e08
commit
07c24e0382
1 changed files with 7 additions and 8 deletions
|
@ -468,7 +468,7 @@ class NIFObjectLoader
|
|||
|
||||
static void createObjects(const std::string &name, const std::string &group,
|
||||
Ogre::SceneManager *sceneMgr, const Nif::Node *node,
|
||||
ObjectList &objectlist, int flags=0)
|
||||
ObjectList &objectlist, int flags)
|
||||
{
|
||||
// Do not create objects for the collision shape (includes all children)
|
||||
if(node->recType == Nif::RC_RootCollisionNode)
|
||||
|
@ -585,8 +585,8 @@ class NIFObjectLoader
|
|||
}
|
||||
}
|
||||
|
||||
if(node->recType == Nif::RC_NiAutoNormalParticles ||
|
||||
node->recType == Nif::RC_NiRotatingParticles)
|
||||
if((node->recType == Nif::RC_NiAutoNormalParticles ||
|
||||
node->recType == Nif::RC_NiRotatingParticles) && !(flags&0x40000000))
|
||||
{
|
||||
Ogre::ParticleSystem *partsys = createParticleSystem(name, group, sceneMgr, objectlist.mSkelBase, node);
|
||||
if(partsys != NULL)
|
||||
|
@ -614,8 +614,7 @@ class NIFObjectLoader
|
|||
{
|
||||
/* This creates an empty mesh to which a skeleton gets attached. This
|
||||
* is to ensure we have an entity with a skeleton instance, even if all
|
||||
* other meshes are hidden or entities attached to a specific node
|
||||
* instead of skinned. */
|
||||
* other entities are attached to bones and not skinned. */
|
||||
Ogre::MeshManager &meshMgr = Ogre::MeshManager::getSingleton();
|
||||
if(meshMgr.getByName(name).isNull())
|
||||
NIFMeshLoader::createMesh(name, name, group, ~(size_t)0);
|
||||
|
@ -625,7 +624,7 @@ class NIFObjectLoader
|
|||
}
|
||||
|
||||
public:
|
||||
static void load(Ogre::SceneManager *sceneMgr, ObjectList &objectlist, const std::string &name, const std::string &group)
|
||||
static void load(Ogre::SceneManager *sceneMgr, ObjectList &objectlist, const std::string &name, const std::string &group, int flags=0)
|
||||
{
|
||||
Nif::NIFFile::ptr nif = Nif::NIFFile::create(name);
|
||||
if(nif->numRoots() < 1)
|
||||
|
@ -651,7 +650,7 @@ public:
|
|||
// Create a base skeleton entity if this NIF needs one
|
||||
createSkelBase(name, group, sceneMgr, node, objectlist);
|
||||
}
|
||||
createObjects(name, group, sceneMgr, node, objectlist);
|
||||
createObjects(name, group, sceneMgr, node, objectlist, flags);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -739,7 +738,7 @@ ObjectList Loader::createObjectBase(Ogre::SceneManager *sceneMgr, std::string na
|
|||
ObjectList objectlist;
|
||||
|
||||
Misc::StringUtils::toLower(name);
|
||||
NIFObjectLoader::load(sceneMgr, objectlist, name, group);
|
||||
NIFObjectLoader::load(sceneMgr, objectlist, name, group, 0xC0000000);
|
||||
|
||||
return objectlist;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue