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

Method SetActionStartTime

trinity/Controllers/Tr2TimelineController.cpp:422–447  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

420}
421
422BlueStdResult Tr2TimelineController::SetActionStartTime( size_t index, float startTime )
423{
424 if( index >= m_actions.size() )
425 {
426 return BlueStdResult( BLUE_STD_RESULT_VALUE_ERROR, "Index out of range" );
427 }
428 if( m_isActive && IsActionEnabled( index ) )
429 {
430 auto action = m_actions[index];
431 auto& entry = m_entries[index];
432 auto wasActive = InRange( m_time, entry );
433 auto nowActive = InRange( m_time, { startTime, entry.endTime } );
434 if( wasActive && !nowActive )
435 {
436 CcpAutoMutex lock( g_controllerMutex );
437 action->Stop( *this );
438 }
439 else if( !wasActive && nowActive )
440 {
441 CcpAutoMutex lock( g_controllerMutex );
442 action->Start( *this );
443 }
444 }
445 m_entries[index].startTime = startTime;
446 return {};
447}
448
449BlueStdResult Tr2TimelineController::SetActionEndTime( size_t index, float endTime )
450{

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