diff --git a/apps/openmw/mwrender/animation.cpp b/apps/openmw/mwrender/animation.cpp index f5ab9e8c5..93025ae09 100644 --- a/apps/openmw/mwrender/animation.cpp +++ b/apps/openmw/mwrender/animation.cpp @@ -40,7 +40,8 @@ namespace MWRender{ shapeNumber = 0; std::vector::iterator allshapesiter; for(allshapesiter = allshapes->begin(); allshapesiter != allshapes->end(); allshapesiter++) - { + + { Nif::NiTriShapeCopy& copy = *allshapesiter; std::vector allvertices = copy.vertices; @@ -261,21 +262,9 @@ namespace MWRender{ } } - - } - - - for(allshapesiter = allshapes->begin(); allshapesiter != allshapes->end(); allshapesiter++) - { - Nif::NiTriShapeCopy copy = *allshapesiter; - Ogre::HardwareVertexBufferSharedPtr vbuf = creaturemodel->getMesh()->getSubMesh(copy.sname)->vertexData->vertexBufferBinding->getBuffer(0); - - Ogre::HardwareVertexBufferSharedPtr vbufNormal = creaturemodel->getMesh()->getSubMesh(copy.sname)->vertexData->vertexBufferBinding->getBuffer(1); - vbuf->unlock(); + vbuf->unlock(); vbufNormal->unlock(); - } - - + } } bool Animation::timeIndex( float time, std::vector times, int & i, int & j, float & x ){ diff --git a/apps/openmw/mwrender/creatureanimation.cpp b/apps/openmw/mwrender/creatureanimation.cpp index 868561ca8..2829c7ea1 100644 --- a/apps/openmw/mwrender/creatureanimation.cpp +++ b/apps/openmw/mwrender/creatureanimation.cpp @@ -49,7 +49,12 @@ void CreatureAnimation::runAnimation(float timepassed){ //Handle the shapes dependent on animation transforms time += timepassed; - + if(time > transformations->begin()->getStopTime()){ + animate = false; + std::cout << "Stopping the animation\n"; + return; + } + handleAnimationTransforms(); handleShapes(shapes, base, base->getSkeleton());