summaryrefslogtreecommitdiffstats
path: root/src/control/OnscreenTimer.h
blob: fb1392668d450e39a88ab43729b081c6909ffa5f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#pragma once

enum
{
	COUNTER_DISPLAY_NUMBER,
	COUNTER_DISPLAY_BAR,
};

class COnscreenTimerEntry
{
public:
	uint32 m_nTimerOffset;
	uint32 m_nCounterOffset;
	char m_aTimerText[10];
	char m_aCounterText[10];
	uint16 m_nType;
	char m_bCounterBuffer[42];
	char m_bTimerBuffer[42];
	bool m_bTimerProcessed;
	bool m_bCounterProcessed;

	void Process();
	bool ProcessForDisplay();

	void ProcessForDisplayClock();
	void ProcessForDisplayCounter();
};

static_assert(sizeof(COnscreenTimerEntry) == 0x74, "COnscreenTimerEntry: error");

class COnscreenTimer
{
public:
	COnscreenTimerEntry m_sEntries[NUMONSCREENTIMERENTRIES];
	bool m_bProcessed;
	bool m_bDisabled;

	void Init();
	void Process();
	void ProcessForDisplay();

	void ClearCounter(uint32 offset);
	void ClearClock(uint32 offset);

	void AddCounter(uint32 offset, uint16 type, char* text);
	void AddClock(uint32 offset, char* text);
};

static_assert(sizeof(COnscreenTimer) == 0x78, "COnscreenTimer: error");