void MFMaterial_DestroyDefinition(MaterialDefinition *pDefinition) { MFCALLSTACK; if(pDefinition->ownsIni) { MFIni::Destroy(pDefinition->pIni); pDefinition->pIni = NULL; } gMaterialDefList.Destroy(pDefinition); }
int MFTexture_Destroy(MFTexture *pTexture) { pTexture->refCount--; // if no references left, destroy texture if(!pTexture->refCount) { pTexture->pTexture->Release(); gTextureBank.Destroy(pTexture); return 0; } return pTexture->refCount; }
int MFTexture_Destroy(MFTexture *pTexture) { MFCALLSTACK; pTexture->refCount--; int refCount = pTexture->refCount; // if no references left, destroy texture if(!pTexture->refCount) { MFHeap_Free(pTexture->pTemplateData); gTextureBank.Destroy(pTexture); return 0; } return refCount; }
// interface functions MF_API int MFMaterial_AddDefinitionsFile(const char *pName, const char *pFilename) { MFCALLSTACK; MaterialDefinition *pDef = gMaterialDefList.Create(); pDef->pName = pName; pDef->pIni = MFIni::Create(pFilename); if (!pDef->pIni) { gMaterialDefList.Destroy(pDef); MFDebug_Warn(2, "Couldnt create material definitions..."); return 1; } pDef->ownsIni = true; pDef->pNextDefinition = pDefinitionRegistry; pDefinitionRegistry = pDef; return 0; }