Use a list of mesh names instead of mesh objects

actorid
Chris Robinson 12 years ago
parent 019893b5c6
commit 61ad8bb3dd

@ -1005,7 +1005,7 @@ public:
mesh->setAutoBuildEdgeLists(false);
}
meshes.push_back(std::make_pair(mesh, shape->name));
meshes.push_back(std::make_pair(mesh->getName(), shape->name));
}
else if(node->recType != Nif::RC_NiNode && node->recType != Nif::RC_RootCollisionNode &&
node->recType != Nif::RC_NiRotatingParticles)
@ -1072,7 +1072,7 @@ EntityList NIFLoader::createEntities(Ogre::SceneNode *parent, TextKeyMap *textke
Ogre::SceneManager *sceneMgr = parent->getCreator();
for(size_t i = 0;i < meshes.size();i++)
{
entitylist.mEntities.push_back(sceneMgr->createEntity(meshes[i].first->getName()));
entitylist.mEntities.push_back(sceneMgr->createEntity(meshes[i].first));
Ogre::Entity *entity = entitylist.mEntities.back();
if(!entitylist.mSkelBase && entity->hasSkeleton())
entitylist.mSkelBase = entity;
@ -1118,7 +1118,7 @@ EntityList NIFLoader::createEntities(Ogre::Entity *parent, const std::string &bo
std::transform(filter.begin()+4, filter.end(), filter.begin()+4, ::tolower);
for(size_t i = 0;i < meshes.size();i++)
{
Ogre::Entity *ent = sceneMgr->createEntity(meshes[i].first->getName());
Ogre::Entity *ent = sceneMgr->createEntity(meshes[i].first);
if(ent->hasSkeleton())
{
std::transform(meshes[i].second.begin(), meshes[i].second.end(), meshes[i].second.begin(), ::tolower);

@ -52,9 +52,8 @@ struct EntityList {
};
/** This holds a list of meshes along with the names of their parent nodes
*/
typedef std::vector< std::pair<Ogre::MeshPtr,std::string> > MeshPairList;
/** This holds a list of mesh names along with the names of their parent nodes */
typedef std::vector< std::pair<std::string,std::string> > MeshPairList;
/** Manual resource loader for NIF meshes. This is the main class
responsible for translating the internal NIF mesh structure into

Loading…
Cancel
Save