Esempio n. 1
0
	DWORD Accelerator::HOOK_GetTickCount( void )
	{
		float rate = Accelerator::GetInstance()->GetRate();
		if (rate - 1.0f > 0.0000001 || rate - 1.0f < -0.000001){
			DWORD result = Real_GetTickCount();
			return result * rate;
		}else
			return Real_GetTickCount();
		
	}
Esempio n. 2
0
	bool Accelerator::SetRate( float fRate ){
		if (Real_GetTickCount == NULL){
			return false;
		}
		::EnterCriticalSection(&s_cs);
		m_dwStartTickCount = Real_GetTickCount();
		m_fRate = fRate;
		::LeaveCriticalSection(&s_cs);
		return true;
	}
Esempio n. 3
0
static DWORD WINAPI Mine_GetTickCount(VOID)
{
	DWORD dwTickCount = Real_GetTickCount();

	EnterCriticalSection(&g_csGetTickCount);
	static DWORD dwLastCount = 0;
	static DWORD dwLastResult = 0;
	if (dwLastCount == 0)
	{
		dwLastCount = dwTickCount;
		dwLastResult = dwTickCount;
	}
	else
	{
		dwLastResult += (DWORD)((dwTickCount - dwLastCount) * g_fSpeed + 0.5);
		dwLastCount = dwTickCount;
		dwTickCount = dwLastResult;
	}
	LeaveCriticalSection(&g_csGetTickCount);
	return dwTickCount;
}