| 382 | } |
| 383 | |
| 384 | void 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 | |
| 409 | void MaterialList::setMaterialInst( BaseMatInstance *matInst, U32 texIndex ) |
| 410 | { |
no test coverage detected