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

Method Link

trinity/Controllers/Tr2TimelineController.cpp:54–90  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

52
53
54void Tr2TimelineController::Link( IRoot& owner )
55{
56 CCP_STATS_ZONE( __FUNCTION__ );
57 {
58
59 CCP_STATS_INC( controllerLinkCount );
60 CCP_STATS_SCOPED_TIME( controllerLinkTime );
61
62 Unlink();
63
64 CcpParser::OffsetType offset = 0;
65 m_variableView.clear();
66 for( auto& var : m_variables )
67 {
68 m_variableView.push_back( { var->GetName().c_str(), 0, offset } );
69 offset += sizeof( float );
70 }
71 m_variableData.resize( "", offset );
72 offset = 0;
73 for( auto& var : m_variables )
74 {
75 var->SetDestinationBuffer( reinterpret_cast<float*>( m_variableData.get() + offset ) );
76 offset += sizeof( float );
77 var->SetDirtyMask( nullptr, 0 );
78 }
79
80 m_owner = &owner;
81 for( auto& action : m_actions )
82 {
83 action->Link( *this );
84 }
85 for( auto& eventHandler : m_eventHandlers )
86 {
87 eventHandler->Link( *this );
88 }
89 }
90}
91
92void Tr2TimelineController::Unlink( UnlinkReason reason )
93{

Callers 1

AddActionMethod · 0.45

Calls 4

SetDestinationBufferMethod · 0.80
getMethod · 0.80
SetDirtyMaskMethod · 0.80
GetNameMethod · 0.45

Tested by

no test coverage detected