]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/util.qh
Merge remote branch 'origin/master' into terencehill/centerprint_stuff
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / util.qh
index d95c99e95fd39cb9424088998a109dd09f281334..2eee6d74ef1a4d369286c1fcc01a71588ccd130d 100644 (file)
@@ -34,6 +34,8 @@ float median(float a, float b, float c);
 // works for up to 10 decimals!
 string ftos_decimals(float number, float decimals);
 
+float fexists(string f);
+
 vector colormapPaletteColor(float c, float isPants);
 
 // unzone the string, and return it as tempstring. Safe to be called on string_null
@@ -220,6 +222,7 @@ switch(id) {\
        case HUD_PANEL_ENGINEINFO: panel_name = HUD_PANELNAME_ENGINEINFO; break; \
        case HUD_PANEL_INFOMESSAGES: panel_name = HUD_PANELNAME_INFOMESSAGES; break; \
        case HUD_PANEL_PHYSICS: panel_name = HUD_PANELNAME_PHYSICS; break; \
+       case HUD_PANEL_CENTERPRINT: panel_name = HUD_PANELNAME_CENTERPRINT; break; \
 } ENDS_WITH_CURLY_BRACE
 
 // Get name of specified panel id
@@ -256,3 +259,14 @@ string prvm_language;
 string language_filename(string s);
 string CTX(string s);
 #define ZCTX(s) strzone(CTX(s))
+
+// x-encoding (encoding as zero length invisible string)
+// encodes approx. 14 bits into 5 bytes of color code string
+const float XENCODE_MAX = 21295; // 2*22*22*22-1
+const float XENCODE_LEN = 5;
+string xencode(float f);
+float xdecode(string s);
+
+#ifndef COMPAT_XON010_CHANNELS
+#define sound(e,c,s,v,a) sound7(e,c,s,v,a,0,0)
+#endif