]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/menu/oo/classes.qc
Make menu includes order insensitive
[xonotic/xonotic-data.pk3dir.git] / qcsrc / menu / oo / classes.qc
index 95bc0b28b71d6c485026d73693e0411b13687510..2170a83fcb3a077ab1de50531770b05c73ab756a 100644 (file)
@@ -1,55 +1,9 @@
+#ifndef CLASSES_H
+#define CLASSES_H
 #include "base.qh"
 
-#ifdef CLASS
-#undef CLASS
-#undef METHOD
-#undef ATTRIB
-#undef ATTRIBARRAY
-#undef ENDCLASS
-#undef SUPER
-#endif
-
-#define CLASS(cname, base)                                          \
-entity spawn##cname(entity this, entity basevtbl) {                 \
-    this = NEW(base); basevtbl = base##_vtbl;                       \
-}
-
-#define METHOD(cname, name, prototype)                              \
-prototype cname##_##name;                                           \
-.prototype name;                                                    \
-[[accumulate]] entity spawn##cname(entity this, entity basevtbl) {  \
-    this.name = cname##_##name;                                     \
-}
-
-#define ATTRIB(cname, name, type, val)                              \
-.type name;                                                         \
-[[accumulate]] entity spawn##cname(entity this, entity basevtbl) {  \
-    this.name = val;                                                \
-}
-
-#define ATTRIBARRAY(cname, name, type, cnt)                         \
-.type name[cnt];
-
-#define ENDCLASS(cname)                                             \
-.bool instanceOf##cname;                                            \
-entity cname##_vtbl;                                                \
-[[last]] entity spawn##cname(entity this, entity basevtbl) {        \
-    this.instanceOf##cname = true;                                  \
-    this.classname = #cname;                                        \
-    if (!cname##_vtbl) cname##_vtbl = spawnVtbl(this, basevtbl);    \
-    return this;                                                    \
-}
-
-#define SUPER(cname) (cname##_vtbl.vtblbase)
-
-#ifdef IMPLEMENTATION
-#undef IMPLEMENTATION
-#endif
-
 #include "../classes.inc"
-
-#ifndef IMPLEMENTATION
 #define IMPLEMENTATION
-#endif
-
 #include "../classes.inc"
+
+#endif