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:
parent
3e9b0a333c
commit
c7684cb979
@ -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)
|
||||
{
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user