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(); }
void MFMaterial_Update() { MFCALLSTACK; MFMaterial **ppMatIterator = gMaterialList.Begin(); while(ppMatIterator && *ppMatIterator) { if((*ppMatIterator)->pType->materialCallbacks.pUpdate) (*ppMatIterator)->pType->materialCallbacks.pUpdate(*ppMatIterator); ppMatIterator++; } }
MF_API void MFCollision_DebugDraw() { if(!gShowCollision) return; // draw each item.. MFCollisionItem **ppIterator = gItemList.Begin(); while(*ppIterator) { MFCollision_DrawItem(*ppIterator); ppIterator++; } }
MF_API MFMaterial* MFMaterial_Find(const char *pName) { MFCALLSTACK; MFMaterial **ppIterator = gMaterialList.Begin(); while(*ppIterator) { if(!MFString_CaseCmp(pName, (*ppIterator)->pName)) return *ppIterator; ppIterator++; } return NULL; }
MFMaterialType *MaterialInternal_GetMaterialType(const char *pTypeName) { MFCALLSTACK; MFMaterialType **ppIterator = gMaterialRegistry.Begin(); while(*ppIterator) { if(!MFString_CaseCmp(pTypeName, (*ppIterator)->pTypeName)) return *ppIterator; ppIterator++; } return NULL; }