X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Futil.qh;h=13c4c0900817d5f8298df91435c3dcfc9c6e2c28;hb=99e5a9ce0489a8dd473fc4d26c011239d3327cab;hp=05e4a4ea2736b4e5c8e92a9859e58ae870391c7b;hpb=cbca1a79315fe08c4796273a490a4d12b7d3291d;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/util.qh b/qcsrc/common/util.qh index 05e4a4ea2..13c4c0900 100644 --- a/qcsrc/common/util.qh +++ b/qcsrc/common/util.qh @@ -49,6 +49,8 @@ void db_put(int db, string key, string value); int buf_load(string filename); void buf_save(int buf, string filename); +// adding just 0.4 for race times so it rounds down in the .5 case (matching the timer display) +// FIXME it doesn't round properly #define TIME_TO_NTHS(t,n) floor((t) * (n) + 0.4) string format_time(float seconds); string mmsss(float t); @@ -59,6 +61,7 @@ const float TIME_FACTOR = 100; #define TIME_ENCODED_TOSTRING(n) mmssss(n) #define RACE_RECORD "/race100record/" #define CTS_RECORD "/cts100record/" +#define CTF_RECORD "/ctf100record/" #define TIME_ENCODE(t) TIME_TO_NTHS(t, TIME_FACTOR) #define TIME_DECODE(n) ((n) / TIME_FACTOR)