OpenBarnyard
 
Loading...
Searching...
No Matches
THPTimer_Win.cpp
Go to the documentation of this file.
1#include "ToshiPCH.h"
2#include "THPTimer_Win.h"
3
4#include <windows.h>
5
6//-----------------------------------------------------------------------------
7// Enables memory debugging.
8// Note: Should be the last include!
9//-----------------------------------------------------------------------------
10#include "Core/TMemoryDebugOn.h"
11
13
14// $Barnyard: FUNCTION 006bdcb0
16{
17 Reset();
18}
19
21{
22 Reset();
23}
24
26{
27 LARGE_INTEGER raw32;
28 QueryPerformanceCounter( &raw32 );
29 return static_cast<TUINT32>( raw32.QuadPart );
30}
31
33{
34 LARGE_INTEGER raw64;
35 QueryPerformanceCounter( &raw64 );
36 return raw64.QuadPart;
37}
38
39// $Barnyard: FUNCTION 006bdc10
41{
42 QueryPerformanceCounter( (LARGE_INTEGER*)&m_iCurrentTime );
43 QueryPerformanceFrequency( (LARGE_INTEGER*)&m_iFrequency );
44 m_iOldTime = m_iCurrentTime;
45 m_fDelta = 0;
46}
47
48// $Barnyard: FUNCTION 006bdc50
50{
51 m_iOldTime = m_iCurrentTime;
52 QueryPerformanceCounter( (LARGE_INTEGER*)&m_iCurrentTime );
53
54 double ratio = 1.0 / m_iFrequency;
55 m_fDelta = TFLOAT( ( m_iCurrentTime - m_iOldTime ) * ratio );
56 m_fCurrentSeconds = TFLOAT( m_iCurrentTime * ratio );
57}
58
#define TOSHI_NAMESPACE_START
Definition Defines.h:47
#define TOSHI_NAMESPACE_END
Definition Defines.h:50
float TFLOAT
Definition Typedefs.h:4
uint32_t TUINT32
Definition Typedefs.h:13
void Update()
TUINT32 GetRaw32()
void Reset()
int64_t GetRaw64()