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::map<std::string,float> textmappings;
std::map<std::string,float>* textmappings;
Ogre::Entity* base;
void handleShapes(std::vector<Nif::NiTriShapeCopy>* allshapes, Ogre::Entity* creaturemodel, Ogre::SkeletonInstance *skel);
void handleAnimationTransforms();

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

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

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

@ -110,7 +110,7 @@ class NIFLoader : Ogre::ManualResourceLoader
//void insertMeshInsideBase(Ogre::Mesh* mesh);
std::vector<Nif::NiKeyframeData>* getAnim(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);

Loading…
Cancel
Save