Try workaround for #700

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@11629 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
auria 2012-09-22 18:37:47 +00:00
parent 8742355d40
commit f687659929
2 changed files with 18 additions and 1 deletions

View File

@ -187,6 +187,16 @@ void CutsceneWorld::update(float dt)
}
**/
if (m_time < 0.0001f)
{
PtrVector<TrackObject>& objects = m_track->getTrackObjectManager()->getObjects();
TrackObject* curr;
for_in(curr, objects)
{
curr->reset();
}
}
m_time += dt;
if (m_time < 2.0f)
@ -204,6 +214,8 @@ void CutsceneWorld::update(float dt)
float currFrame = m_time * 25.0f; // We assume 25 FPS
//printf("Estimated current frame : %f\n", currFrame);
const std::vector<Subtitle>& subtitles = m_track->getSubtitles();
bool foundSubtitle = false;
for (unsigned int n = 0; n < subtitles.size(); n++)

View File

@ -403,7 +403,12 @@ void TrackObject::reset()
a_node->setRotation(m_init_hpr);
a_node->setScale(m_init_scale);
a_node->setLoopMode(m_is_looped);
a_node->setCurrentFrame(a_node->getStartFrame());
// trick to reset the animation AND also the timer inside it
a_node->OnAnimate(0);
a_node->OnAnimate(0);
if(m_is_looped)
{
a_node->setFrameLoop(m_frame_start, m_frame_end);