Ejemplo n.º 1
0
MF_API void MFInput_EnableBufferedInput(bool bEnable, int frequency)
{
	gInputFrequency = frequency;

	if(!gInputThread)
	{
		for(int i=0; i<MFInput_MaxInputID; ++i)
		{
			gInputEvents[IDD_Gamepad][i] = (MFInputEvent*)MFHeap_Alloc(sizeof(MFInputEvent)*MaxEvents);
			gNumEvents[IDD_Gamepad][i] = 0;
		}

		gInputMutex = MFThread_CreateMutex("MFInput Mutex");
		gInputThread = MFThread_CreateThread("MFInput Thread", &MFInput_Thread, NULL);
	}
	else
	{
		bInputTerminate = true;
		MFThread_Join(gInputThread);
		gInputThread = NULL;
		MFThread_DestroyMutex(gInputMutex);

		for(int i=0; i<MFInput_MaxInputID; ++i)
		{
			MFHeap_Free(gInputEvents[IDD_Gamepad][i]);
		}
	}
}
Ejemplo n.º 2
0
void MFObjectPoolGroup::Deinit()
{
	MFThread_LockMutex(mutex);

	for(int a=0; a<numPools; ++a)
		pPools[a].Deinit();

	MFThread_DestroyMutex(mutex);

	MFHeap_Free(pConfig);
}
Ejemplo n.º 3
0
void MFObjectPool::Deinit()
{
	if(!pMemory)
		return;

	MFThread_LockMutex(mutex);

	if(pNext)
	{
		pNext->Deinit();
		MFHeap_Free(pNext);
		pNext = NULL;
	}

	MFThread_DestroyMutex(mutex);

	if(bOwnMemory)
		MFHeap_Free(pMemory);
	pMemory = NULL;
}