mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-10-24 18:37:39 +00:00
moved more includes to sysconfig.h
This commit is contained in:
21
util.cpp
21
util.cpp
@@ -5,6 +5,20 @@
|
||||
|
||||
namespace hr {
|
||||
|
||||
#if CAP_TIMEOFDAY
|
||||
long long getms() {
|
||||
struct timeval tval;
|
||||
gettimeofday(&tval, NULL);
|
||||
return tval.tv_sec * 1000000 + tval.tv_usec;
|
||||
}
|
||||
|
||||
#if !CAP_SDL
|
||||
int SDL_GetTicks() {
|
||||
return getms() / 1000;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
long double sqr(long double x) { return x*x; }
|
||||
string its(int i) { char buf[64]; sprintf(buf, "%d", i); return buf; }
|
||||
string fts(float x) { char buf[64]; sprintf(buf, "%4.2f", x); return buf; }
|
||||
@@ -72,13 +86,6 @@ ld frac(ld x) {
|
||||
|
||||
#if CAP_PROFILING
|
||||
|
||||
#include <sys/time.h>
|
||||
long long getms() {
|
||||
struct timeval tval;
|
||||
gettimeofday(&tval, NULL);
|
||||
return tval.tv_sec * 1000000 + tval.tv_usec;
|
||||
}
|
||||
|
||||
#define FRAMES 64
|
||||
#define CATS 16
|
||||
|
||||
|
||||
Reference in New Issue
Block a user