工具
色数学墙钟 color / maths / Timer
颜色、圆周率与墙钟计时
Color.h / Maths.h / Timer.h
预置颜色
大量 CSS 风格色名,类型为 CRGBA。
namespace color {
extern CRGBA Red, Green, Blue, White, Black, /* ... */;
}圆周率
namespace maths {
template <typename T> static inline T pi();
}
#define PI (plugin::maths::pi<double>())
#define TWOPI (PI*2)墙钟计时
Timer 使用高精度时钟,自构造起计时;暂停游戏仍继续走。需要游戏时间时用 CTimer::m_snTimeInMilliseconds。
class Timer {
Timer();
template <typename T = int32_t>
static T GetTimeInMilliseconds();
template <typename T = double>
static T GetTimeInSeconds();
};角度、限幅、插值见 杂项工具。