MCPcopy Create free account
hub / github.com/carbonengine/trinity / SetTime

Method SetTime

trinity/Controllers/Tr2TimelineController.cpp:627–661  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

625}
626
627void Tr2TimelineController::SetTime( float time )
628{
629 if( !m_isActive )
630 {
631 return;
632 }
633 if( time == m_time )
634 {
635 return;
636 }
637
638 auto oldTime = m_time;
639 m_time = time;
640
641 CcpAutoMutex lock( g_controllerMutex );
642 for( size_t i = 0; i < m_actions.size(); ++i )
643 {
644 if( !IsActionEnabled( i ) )
645 {
646 continue;
647 }
648 auto action = m_actions[i];
649 auto& entry = m_entries[i];
650 auto wasActive = InRange( oldTime, entry );
651 auto nowActive = InRange( m_time, entry );
652 if( wasActive && !nowActive )
653 {
654 action->Stop( *this );
655 }
656 else if( !wasActive && nowActive )
657 {
658 action->Start( *this );
659 }
660 }
661}
662
663void Tr2TimelineController::Pause()
664{

Callers

nothing calls this directly

Calls 4

InRangeFunction · 0.85
sizeMethod · 0.80
StopMethod · 0.45
StartMethod · 0.45

Tested by

no test coverage detected