Added parameters to Clock class

It is now possible to build a Clock object in a paused state, or to give
it an "already elapsed time" value


Former-commit-id: 20e9c55de8a12a9220f81dc7759a4113a794648f
This commit is contained in:
Lynix 2014-03-20 23:06:22 +01:00
parent 2ea87a601a
commit b212f7c890
2 changed files with 4 additions and 4 deletions

View File

@ -18,7 +18,7 @@
class NAZARA_API NzClock
{
public:
NzClock();
NzClock(nzUInt64 startingValue = 0, bool paused = false);
float GetSeconds() const;
nzUInt64 GetMicroseconds() const;

View File

@ -39,10 +39,10 @@ namespace
}
}
NzClock::NzClock() :
m_elapsedTime(0),
NzClock::NzClock(nzUInt64 startingValue, bool paused) :
m_elapsedTime(startingValue),
m_refTime(NzGetMicroseconds()),
m_paused(false)
m_paused(paused)
{
}