示例#1
0
文件: throttle.c 项目: pedgarcia/VCC
void FrameWait(void)
{
	QueryPerformanceCounter(&CurrentTime);
	while ( (TargetTime.QuadPart-CurrentTime.QuadPart)> (OneMs.QuadPart*2))	//If we have more that 2Ms till the end of the frame
	{
		Sleep(1);	//Give about 1Ms back to the system
		QueryPerformanceCounter(&CurrentTime);	//And check again
	}

	if (GetSoundStatus())	//Lean on the sound card a bit for timing
	{
		PurgeAuxBuffer();
		if (FrameSkip==1)
		{
			if (GetFreeBlockCount()>AUDIOBUFFERS/2)		//Dont let the buffer get lest that half full
				return;
			while (GetFreeBlockCount() < 1);	// Dont let it fill up either
		}

	}
	while ( CurrentTime.QuadPart< TargetTime.QuadPart)	//Poll Untill frame end.
		QueryPerformanceCounter(&CurrentTime);

	return;
}
示例#2
0
dword CFileSystem::GetDiskLeftSpace()
{	
	return FSParams.BlockSize * GetFreeBlockCount();
}