MCPcopy Create free account
hub / github.com/assimp/assimp / DeleteMaterial

Method DeleteMaterial

tools/assimp_view/Material.cpp:540–587  ·  view source on GitHub ↗

-------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

538}
539//-------------------------------------------------------------------------------
540void 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//-------------------------------------------------------------------------------
589void CMaterialManager::HMtoNMIfNecessary(
590 IDirect3DTexture9* piTexture,

Callers 4

HandleTreeViewPopup2Method · 0.80
RemoveSBDepsMethod · 0.80
SetCubeMapBGMethod · 0.80

Calls 1

ReleaseMethod · 0.45

Tested by

no test coverage detected