MCPcopy Create free account
hub / github.com/GarageGames/Torque3D / initMatInstances

Method initMatInstances

Engine/source/materials/materialList.cpp:384–407  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

382}
383
384void MaterialList::initMatInstances( const FeatureSet &features,
385 const GFXVertexFormat *vertexFormat )
386{
387 for( U32 i=0; i < mMatInstList.size(); i++ )
388 {
389 BaseMatInstance *matInst = mMatInstList[i];
390 if ( !matInst )
391 continue;
392
393 if ( !matInst->init( features, vertexFormat ) )
394 {
395 Con::errorf( "MaterialList::initMatInstances - failed to initialize material instance for '%s'",
396 matInst->getMaterial()->getName() );
397
398 // Fall back to warning material.
399
400 SAFE_DELETE( matInst );
401 matInst = MATMGR->createMatInstance( "WarningMaterial" );
402 matInst->init( MATMGR->getDefaultFeatures(), vertexFormat );
403 mMatInstList[ i ] = matInst;
404 }
405 }
406
407}
408
409void MaterialList::setMaterialInst( BaseMatInstance *matInst, U32 texIndex )
410{

Callers 1

initMaterialListMethod · 0.80

Calls 6

errorfFunction · 0.85
sizeMethod · 0.45
initMethod · 0.45
getNameMethod · 0.45
getMaterialMethod · 0.45
createMatInstanceMethod · 0.45

Tested by

no test coverage detected