X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Futil.qh;h=6b1e5d39a3fd6f1f91dedc75f11371680afb6c47;hb=071cb0cbbcea5480619a6fe86be816f23d98ec31;hp=45711abe6082c2b4cfdc0c0d023c814a9859b0d4;hpb=fc96dec86e67e20464376940ddc502d327fd015c;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/util.qh b/qcsrc/common/util.qh index 45711abe6..6b1e5d39a 100644 --- a/qcsrc/common/util.qh +++ b/qcsrc/common/util.qh @@ -53,7 +53,7 @@ string wordwrap(string s, float l); void wordwrap_sprint(string s, float l); #endif #endif -void wordwrap_cb(string s, float l, void(string) callback) +void wordwrap_cb(string s, float l, void(string) callback); #ifndef SVQC string draw_currentSkin; @@ -148,8 +148,6 @@ vector mi_pictexcoord3; // texcoords of the image corners (after transforming, t void get_mi_min_max_texcoords(float mode); #endif -#define FTEQCC_YOU_SUCK_THIS_IS_NOT_UNREFERENCED(x) void reference_##x() { x = x; } - float almost_equals(float a, float b); float almost_in_bounds(float a, float b, float c); @@ -234,8 +232,13 @@ void WriteInt24_t(float dest, float val); #endif // the NULL function -const var void func_null(void); FTEQCC_YOU_SUCK_THIS_IS_NOT_UNREFERENCED(func_null) -const var string string_null; +#ifdef GMQCC +#define func_null nil +#define string_null nil +#else +var void func_null(void); +var string string_null; +#endif float float2range11(float f); float float2range01(float f); @@ -316,7 +319,7 @@ float xdecode(string s); float lowestbit(float f); #ifdef CSQC -entity ReadCSQCEntity() +entity ReadCSQCEntity(); #endif #ifndef MENUQC @@ -370,8 +373,23 @@ typedef entity(entity cur, entity near, entity pass) findNextEntityNearFunction_ typedef float(entity a, entity b, entity pass) isConnectedFunction_t; void FindConnectedComponent(entity e, .entity fld, findNextEntityNearFunction_t nxt, isConnectedFunction_t iscon, entity pass); -// expand multiple arguments into one argument -#define XPD5(a,b,c,d,e) a, b, c, d, e -#define XPD4(a,b,c,d) a, b, c, d -#define XPD3(a,b,c) a, b, c -#define XPD2(a,b) a, b +// expand multiple arguments into one argument by stripping parenthesis +#define XPD(...) __VA_ARGS__ + +float Count_Proper_Strings(string improper, string...count); +float Count_Proper_Floats(float improper, float...count); + +void backtrace(string msg); + +// color code replace, place inside of sprintf and parse the string +// defaults described as comments +var string autocvar_hud_colorset_foreground_1 = "^2"; // F1 - Green // primary priority (important names, etc) +var string autocvar_hud_colorset_foreground_2 = "^3"; // F2 - Yellow // secondary priority (items, locations, numbers, etc) +var string autocvar_hud_colorset_foreground_3 = "^4"; // F3 - Blue // tertiary priority or relatively inconsequential text +var string autocvar_hud_colorset_foreground_4 = "^1"; // F4 - Red // notice/attention grabbing texting +var string autocvar_hud_colorset_kill_1 = "^1"; // K1 - Red // "bad" or "dangerous" text (death messages against you, kill notifications, etc) +var string autocvar_hud_colorset_kill_2 = "^3"; // K2 - Yellow // similar to above, but less important... OR, a highlight out of above message type +var string autocvar_hud_colorset_kill_3 = "^4"; // K3 - Blue // "good" or "beneficial" text (you fragging someone, etc) +var string autocvar_hud_colorset_background = "^7"; // BG - White // neutral/unimportant text + +string CCR(string input);