]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Document vec2, AUTOCVAR and AUTOCVAR_SAVE usage, which isn't very intuitive for every...
authorterencehill <piuntn@gmail.com>
Sat, 27 May 2017 16:23:23 +0000 (18:23 +0200)
committerterencehill <piuntn@gmail.com>
Sat, 27 May 2017 16:23:23 +0000 (18:23 +0200)
qcsrc/lib/cvar.qh
qcsrc/lib/vector.qh

index adcb7dfee0393a0685a3869405a68f3bddca56b5..666e14ab93f2592a0d884434b67339da2bddf62f 100644 (file)
@@ -73,6 +73,12 @@ const noref vector default_vector = '0 0 0';
 #define repr_cvar_string(x) (x)
 #define repr_cvar_vector(x) (sprintf("%v", x))
 
+//pseudo prototypes:
+// void AUTOCVAR(<cvar_name>, <qc_var_type>, default_cvar_value, string desc)
+// void AUTOCVAR_SAVE(<cvar_name>, <qc_var_type>, default_cvar_value, string desc)
+//  where default_cvar_value has type <qc_var_type>
+//  e.g.: AUTOCVAR(mycvar, float, 2.5, "cvar description")
+
 #define __AUTOCVAR(file, archive, var, type, desc, default) \
        [[accumulate]] void RegisterCvars(void(string, string, string, bool, string) f) \
        { \
index 151d788c06668fe659879412728c36e9c7276f03..6c32e4312d594799e830c68b7b05f2f49fffcd87 100644 (file)
@@ -93,6 +93,10 @@ float boxinsidebox(vector smins, vector smaxs, vector bmins, vector bmaxs) { ret
        up = v_up; \
 } MACRO_END
 
+//pseudo prototypes:
+// vector vec2(vector v); // returns a vector with just the x and y components of the given vector
+// vector vec2(float x, float y); // returns a vector with the given x and y components
+
 noref vector _vec2;
 #define vec2(...) EVAL(OVERLOAD(vec2, __VA_ARGS__))
 #define vec2_1(v) (_vec2 = (v), _vec2.z = 0, _vec2)