mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-18 15:49:18 +02:00
build 170908. minor refactoring and diagnostics enhancements, virtual coupling fix, support for pantograph compressor submodels
This commit is contained in:
17
Timer.cpp
17
Timer.cpp
@@ -66,9 +66,9 @@ void ResetTimers()
|
||||
};
|
||||
|
||||
LONGLONG fr, count, oldCount;
|
||||
// LARGE_INTEGER fr,count;
|
||||
void UpdateTimers(bool pause)
|
||||
{
|
||||
|
||||
void UpdateTimers(bool pause) {
|
||||
|
||||
QueryPerformanceFrequency((LARGE_INTEGER *)&fr);
|
||||
QueryPerformanceCounter((LARGE_INTEGER *)&count);
|
||||
DeltaRenderTime = double(count - oldCount) / double(fr);
|
||||
@@ -78,18 +78,14 @@ void UpdateTimers(bool pause)
|
||||
fSoundTimer += DeltaTime;
|
||||
if (fSoundTimer > 0.1)
|
||||
fSoundTimer = 0.0;
|
||||
/*
|
||||
double CurrentTime= double(count)/double(fr);//GetTickCount();
|
||||
DeltaTime= (CurrentTime-OldTime);
|
||||
OldTime= CurrentTime;
|
||||
*/
|
||||
|
||||
if (DeltaTime > 1.0)
|
||||
DeltaTime = 1.0;
|
||||
}
|
||||
else
|
||||
DeltaTime = 0.0; // wszystko stoi, bo czas nie płynie
|
||||
oldCount = count;
|
||||
|
||||
oldCount = count;
|
||||
// Keep track of the time lapse and frame count
|
||||
#if _WIN32_WINNT >= _WIN32_WINNT_VISTA
|
||||
double fTime = ::GetTickCount64() * 0.001f; // Get current time in seconds
|
||||
@@ -106,6 +102,7 @@ void UpdateTimers(bool pause)
|
||||
}
|
||||
fSimulationTime += DeltaTime;
|
||||
};
|
||||
};
|
||||
|
||||
}; // namespace timer
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user