Beispiel #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();
}
Beispiel #2
0
void Game_Deinit()
{
	MFStateBlock_Destroy(pPrismStateBlock);
	MFStateBlock_Destroy(pPrismMeshStateBlock);
	MFVertex_ReleaseVertexBuffer(pPrismVertexBuffer);

	MFStateBlock_Destroy(pBoxStateBlock);
	MFStateBlock_Destroy(pBoxMeshStateBlock);
	MFVertex_ReleaseVertexBuffer(pBoxVertexBuffer);

	MFVertex_ReleaseVertexDeclaration(pVertexDecl);

	MFMaterial_Release(pPrismRenderTarget);

	MFRenderer_Destroy(pRenderer);
}
Beispiel #3
0
void dBFrame::SetMaterial(const char *pMaterial)
{
	if(pMaterial)
	{
		pMat = MFMaterial_Create(pMaterial);
		MFVector colour = MakeVector(0.2f, 0.5f, 1, 1);
		SetCornerColours(colour, colour, colour, colour);
//		int zread = MFMaterial_GetParameterIndexFromName(pMat, "zread");
//		size_t off = 0;
//		MFMaterial_SetParameter(pMat, zread, 0, &off);
	}
	else if(pMat)
	{
		MFMaterial_Release(pMat);
		pMat = NULL;
	}
}
Beispiel #4
0
void Fretboard::LoadFretboard(const char *pImage)
{
	if(pFretboard)
		MFMaterial_Release(pFretboard);

	pFretboard = MFMaterial_Create(MFStr("Fretboards/%s", pImage));

	if(pFretboard)
	{
		int zRead = MFMaterial_GetParameterIndexFromName(pFretboard, "zread");
		int zWrite = MFMaterial_GetParameterIndexFromName(pFretboard, "zwrite");
		int off = 0;

		MFMaterial_SetParameterI(pFretboard, zRead, 0, 0);
		MFMaterial_SetParameterI(pFretboard, zWrite, 0, 0);
	}
}
Beispiel #5
0
void EditorScreen::Deselect()
{
	eventSuggestions.ReleaseEventSuggestions();

	delete gGame.pTrack;
	delete gGame.pTrack2;

	gEditor.pSong->Destroy();

	// clean up sounds
	MFSound_Destroy(gEditor.pStepSound);
	MFSound_Destroy(gEditor.pChangeSound);
	MFSound_Destroy(gEditor.pSaveSound);
	MFSound_Destroy(gEditor.pClapSound);
	MFSound_Destroy(gEditor.pHighTickSound);
	MFSound_Destroy(gEditor.pLowTickSound);

	MFMaterial_Release(gEditor.pMetronome);
}
Beispiel #6
0
Fretboard::~Fretboard()
{
	// clean up models
	MFModel_Release(pButton);

	// clean up materials
	MFMaterial_Release(pEdge);
	MFMaterial_Release(pBar);

	MFMaterial_Release(pFrets);
	MFMaterial_Release(pRing);

	for(int a=0; a<5; ++a)
	{
		MFMaterial_Release(pColourRing[a]);
		MFMaterial_Release(pButtonMat[a]);
		MFMaterial_Release(pButtonRing[a]);
	}

	MFMaterial_Release(pFretboard);
}
Beispiel #7
0
dBFrame::~dBFrame()
{
	if(pMat)
		MFMaterial_Release(pMat);
}