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

Method Initialize

trinity/Shader/Tr2Effect.cpp:374–410  ·  view source on GitHub ↗

---------------------------------------------------------------

Source from the content-addressed store, hash-verified

372
373// ---------------------------------------------------------------
374bool Tr2Effect::Initialize()
375{
376 CCP_STATS_ZONE( __FUNCTION__ );
377
378 for( auto it = begin( m_resources ); it != end( m_resources ); ++it )
379 {
380 ( *it )->OnAddedToMaterial( this );
381 }
382
383 if( m_effectResource )
384 {
385 ReleaseCachedData( m_effectResource );
386 m_effectResource->RemoveNotifyTarget( this );
387 m_effectResource.Unlock();
388 }
389
390 if( m_effectFilePath.size() > 0 )
391 {
392 if( !ConvertEffectPath( m_effectFilePath, m_actualEffectFilePath ) )
393 {
394 m_actualEffectFilePath = "";
395 return true;
396 }
397 BeResMan->GetResource( m_actualEffectFilePath.c_str(), "", BlueInterfaceIID<Tr2EffectRes>(), (void**)&m_effectResource );
398
399 if( m_effectResource )
400 {
401 m_effectResource->AddNotifyTarget( this );
402 }
403 }
404 else
405 {
406 m_actualEffectFilePath = "";
407 }
408
409 return true;
410}
411
412// ---------------------------------------------------------------
413void Tr2Effect::SetEffectPathName( const char* path )

Callers 1

ConvertEffectConstantFunction · 0.45

Calls 9

ConvertEffectPathFunction · 0.85
RemoveNotifyTargetMethod · 0.80
sizeMethod · 0.80
AddNotifyTargetMethod · 0.80
beginFunction · 0.50
endFunction · 0.50
OnAddedToMaterialMethod · 0.45
UnlockMethod · 0.45
GetResourceMethod · 0.45

Tested by

no test coverage detected