X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Futil.qh;h=4de610f26fcc2113587a64019db6b55fb71ae647;hb=e3507f4fdbc2b3e15b663365e57e0aa60f3cf1a6;hp=2afe65f3735b128b128d99afd2d6070688cc5aa8;hpb=73b5db7874a1916b8d2fff36ab49607314a925dc;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/util.qh b/qcsrc/common/util.qh index 2afe65f37..4de610f26 100644 --- a/qcsrc/common/util.qh +++ b/qcsrc/common/util.qh @@ -1,7 +1,7 @@ -// a dummy macro that prevents the "hanging ;" warning -#define ENDS_WITH_CURLY_BRACE +#ifndef COMMON_UTIL_H +#define COMMON_UTIL_H -#ifdef GMQCC +#ifdef QCC_SUPPORT_ACCUMULATE # define ACCUMULATE_FUNCTION(func,otherfunc) \ [[accumulate]] void func() { otherfunc(); } # define CALL_ACCUMULATED_FUNCTION(func) \ @@ -74,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); @@ -225,7 +225,7 @@ string getcurrentmod(); #ifndef MENUQC #ifdef CSQC -float ReadInt24_t(); +int ReadInt24_t(); vector ReadInt48_t(); vector ReadInt72_t(); #else @@ -236,12 +236,12 @@ 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 var void func_null(void); -var string string_null; +string string_null; #endif float float2range11(float f); float float2range01(float f); @@ -265,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; @@ -374,16 +374,16 @@ void backtrace(string msg); // color code replace, place inside of sprintf and parse the string... defaults described as constants // foreground/normal colors -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 +string autocvar_hud_colorset_foreground_1 = "2"; // F1 - Green // primary priority (important names, etc) +string autocvar_hud_colorset_foreground_2 = "3"; // F2 - Yellow // secondary priority (items, locations, numbers, etc) +string autocvar_hud_colorset_foreground_3 = "4"; // F3 - Blue // tertiary priority or relatively inconsequential text +string autocvar_hud_colorset_foreground_4 = "1"; // F4 - Red // notice/attention grabbing texting // "kill" colors -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) +string autocvar_hud_colorset_kill_1 = "1"; // K1 - Red // "bad" or "dangerous" text (death messages against you, kill notifications, etc) +string autocvar_hud_colorset_kill_2 = "3"; // K2 - Yellow // similar to above, but less important... OR, a highlight out of above message type +string autocvar_hud_colorset_kill_3 = "4"; // K3 - Blue // "good" or "beneficial" text (you fragging someone, etc) // background color -var string autocvar_hud_colorset_background = "7"; // BG - White // neutral/unimportant text +string autocvar_hud_colorset_background = "7"; // BG - White // neutral/unimportant text string CCR(string input); @@ -433,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) @@ -444,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