Preparing to use text indices

actorid
Jason Hooks 13 years ago
parent 595d0b1192
commit 0715f9b6ab

@ -42,7 +42,7 @@ class Animation{
std::vector<Nif::NiKeyframeData>* transformations; std::vector<Nif::NiKeyframeData>* transformations;
std::map<std::string,float> textmappings; std::map<std::string,float>* textmappings;
Ogre::Entity* base; Ogre::Entity* base;
void handleShapes(std::vector<Nif::NiTriShapeCopy>* allshapes, Ogre::Entity* creaturemodel, Ogre::SkeletonInstance *skel); void handleShapes(std::vector<Nif::NiTriShapeCopy>* allshapes, Ogre::Entity* creaturemodel, Ogre::SkeletonInstance *skel);
void handleAnimationTransforms(); void handleAnimationTransforms();

@ -31,7 +31,8 @@ CreatureAnimation::CreatureAnimation(const MWWorld::Ptr& ptr, MWWorld::Environme
stopTime = transformations->begin()->getStopTime(); stopTime = transformations->begin()->getStopTime();
startTime = transformations->begin()->getStartTime(); startTime = transformations->begin()->getStartTime();
shapes = (NIFLoader::getSingletonPtr())->getShapes(meshZero); shapes = (NIFLoader::getSingletonPtr())->getShapes(meshZero);
} }
textmappings = NIFLoader::getSingletonPtr()->getTextIndices(meshZero);
insert->attachObject(base); insert->attachObject(base);
} }
} }

@ -77,6 +77,7 @@ NpcAnimation::NpcAnimation(const MWWorld::Ptr& ptr, MWWorld::Environment& _env,O
stopTime = transformations->begin()->getStopTime(); stopTime = transformations->begin()->getStopTime();
startTime = transformations->begin()->getStartTime(); startTime = transformations->begin()->getStartTime();
} }
textmappings = NIFLoader::getSingletonPtr()->getTextIndices(smodel);
insert->attachObject(base); insert->attachObject(base);
if(female) if(female)

@ -1315,17 +1315,12 @@ std::vector<Nif::NiTriShapeCopy>* NIFLoader::getShapes(std::string lowername){
return pass; return pass;
} }
float NIFLoader::getTime(std::string filename, std::string text){ std::map<std::string, float>* NIFLoader::getTextIndices(std::string lowername){
std::map<std::string,std::map<std::string,float>,ciLessBoost>::iterator iter = alltextmappings.find(filename); std::map<std::string,std::map<std::string, float>, ciLessBoost>::iterator iter = alltextmappings.find(lowername);
if(iter != alltextmappings.end()){ std::map<std::string, float>* pass = 0;
std::map<std::string,float>::iterator insideiter = (iter->second).find(text); if(iter != alltextmappings.end())
if(insideiter != (iter->second).end()) pass = &(iter->second);
return insideiter->second; return pass;
else
return -20000000.0;
}
return -10000000.0;
} }

@ -110,7 +110,7 @@ class NIFLoader : Ogre::ManualResourceLoader
//void insertMeshInsideBase(Ogre::Mesh* mesh); //void insertMeshInsideBase(Ogre::Mesh* mesh);
std::vector<Nif::NiKeyframeData>* getAnim(std::string name); std::vector<Nif::NiKeyframeData>* getAnim(std::string name);
std::vector<Nif::NiTriShapeCopy>* getShapes(std::string name); std::vector<Nif::NiTriShapeCopy>* getShapes(std::string name);
float getTime(std::string filename, std::string text); std::map<std::string, float>* getTextIndices(std::string name);
void addInMesh(Ogre::Mesh* input); void addInMesh(Ogre::Mesh* input);

Loading…
Cancel
Save