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

Method AddResourceTexture2D

trinity/Shader/Tr2Effect.cpp:424–439  ·  view source on GitHub ↗

-------------------------------------------------------------------------------- Description: Manually adding a texture 2d resource to this effect's list with creating it. This can fail if the texture name already exists --------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

422// it. This can fail if the texture name already exists
423// --------------------------------------------------------------------------------
424bool Tr2Effect::AddResourceTexture2D( const BlueSharedString& name, const char* resPath )
425{
426 // check if have that name already!
427 if( GetResourceByName( name.c_str() ) )
428 {
429 return false;
430 }
431 // alloc and init the texture parameter
432 TriTextureParameterPtr texture2d;
433 texture2d.CreateInstance();
434 texture2d->SetParameterName( name );
435 texture2d->SetResourcePath( resPath );
436 // add it to this effect's resources
437 m_resources.Append( texture2d->GetRawRoot() );
438 return true;
439}
440
441// --------------------------------------------------------------------------------
442bool Tr2Effect::AddResource( ITriEffectParameter* param )

Callers 11

FillMeshAreaVectorMethod · 0.80
SetupSpotlightSetsMethod · 0.80
SetupBannersMethod · 0.80
SetupBannerSetsMethod · 0.80
SetupInstancedMeshesMethod · 0.80
SetupImpactEffectsMethod · 0.80
CreateBoosterEffectMethod · 0.80
SetupBoostersMethod · 0.80
SetupDecalSetsMethod · 0.80
SetupBoosterEffectMethod · 0.80

Calls 4

CreateInstanceMethod · 0.80
SetParameterNameMethod · 0.80
SetResourcePathMethod · 0.80
AppendMethod · 0.80

Tested by

no test coverage detected