]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/util.qh
Merge branch 'terencehill/eraseable_functions'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / util.qh
index 57f9a2217c42d5a502e8268c139bd8f082094d29..da86bf22ea63eccf1c7a408c815bb2d049e7f6ad 100644 (file)
@@ -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)
 
@@ -102,15 +105,6 @@ void get_mi_min_max_texcoords(float mode);
 float almost_equals(float a, float b);
 float almost_in_bounds(float a, float b, float c);
 
-float power2of(float e);
-float log2of(float x);
-
-vector rgb_to_hsl(vector rgb);
-vector hsl_to_rgb(vector hsl);
-vector rgb_to_hsv(vector rgb);
-vector hsv_to_rgb(vector hsv);
-string rgb_to_hexcolor(vector rgb);
-
 float boxesoverlap(vector m1, vector m2, vector m3, vector m4);
 float boxinsidebox(vector smins, vector smaxs, vector bmins, vector bmaxs);
 
@@ -156,16 +150,6 @@ vector healtharmor_applydamage(float a, float armorblock, int deathtype, float d
 
 string getcurrentmod();
 
-#ifdef GAMEQC
-#ifdef CSQC
-int ReadInt24_t();
-#else
-void WriteInt24_t(float dest, float val);
-void WriteInt48_t(float dest, vector val);
-void WriteInt72_t(float dest, vector val);
-#endif
-#endif
-
 float float2range11(float f);
 float float2range01(float f);
 
@@ -238,7 +222,7 @@ void queue_to_execute_next_frame(string s);
 // f(1) = 1
 // f'(0) = startspeedfactor
 // f'(1) = endspeedfactor
-float cubic_speedfunc(float startspeedfactor, float endspeedfactor, float x);
+float cubic_speedfunc(float startspeedfactor, float endspeedfactor, float spd);
 
 // checks whether f'(x) = 0 anywhere from 0 to 1
 // because if this is the case, the function is not usable for platforms
@@ -256,7 +240,9 @@ void FindConnectedComponent(entity e, .entity fld, findNextEntityNearFunction_t
 #define fprintf(file, ...) fputs(file, sprintf(__VA_ARGS__))
 #define bprintf(...) bprint(sprintf(__VA_ARGS__))
 
+#ifdef GAMEQC
 string CCR(string input);
+#endif
 
 #ifdef GAMEQC
        #ifdef CSQC