annotate Timer.h @ 2173:daa61976637d

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