X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fcommon%2Futil.qh;h=da86bf22ea63eccf1c7a408c815bb2d049e7f6ad;hp=9e1d5a75be3f94cf418fca7aecb9e4459d28aa44;hb=0bd99205bd154e058edc6b82995d24e3375f5f97;hpb=06ac66a5edaa645e19ed9a6482409e8656a65b1d diff --git a/qcsrc/common/util.qh b/qcsrc/common/util.qh index 9e1d5a75b..da86bf22e 100644 --- a/qcsrc/common/util.qh +++ b/qcsrc/common/util.qh @@ -5,6 +5,9 @@ vector real_origin(entity ent); #endif +IntrusiveList g_saved_cvars; +STATIC_INIT(g_saved_cvars) { g_saved_cvars = IL_NEW(); } + // this returns a tempstring containing a copy of s with additional \n newlines added, it also replaces \n in the text with a real newline // NOTE: s IS allowed to be a tempstring string wordwrap(string s, float l); @@ -46,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); @@ -56,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) @@ -99,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); @@ -153,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); @@ -178,6 +165,7 @@ float get_model_parameters_species; string get_model_parameters_sex; float get_model_parameters_weight; float get_model_parameters_age; +bool get_model_parameters_hidden; string get_model_parameters_description; string get_model_parameters_bone_upperbody; string get_model_parameters_bone_weapon; @@ -234,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 @@ -252,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