mirror of
				https://github.com/OpenMW/openmw.git
				synced 2025-11-04 06:26:39 +00:00 
			
		
		
		
	Pass the key time to markerEvent
This commit is contained in:
		
							parent
							
								
									3e9b0a333c
								
							
						
					
					
						commit
						c7684cb979
					
				
					 3 changed files with 7 additions and 5 deletions
				
			
		| 
						 | 
					@ -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)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -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;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -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);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue