mirror of
https://github.com/CookiePLMonster/SilentPatch.git
synced 2024-12-29 15:23:02 +05:00
Slightly rework AudioUtilsGetCurrentTimeInMs not to lose precision
This commit is contained in:
parent
8d9ba3a97a
commit
49ab1a5ed8
1 changed files with 1 additions and 2 deletions
|
@ -1230,7 +1230,6 @@ static LARGE_INTEGER UtilsFrequency;
|
||||||
static BOOL WINAPI AudioUtilsFrequency( PLARGE_INTEGER lpFrequency )
|
static BOOL WINAPI AudioUtilsFrequency( PLARGE_INTEGER lpFrequency )
|
||||||
{
|
{
|
||||||
::QueryPerformanceFrequency( &UtilsFrequency );
|
::QueryPerformanceFrequency( &UtilsFrequency );
|
||||||
UtilsFrequency.QuadPart /= 1000;
|
|
||||||
lpFrequency->QuadPart = UtilsFrequency.QuadPart;
|
lpFrequency->QuadPart = UtilsFrequency.QuadPart;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@ -1253,7 +1252,7 @@ static int64_t AudioUtilsGetCurrentTimeInMs()
|
||||||
|
|
||||||
LARGE_INTEGER currentTime;
|
LARGE_INTEGER currentTime;
|
||||||
QueryPerformanceCounter( ¤tTime );
|
QueryPerformanceCounter( ¤tTime );
|
||||||
return (currentTime.QuadPart - UtilsStartTime.QuadPart) / UtilsFrequency.QuadPart;
|
return ((currentTime.QuadPart - UtilsStartTime.QuadPart) * 1000) / UtilsFrequency.QuadPart;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Minimal HUD changes
|
// Minimal HUD changes
|
||||||
|
|
Loading…
Reference in a new issue