OpenRaider  0.1.4-dev
Open Source Tomb Raider Game Engine implementation
RunTime.h
Go to the documentation of this file.
1 
8 #ifndef _RUNTIME_H_
9 #define _RUNTIME_H_
10 
11 #include <string>
12 #include <vector>
13 
14 class RunTime {
15  public:
16  static void initialize();
17  static void updateFPS();
18  static void display();
19 
21  static void setKeyBinding(ActionEvents event, KeyboardButton button);
22 
23  static std::string getBaseDir() { return baseDir; }
24  static void setBaseDir(std::string dir) { baseDir = dir; }
25 
26  static std::string getPakDir() { return pakDir; }
27  static void setPakDir(std::string dir) { pakDir = dir; }
28 
29  static std::string getAudioDir() { return audioDir; }
30  static void setAudioDir(std::string dir) { audioDir = dir; }
31 
32  static std::string getDataDir() { return dataDir; }
33  static void setDataDir(std::string dir) { dataDir = dir; }
34 
35  static bool isRunning() { return gameIsRunning; }
36  static void setRunning(bool run) { gameIsRunning = run; }
37 
38  static bool getShowFPS() { return showFPS; }
39  static void setShowFPS(bool f) { showFPS = f; }
40 
41  static unsigned long getFPS() { return fps; }
42  static const std::vector<float>& getHistoryFPS() { return history; }
43  static float getLastFrameTime() { return lastFrameTime / 1000.0f; }
44 
45  private:
46  static std::string baseDir;
47  static std::string pakDir;
48  static std::string audioDir;
49  static std::string dataDir;
50 
52  static bool gameIsRunning;
53  static bool showFPS;
54 
55  static unsigned long lastTime, lastFrameTime;
56  static unsigned long frameCount, frameCount2;
57  static unsigned long frameTimeSum, frameTimeSum2;
58  static unsigned long fps;
59  static std::vector<float> history;
60 };
61 
62 #endif
63 
static std::string getAudioDir()
Definition: RunTime.h:29
static std::string audioDir
Definition: RunTime.h:48
static unsigned long fps
Definition: RunTime.h:58
static bool showFPS
Definition: RunTime.h:53
static unsigned long frameTimeSum
Definition: RunTime.h:57
static std::vector< float > history
Definition: RunTime.h:59
static std::string pakDir
Definition: RunTime.h:47
static std::string getPakDir()
Definition: RunTime.h:26
static KeyboardButton keyBindings[ActionEventCount]
Definition: RunTime.h:51
KeyboardButton
Definition: global.h:34
static void setShowFPS(bool f)
Definition: RunTime.h:39
static unsigned long lastTime
Definition: RunTime.h:55
static void setPakDir(std::string dir)
Definition: RunTime.h:27
static std::string getBaseDir()
Definition: RunTime.h:23
static void setDataDir(std::string dir)
Definition: RunTime.h:33
static const std::vector< float > & getHistoryFPS()
Definition: RunTime.h:42
static bool isRunning()
Definition: RunTime.h:35
static unsigned long getFPS()
Definition: RunTime.h:41
static std::string dataDir
Definition: RunTime.h:49
static void setBaseDir(std::string dir)
Definition: RunTime.h:24
ActionEvents
Definition: global.h:15
static unsigned long frameTimeSum2
Definition: RunTime.h:57
static unsigned long frameCount
Definition: RunTime.h:56
static void setRunning(bool run)
Definition: RunTime.h:36
static void initialize()
Definition: RunTime.cpp:33
static void setKeyBinding(ActionEvents event, KeyboardButton button)
Definition: RunTime.cpp:61
static void setAudioDir(std::string dir)
Definition: RunTime.h:30
static std::string baseDir
Definition: RunTime.h:46
static void display()
Definition: RunTime.cpp:86
static KeyboardButton getKeyBinding(ActionEvents event)
Definition: RunTime.cpp:56
static unsigned long lastFrameTime
Definition: RunTime.h:55
static unsigned long frameCount2
Definition: RunTime.h:56
static bool gameIsRunning
Definition: RunTime.h:52
static bool getShowFPS()
Definition: RunTime.h:38
static float getLastFrameTime()
Definition: RunTime.h:43
static void updateFPS()
Definition: RunTime.cpp:66
static std::string getDataDir()
Definition: RunTime.h:32