diff --git a/apps/openmw/mwrender/animation.cpp b/apps/openmw/mwrender/animation.cpp index 2b22ea589..346f5a86b 100644 --- a/apps/openmw/mwrender/animation.cpp +++ b/apps/openmw/mwrender/animation.cpp @@ -33,6 +33,32 @@ namespace MWRender{ animate = loops; time = startTime; } + else if(textmappings){ + std::string startName = groupname + ": start"; + std::string stopName = groupname + ": stop"; + std::cout << "StartName:" << startName << "\n"; + bool first = false; + for(std::map::iterator iter = textmappings->begin(); iter != textmappings->end(); iter++){ + + std::string current = iter->first.substr(0, startName.size()); + std::transform(current.begin(), current.end(), current.begin(), ::tolower); + std::string current2 = iter->first.substr(0, stopName.size()); + std::transform(current2.begin(), current2.end(), current2.begin(), ::tolower); + + if(current == startName){ + startTime = iter->second; + animate = loops; + time = startTime; + first = true; + } + if(current2 == stopName){ + stopTime = iter->second; + if(first) + break; + } + } + + } } void Animation::stopScript(){ diff --git a/apps/openmw/mwrender/animation.hpp b/apps/openmw/mwrender/animation.hpp index d948cd7b8..d3af1b6cb 100644 --- a/apps/openmw/mwrender/animation.hpp +++ b/apps/openmw/mwrender/animation.hpp @@ -10,6 +10,11 @@ #include #include +using namespace boost::algorithm; + + + + namespace MWRender{ class Animation{ diff --git a/components/nifogre/ogre_nif_loader.cpp b/components/nifogre/ogre_nif_loader.cpp index 6990e1a4b..500d5496b 100644 --- a/components/nifogre/ogre_nif_loader.cpp +++ b/components/nifogre/ogre_nif_loader.cpp @@ -1006,6 +1006,8 @@ void NIFLoader::handleNode(Nif::Node *node, int flags, replace(text.begin(), text.end(), '\n', '/'); text.erase(std::remove(text.begin(), text.end(), '\r'), text.end()); + if(text.at(0) == '/') + text.erase(0, 1); file << "Time: " << textiter->time << "|" << text << "\n"; textmappings[text] = textiter->time;