-------------------------------------------------------------------------------
| 538 | } |
| 539 | //------------------------------------------------------------------------------- |
| 540 | void CMaterialManager::DeleteMaterial(AssetHelper::MeshHelper* pcIn) |
| 541 | { |
| 542 | if (!pcIn || !pcIn->piEffect)return; |
| 543 | pcIn->piEffect->Release(); |
| 544 | |
| 545 | // release all textures associated with the material |
| 546 | if (pcIn->piDiffuseTexture) |
| 547 | { |
| 548 | pcIn->piDiffuseTexture->Release(); |
| 549 | pcIn->piDiffuseTexture = nullptr; |
| 550 | } |
| 551 | if (pcIn->piSpecularTexture) |
| 552 | { |
| 553 | pcIn->piSpecularTexture->Release(); |
| 554 | pcIn->piSpecularTexture = nullptr; |
| 555 | } |
| 556 | if (pcIn->piEmissiveTexture) |
| 557 | { |
| 558 | pcIn->piEmissiveTexture->Release(); |
| 559 | pcIn->piEmissiveTexture = nullptr; |
| 560 | } |
| 561 | if (pcIn->piAmbientTexture) |
| 562 | { |
| 563 | pcIn->piAmbientTexture->Release(); |
| 564 | pcIn->piAmbientTexture = nullptr; |
| 565 | } |
| 566 | if (pcIn->piOpacityTexture) |
| 567 | { |
| 568 | pcIn->piOpacityTexture->Release(); |
| 569 | pcIn->piOpacityTexture = nullptr; |
| 570 | } |
| 571 | if (pcIn->piNormalTexture) |
| 572 | { |
| 573 | pcIn->piNormalTexture->Release(); |
| 574 | pcIn->piNormalTexture = nullptr; |
| 575 | } |
| 576 | if (pcIn->piShininessTexture) |
| 577 | { |
| 578 | pcIn->piShininessTexture->Release(); |
| 579 | pcIn->piShininessTexture = nullptr; |
| 580 | } |
| 581 | if (pcIn->piLightmapTexture) |
| 582 | { |
| 583 | pcIn->piLightmapTexture->Release(); |
| 584 | pcIn->piLightmapTexture = nullptr; |
| 585 | } |
| 586 | pcIn->piEffect = nullptr; |
| 587 | } |
| 588 | //------------------------------------------------------------------------------- |
| 589 | void CMaterialManager::HMtoNMIfNecessary( |
| 590 | IDirect3DTexture9* piTexture, |
no test coverage detected