-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathModuleTimer.h
63 lines (49 loc) · 1.02 KB
/
ModuleTimer.h
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#ifndef _MODULETIMER_H_
#define _MODULETIMER_H_
#include "Module.h"
#include "Globals.h"
#include "Application.h"
#include "SDL.h"
#define FRAME_VALUES 10
class ModuleTimer : public Module {
public:
ModuleTimer();
virtual ~ModuleTimer();
bool Init();
update_status PreUpdate();
update_status Update();
update_status PostUpdate();
bool CleanUp();
void StartRealTimeClock();
void StartGameTimeClock();
float Read();
void Pause();
void Stop();
void ShowTimerUI();
bool isStarted();
bool isPaused();
void Unpause();
public:
float fpsrate = 60.0f;
public:
int gameTime = NULL;
int realTime = NULL;
bool running = true;
float pauseTime = 0;
float readTime = 0;
float pause_start_ticks = 0;
float start_ticks = 0;
float timePassedWhilePaused = 0;
float end_time =0 ;
float timePaused = 0;
bool paused = false;
float timeStoped = NULL;
bool stop = false;
Uint32 mStartTicks;
//The ticks stored when the timer was paused
Uint32 mPausedTicks;
//The timer status
bool mPaused;
bool mStarted;
};
#endif