diff options
author | Andy <drumsetmonkey@gmail.com> | 2017-01-20 10:37:21 -0500 |
---|---|---|
committer | Andy <drumsetmonkey@gmail.com> | 2017-01-20 10:37:21 -0500 |
commit | 4d8f9974156068e4595bf219cacfd9fcd2fd7174 (patch) | |
tree | f3e938c0e49537a9dea661f46eed6ee74950b48a /include/config.hpp | |
parent | 1894e311bdeb098c3bef9bd342e0eaf78d197a9b (diff) | |
parent | 1ac412a5496fb6c63c47f199dfc7facd5f4c080a (diff) |
Merge branch 'master' of https://github.com/tcsullivan/gamedev
Diffstat (limited to 'include/config.hpp')
-rw-r--r-- | include/config.hpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/include/config.hpp b/include/config.hpp index e17df24..13596ff 100644 --- a/include/config.hpp +++ b/include/config.hpp @@ -71,4 +71,26 @@ namespace game { } } +/** + * The amount of game ticks that should occur each second. + */ +constexpr unsigned int TICKS_PER_SEC = 20; + +/** + * The amount of milliseconds it takes for a game tick to fire. + */ +constexpr float MSEC_PER_TICK = 1000.0f / TICKS_PER_SEC; + +/** + * Returns a measurement in HLINEs + * + * @param the number of HLINEs, integer or decimal + * @return the number in HLINEs + */ +template<typename T> +inline T HLINES(const T &n) +{ + return (static_cast<T>(game::HLINE) * n); +} + #endif //CONFIG_H |