| 311 | } |
| 312 | |
| 313 | void DecalData::_initMaterial() |
| 314 | { |
| 315 | SAFE_DELETE( matInst ); |
| 316 | |
| 317 | _setMaterial(getMaterial()); |
| 318 | |
| 319 | if (mMaterialAsset.notNull() && mMaterialAsset->getStatus() == MaterialAsset::Ok) |
| 320 | { |
| 321 | matInst = getMaterialResource()->createMatInstance(); |
| 322 | } |
| 323 | else |
| 324 | matInst = MATMGR->createMatInstance( "WarningMaterial" ); |
| 325 | |
| 326 | GFXStateBlockDesc desc; |
| 327 | desc.setZReadWrite( true, false ); |
| 328 | //desc.zFunc = GFXCmpLess; |
| 329 | matInst->addStateBlockDesc( desc ); |
| 330 | |
| 331 | matInst->init( MATMGR->getDefaultFeatures(), getGFXVertexFormat<DecalVertex>() ); |
| 332 | if( !matInst->isValid() ) |
| 333 | { |
| 334 | Con::errorf( "DecalData::_initMaterial - failed to create material instance for '%s'", mMaterialAssetId ); |
| 335 | SAFE_DELETE( matInst ); |
| 336 | matInst = MATMGR->createMatInstance( "WarningMaterial" ); |
| 337 | matInst->init( MATMGR->getDefaultFeatures(), getGFXVertexFormat< DecalVertex >() ); |
| 338 | } |
| 339 | } |
| 340 | |
| 341 | void DecalData::_updateMaterial() |
| 342 | { |
nothing calls this directly
no test coverage detected