diff --git a/apps/openmw/mwclass/creature.cpp b/apps/openmw/mwclass/creature.cpp index 5aa203a49..9b7ea192c 100644 --- a/apps/openmw/mwclass/creature.cpp +++ b/apps/openmw/mwclass/creature.cpp @@ -47,7 +47,7 @@ namespace MWClass const std::string &model = ref->base->model; assert (ref->base != NULL); if(!model.empty()){ - physics.insertActorPhysics(ptr, "meshes\\" + model); + physics.insertObjectPhysics(ptr, "meshes\\" + model); } } diff --git a/apps/openmw/mwclass/npc.cpp b/apps/openmw/mwclass/npc.cpp index acb0a5a35..03c96a4ac 100644 --- a/apps/openmw/mwclass/npc.cpp +++ b/apps/openmw/mwclass/npc.cpp @@ -53,7 +53,7 @@ namespace MWClass std::string smodel = "meshes\\base_anim.nif"; if(beast) smodel = "meshes\\base_animkna.nif"; - physics.insertActorPhysics(ptr, smodel); + physics.insertObjectPhysics(ptr, smodel); } diff --git a/apps/openmw/mwrender/animation.cpp b/apps/openmw/mwrender/animation.cpp index f15bbb074..e1420f477 100644 --- a/apps/openmw/mwrender/animation.cpp +++ b/apps/openmw/mwrender/animation.cpp @@ -35,15 +35,39 @@ namespace MWRender{ } else if(textmappings){ - std::string startName = groupname + ": start"; - std::string stopName = groupname + ": stop"; + std::string startName = groupname + ": loop start"; + std::string stopName = groupname + ": loop stop"; + + bool first = false; if(loops > 1){ startName = groupname + ": loop start"; - std::string stopName = groupname + ": loop stop"; + stopName = groupname + ": loop stop"; + + 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; + } + } } - std::cout << "StartName:" << startName << "\n"; - bool first = false; + if(!first){ + startName = groupname + ": start"; + stopName = groupname + ": stop"; + for(std::map::iterator iter = textmappings->begin(); iter != textmappings->end(); iter++){ std::string current = iter->first.substr(0, startName.size()); @@ -63,6 +87,7 @@ namespace MWRender{ break; } } + } } diff --git a/apps/openmw/mwrender/animation.hpp b/apps/openmw/mwrender/animation.hpp index d3af1b6cb..14b18bf54 100644 --- a/apps/openmw/mwrender/animation.hpp +++ b/apps/openmw/mwrender/animation.hpp @@ -10,8 +10,6 @@ #include #include -using namespace boost::algorithm; -