]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/lib/_all.inc
Merge branch 'master' into terencehill/translate_colors_2
[xonotic/xonotic-data.pk3dir.git] / qcsrc / lib / _all.inc
index 9f7004c345ae8ca98c05a83434112b17fab2360e..0fee57ec18e87aac641444bd8d424cb82afa106c 100644 (file)
 #endif
 
 #if defined(CSQC)
-       #include "../dpdefs/csprogsdefs.qh"
-       #include "../dpdefs/keycodes.qh"
+       #include <dpdefs/csprogsdefs.qh>
+       #include <dpdefs/keycodes.qh>
 #elif defined(SVQC)
-       #include "../server/sys-pre.qh"
-       #include "../dpdefs/progsdefs.qh"
-       #include "../dpdefs/dpextensions.qh"
-       #include "../server/sys-post.qh"
+       #include <server/sys-pre.qh>
+       #include <dpdefs/progsdefs.qh>
+       #include <dpdefs/dpextensions.qh>
+       #include <server/sys-post.qh>
 #elif defined(MENUQC)
-       #include "../dpdefs/menudefs.qh"
-       #include "../dpdefs/keycodes.qh"
+       #include <dpdefs/menudefs.qh>
+       #include <dpdefs/keycodes.qh>
 #endif
 
+#define USING(name, T) typedef T name
+
+#include "bool.qh"
+#include "int.qh"
+
+#include "macro.qh"
+
+#if NDEBUG
+    #define TC(T, sym) MACRO_BEGIN MACRO_END
+#else
+    #define TC(T, sym) MACRO_BEGIN \
+        if (!is_##T(sym)) { \
+            LOG_WARNINGF("Type check failed: " #sym " :: " #T); \
+            isnt_##T(sym); \
+        } \
+    MACRO_END
+#endif
+
+#define   is_float(        this) (true || ftoe(this))
+#define isnt_float(        this)
+#define   is_vector(       this) (true || vtos(this))
+#define isnt_vector(       this)
+#define   is_string(       this) (true || stof(this))
+#define isnt_string(       this)
+#define   is_entity(       this) (true || etof(this))
+#define isnt_entity(       this)
+bool      is_int(    float this) { return this == floor(this); }
+void    isnt_int(    float this) { print(ftos(this)); }
+bool      is_bool(   float this) { return this == true || this == false; }
+void    isnt_bool(   float this) { print(ftos(this)); }
+
 #include "warpzone/mathlib.qc"
 
 #include "accumulate.qh"
+#include "angle.qc"
 #include "arraylist.qh"
 #include "bits.qh"
-#include "bool.qh"
 #include "color.qh"
 #include "counting.qh"
 #include "cvar.qh"
 #include "file.qh"
 #include "functional.qh"
 #include "i18n.qh"
-#include "int.qh"
 #include "iter.qh"
 #include "lazy.qh"
 #include "linkedlist.qh"
 #include "log.qh"
-#include "map.qc"
+#include "map.qh"
+#include "markdown.qh"
 #include "math.qh"
 #include "misc.qh"
 #include "net.qh"
 #include "nil.qh"
-#include "noise.qc"
+#include "noise.qh"
 #include "oo.qh"
 #include "p2mathlib.qc"
 #include "progname.qh"
@@ -67,5 +98,7 @@
 #include "string.qh"
 #include "struct.qh"
 #include "test.qc"
+#include "unsafe.qh"
 #include "urllib.qc"
 #include "vector.qh"
+#include "yenc.qh"