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

Method Link

trinity/Controllers/Tr2Controller.cpp:111–156  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

109}
110
111void Tr2Controller::Link( IRoot& owner )
112{
113 CCP_STATS_ZONE( __FUNCTION__ );
114 {
115
116 CCP_STATS_INC( controllerLinkCount );
117 CCP_STATS_SCOPED_TIME( controllerLinkTime );
118
119 Unlink();
120
121
122 CcpParser::OffsetType offset = 0;
123 m_variableView.clear();
124 for( auto& var : m_variables )
125 {
126 m_variableView.push_back( { var->GetName().c_str(), 0, offset } );
127 offset += sizeof( float );
128 }
129 m_variableData.resize( "", offset );
130 offset = 0;
131 uint32_t index = 0;
132 for( auto& var : m_variables )
133 {
134 var->SetDestinationBuffer( reinterpret_cast<float*>( m_variableData.get() + offset ) );
135 offset += sizeof( float );
136 if( index < 64 )
137 {
138 var->SetDirtyMask( &m_dirtyVariables, 1ull << index++ );
139 }
140 else
141 {
142 var->SetDirtyMask( nullptr, 0 );
143 }
144 }
145
146 m_owner = &owner;
147 for( auto it = begin( m_stateMachines ); it != end( m_stateMachines ); ++it )
148 {
149 ( *it )->Link( *this );
150 }
151 for( auto it = begin( m_eventHandlers ); it != end( m_eventHandlers ); ++it )
152 {
153 ( *it )->Link( *this );
154 }
155 }
156}
157
158void Tr2Controller::Unlink( UnlinkReason reason )
159{

Callers 15

OnListModifiedMethod · 0.45
RebindMethod · 0.45
OnListModifiedMethod · 0.45
InitializeMethod · 0.45
OnListModifiedMethod · 0.45
InitializeMethod · 0.45
OnListModifiedMethod · 0.45
InitializeMethod · 0.45
InitializeBindingsMethod · 0.45
RebindMethod · 0.45
OnListModifiedMethod · 0.45
InitializeMethod · 0.45

Calls 6

SetDestinationBufferMethod · 0.80
getMethod · 0.80
SetDirtyMaskMethod · 0.80
beginFunction · 0.50
endFunction · 0.50
GetNameMethod · 0.45

Tested by

no test coverage detected