]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/util.qh
Merge branch 'Mario/qc_updates' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / util.qh
index d4e3ccd5a91276547ab4c786683dab082bfef4ee..4de610f26fcc2113587a64019db6b55fb71ae647 100644 (file)
@@ -1,4 +1,7 @@
-#ifdef GMQCC
+#ifndef COMMON_UTIL_H
+#define COMMON_UTIL_H
+
+#ifdef QCC_SUPPORT_ACCUMULATE
 # define ACCUMULATE_FUNCTION(func,otherfunc) \
        [[accumulate]] void func() { otherfunc(); }
 # define CALL_ACCUMULATED_FUNCTION(func) \
@@ -71,7 +74,7 @@ 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);
+bool fexists(string f);
 
 vector colormapPaletteColor(float c, float isPants);
 
@@ -222,7 +225,7 @@ string getcurrentmod();
 
 #ifndef MENUQC
 #ifdef CSQC
-float ReadInt24_t();
+int ReadInt24_t();
 vector ReadInt48_t();
 vector ReadInt72_t();
 #else
@@ -233,7 +236,7 @@ void WriteInt72_t(float dest, vector val);
 #endif
 
 // the NULL function
-#ifdef GMQCC
+#ifdef QCC_SUPPORT_NIL
 #define func_null nil
 #define string_null nil
 #else
@@ -262,7 +265,7 @@ float get_model_parameters_age;
 string get_model_parameters_description;
 string get_model_parameters_bone_upperbody;
 string get_model_parameters_bone_weapon;
-const float MAX_AIM_BONES = 4;
+const int MAX_AIM_BONES = 4;
 string get_model_parameters_bone_aim[MAX_AIM_BONES];
 float get_model_parameters_bone_aimweight[MAX_AIM_BONES];
 float get_model_parameters_fixbone;
@@ -430,8 +433,8 @@ float Announcer_PickNumber(float type, float num);
 #endif
 
 #ifndef MENUQC
-float Mod_Q1BSP_SuperContentsFromNativeContents(float nativecontents);
-float Mod_Q1BSP_NativeContentsFromSuperContents(float supercontents);
+int Mod_Q1BSP_SuperContentsFromNativeContents(int nativecontents);
+int Mod_Q1BSP_NativeContentsFromSuperContents(int supercontents);
 #endif
 
 // Quadratic splines (bezier)
@@ -441,4 +444,5 @@ vector bezier_quadratic_getderivative(vector a, vector p, vector b, float t);
 #define APPEND_TO_STRING(list,sep,add) ((list) = (((list) != "") ? strcat(list, sep, add) : (add)))
 
 // Returns the correct difference between two always increasing numbers
-#define COMPARE_INCREASING(to,from) (to < from ? from + to + 2 : to - from)
\ No newline at end of file
+#define COMPARE_INCREASING(to,from) (to < from ? from + to + 2 : to - from)
+#endif