mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-03-29 16:06:44 +00:00
Recognize and partly handle NiBSParticleNode
This commit is contained in:
parent
f4695ec4ac
commit
bf8bc989fc
4 changed files with 10 additions and 6 deletions
|
@ -208,7 +208,7 @@ static const RecordFactoryEntry recordFactories [] = {
|
||||||
|
|
||||||
{ "NiNode", &construct <NiNode >, RC_NiNode },
|
{ "NiNode", &construct <NiNode >, RC_NiNode },
|
||||||
{ "AvoidNode", &construct <NiNode >, RC_NiNode },
|
{ "AvoidNode", &construct <NiNode >, RC_NiNode },
|
||||||
{ "NiBSParticleNode", &construct <NiNode >, RC_NiNode },
|
{ "NiBSParticleNode", &construct <NiNode >, RC_NiBSParticleNode },
|
||||||
{ "NiBSAnimationNode", &construct <NiNode >, RC_NiBSAnimationNode },
|
{ "NiBSAnimationNode", &construct <NiNode >, RC_NiBSAnimationNode },
|
||||||
{ "NiBillboardNode", &construct <NiNode >, RC_NiNode },
|
{ "NiBillboardNode", &construct <NiNode >, RC_NiNode },
|
||||||
{ "NiTriShape", &construct <NiTriShape >, RC_NiTriShape },
|
{ "NiTriShape", &construct <NiTriShape >, RC_NiTriShape },
|
||||||
|
|
|
@ -39,6 +39,7 @@ enum RecordType
|
||||||
RC_NiTriShape,
|
RC_NiTriShape,
|
||||||
RC_NiRotatingParticles,
|
RC_NiRotatingParticles,
|
||||||
RC_NiAutoNormalParticles,
|
RC_NiAutoNormalParticles,
|
||||||
|
RC_NiBSParticleNode,
|
||||||
RC_NiCamera,
|
RC_NiCamera,
|
||||||
RC_NiTexturingProperty,
|
RC_NiTexturingProperty,
|
||||||
RC_NiMaterialProperty,
|
RC_NiMaterialProperty,
|
||||||
|
|
|
@ -469,7 +469,7 @@ class NIFObjectLoader
|
||||||
|
|
||||||
static void createParticleSystem(const std::string &name, const std::string &group,
|
static void createParticleSystem(const std::string &name, const std::string &group,
|
||||||
Ogre::SceneManager *sceneMgr, ObjectList &objectlist,
|
Ogre::SceneManager *sceneMgr, ObjectList &objectlist,
|
||||||
const Nif::Node *partnode, int flags, int animflags)
|
const Nif::Node *partnode, int flags, int partflags)
|
||||||
{
|
{
|
||||||
const Nif::NiAutoNormalParticlesData *particledata = NULL;
|
const Nif::NiAutoNormalParticlesData *particledata = NULL;
|
||||||
if(partnode->recType == Nif::RC_NiAutoNormalParticles)
|
if(partnode->recType == Nif::RC_NiAutoNormalParticles)
|
||||||
|
@ -539,7 +539,7 @@ class NIFObjectLoader
|
||||||
|
|
||||||
static void createObjects(const std::string &name, const std::string &group,
|
static void createObjects(const std::string &name, const std::string &group,
|
||||||
Ogre::SceneManager *sceneMgr, const Nif::Node *node,
|
Ogre::SceneManager *sceneMgr, const Nif::Node *node,
|
||||||
ObjectList &objectlist, int flags, int animflags)
|
ObjectList &objectlist, int flags, int animflags, int partflags)
|
||||||
{
|
{
|
||||||
// Do not create objects for the collision shape (includes all children)
|
// Do not create objects for the collision shape (includes all children)
|
||||||
if(node->recType == Nif::RC_RootCollisionNode)
|
if(node->recType == Nif::RC_RootCollisionNode)
|
||||||
|
@ -552,6 +552,8 @@ class NIFObjectLoader
|
||||||
|
|
||||||
if(node->recType == Nif::RC_NiBSAnimationNode)
|
if(node->recType == Nif::RC_NiBSAnimationNode)
|
||||||
animflags |= node->flags;
|
animflags |= node->flags;
|
||||||
|
else if(node->recType == Nif::RC_NiBSParticleNode)
|
||||||
|
partflags |= node->flags;
|
||||||
else
|
else
|
||||||
flags |= node->flags;
|
flags |= node->flags;
|
||||||
|
|
||||||
|
@ -622,7 +624,7 @@ class NIFObjectLoader
|
||||||
if((node->recType == Nif::RC_NiAutoNormalParticles ||
|
if((node->recType == Nif::RC_NiAutoNormalParticles ||
|
||||||
node->recType == Nif::RC_NiRotatingParticles) && !(flags&0x40000000))
|
node->recType == Nif::RC_NiRotatingParticles) && !(flags&0x40000000))
|
||||||
{
|
{
|
||||||
createParticleSystem(name, group, sceneMgr, objectlist, node, flags, animflags);
|
createParticleSystem(name, group, sceneMgr, objectlist, node, flags, partflags);
|
||||||
}
|
}
|
||||||
|
|
||||||
const Nif::NiNode *ninode = dynamic_cast<const Nif::NiNode*>(node);
|
const Nif::NiNode *ninode = dynamic_cast<const Nif::NiNode*>(node);
|
||||||
|
@ -632,7 +634,7 @@ class NIFObjectLoader
|
||||||
for(size_t i = 0;i < children.length();i++)
|
for(size_t i = 0;i < children.length();i++)
|
||||||
{
|
{
|
||||||
if(!children[i].empty())
|
if(!children[i].empty())
|
||||||
createObjects(name, group, sceneMgr, children[i].getPtr(), objectlist, flags, animflags);
|
createObjects(name, group, sceneMgr, children[i].getPtr(), objectlist, flags, animflags, partflags);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -679,7 +681,7 @@ public:
|
||||||
// Create a base skeleton entity if this NIF needs one
|
// Create a base skeleton entity if this NIF needs one
|
||||||
createSkelBase(name, group, sceneMgr, node, objectlist);
|
createSkelBase(name, group, sceneMgr, node, objectlist);
|
||||||
}
|
}
|
||||||
createObjects(name, group, sceneMgr, node, objectlist, flags, 0);
|
createObjects(name, group, sceneMgr, node, objectlist, flags, 0, 0);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -165,6 +165,7 @@ void NIFSkeletonLoader::buildBones(Ogre::Skeleton *skel, const Nif::Node *node,
|
||||||
node->recType == Nif::RC_RootCollisionNode || /* handled in nifbullet (hopefully) */
|
node->recType == Nif::RC_RootCollisionNode || /* handled in nifbullet (hopefully) */
|
||||||
node->recType == Nif::RC_NiTriShape || /* Handled in the mesh loader */
|
node->recType == Nif::RC_NiTriShape || /* Handled in the mesh loader */
|
||||||
node->recType == Nif::RC_NiBSAnimationNode || /* Handled in the object loader */
|
node->recType == Nif::RC_NiBSAnimationNode || /* Handled in the object loader */
|
||||||
|
node->recType == Nif::RC_NiBSParticleNode ||
|
||||||
node->recType == Nif::RC_NiCamera ||
|
node->recType == Nif::RC_NiCamera ||
|
||||||
node->recType == Nif::RC_NiAutoNormalParticles ||
|
node->recType == Nif::RC_NiAutoNormalParticles ||
|
||||||
node->recType == Nif::RC_NiRotatingParticles
|
node->recType == Nif::RC_NiRotatingParticles
|
||||||
|
|
Loading…
Reference in a new issue