示例#1
0
void MFMaterial_DeinitModule()
{
	MFCALLSTACK;

	// destroy stock materials
	MFMaterial_Release(pNoneMaterial);
	MFMaterial_Release(pWhiteMaterial);
	MFMaterial_Release(pSysLogoLarge);
	MFMaterial_Release(pSysLogoSmall);

#if defined(_PSP)
	// destroy PSP specific stock materials
	MFMaterial_Release(pConnected);
	MFMaterial_Release(pDisconnected);
	MFMaterial_Release(pPower);
	MFMaterial_Release(pCharging);
	MFMaterial_Release(pUSB);
#endif

	MaterialDefinition *pDef = pDefinitionRegistry;

	while(pDef)
	{
		MaterialDefinition *pNext = pDef->pNextDefinition;
		MFMaterial_DestroyDefinition(pDef);
		pDef = pNext;
	}

	bool bShowHeader = true;

	// list all non-freed materials...
	MFResourceIterator *pI = MFResource_EnumerateFirst(MFRT_Material);
	while(pI)
	{
		if(bShowHeader)
		{
			bShowHeader = false;
			MFDebug_Message("\nUn-freed materials:\n----------------------------------------------------------");
		}

		MFMaterial *pMat = (MFMaterial*)MFResource_Get(pI);

		MFDebug_Message(MFStr("'%s' - x%d", pMat->pName, pMat->refCount));

		pMat->refCount = 1;
		MFMaterial_Release(pMat);

		pI = MFResource_EnumerateNext(pI, MFRT_Material);
	}

	MFMaterial_UnregisterMaterialType("Standard");
	MFMaterial_UnregisterMaterialType("Effect");

	gMaterialDefList.Deinit();
	gMaterialRegistry.Deinit();
}
示例#2
0
void MFMaterial_DeinitModule()
{
	MFCALLSTACK;

	// destroy stock materials
	MFMaterial_Destroy(pNoneMaterial);
	MFMaterial_Destroy(pWhiteMaterial);
	MFMaterial_Destroy(pSysLogoLarge);
	MFMaterial_Destroy(pSysLogoSmall);

#if defined(_PSP)
	// destroy PSP specific stock materials
	MFMaterial_Destroy(pConnected);
	MFMaterial_Destroy(pDisconnected);
	MFMaterial_Destroy(pPower);
	MFMaterial_Destroy(pCharging);
	MFMaterial_Destroy(pUSB);
#endif

	MaterialDefinition *pDef = pDefinitionRegistry;

	while(pDef)
	{
		MaterialDefinition *pNext = pDef->pNextDefinition;
		MFMaterial_DestroyDefinition(pDef);
		pDef = pNext;
	}

	// list all non-freed materials...
	MFMaterial **ppI = gMaterialList.Begin();
	bool bShowHeader = true;

	while(*ppI)
	{
		if(bShowHeader)
		{
			bShowHeader = false;
			MFDebug_Message("\nUn-freed materials:\n----------------------------------------------------------");
		}

		MFDebug_Message(MFStr("'%s' - x%d", (*ppI)->pName, (*ppI)->refCount));

		(*ppI)->refCount = 1;
		MFMaterial_Destroy(*ppI);

		ppI++;
	}

	MFMaterial_UnregisterMaterialType("Standard");
	MFMaterial_UnregisterMaterialType("Effect");

	gMaterialList.Deinit();
	gMaterialDefList.Deinit();
	gMaterialRegistry.Deinit();
}