annotate Engine/Timer.h @ 2542:bacf9809126a

.
author a.parshin
date Sun, 10 May 2015 02:04:52 +0200
parents 68cdef6879a0
children
rev   line source
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1 #pragma once
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
4
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
5
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
6 /* 61 */
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
7 #pragma pack(push, 1)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
8 struct Timer
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
9 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
10 static Timer *Create() {return new Timer;}
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
11
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
12 Timer():
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
13 bReady(false), bPaused(false)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
14 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
15 bTackGameTime = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
16 uStartTime = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
17 uStopTime = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
18 uGameTimeStart = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
19 field_18 = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
20 uTimeElapsed = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
21 dt_in_some_format = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
22 uTotalGameTimeElapsed = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
23 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
24
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
25 void Initialize();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
26 unsigned __int64 Time();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
27 void Update();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
28 void Pause();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
29 void Resume();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
30 void TrackGameTime();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
31 void StopGameTime();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
32
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
33 unsigned int bReady;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
34 unsigned int bPaused;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
35 int bTackGameTime;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
36 unsigned int uStartTime;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
37 unsigned int uStopTime;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
38 int uGameTimeStart;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
39 int field_18;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
40 unsigned int uTimeElapsed;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
41 int dt_in_some_format;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
42 unsigned int uTotalGameTimeElapsed;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
43
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
44 static const unsigned int TimeQuant = 128;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
45 static const unsigned int Minute = 2 * TimeQuant;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
46 static const unsigned int Hour = 60 * Minute;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
47 static const unsigned int Day = 24 * Hour;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
48 static const unsigned int Week = 7 * Day;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
49 static const unsigned int Month = 4 * Week;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
50 static const unsigned int Year = 12 * Month;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
51 };
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
52
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
53 #pragma pack(pop)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
54
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
55
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
56
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
57 extern Timer *pMiscTimer;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
58 extern Timer *pEventTimer;