1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-02-13 21:09:39 +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) if(evt.compare(0, 7, "sound: ") == 0)
{ {

View file

@ -32,7 +32,7 @@ class CharacterController
protected: protected:
/* Called by the animation whenever a new text key is reached. */ /* 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; friend class MWRender::Animation;

View file

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