1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-25 06:35:30 +00:00

Pass the key time to markerEvent

This commit is contained in:
Chris Robinson 2013-01-18 14:50:55 -08:00
parent 3e9b0a333c
commit c7684cb979
3 changed files with 7 additions and 5 deletions

View File

@ -56,7 +56,7 @@ CharacterController::CharacterController(const CharacterController &rhs)
}
void CharacterController::markerEvent(const std::string &evt)
void CharacterController::markerEvent(float time, const std::string &evt)
{
if(evt.compare(0, 7, "sound: ") == 0)
{

View File

@ -32,7 +32,7 @@ class CharacterController
protected:
/* Called by the animation whenever a new text key is reached. */
void markerEvent(const std::string &evt);
void markerEvent(float time, const std::string &evt);
friend class MWRender::Animation;

View File

@ -223,13 +223,15 @@ void Animation::runAnimation(float timepassed)
break;
}
float time = mNextKey->first;
const std::string &evt = mNextKey->second;
updatePosition(mNextKey->first);
timepassed = targetTime - mNextKey->first;
mNextKey++;
updatePosition(time);
timepassed = targetTime - time;
if(mController)
mController->markerEvent(evt);
mController->markerEvent(time, evt);
}
}