#includes: cleanup
authorTimePath <andrew.hardaker1995@gmail.com>
Fri, 9 Oct 2015 09:32:33 +0000 (20:32 +1100)
committerTimePath <andrew.hardaker1995@gmail.com>
Fri, 9 Oct 2015 09:32:33 +0000 (20:32 +1100)
77 files changed:
qcsrc/client/_all.qh
qcsrc/client/hud.qc
qcsrc/client/hud_config.qc
qcsrc/client/mapvoting.qc
qcsrc/client/progs.inc
qcsrc/client/quickmenu.qc
qcsrc/common/animdecide.qc
qcsrc/common/buffs/all.qc
qcsrc/common/campaign_file.qc
qcsrc/common/campaign_setup.qc
qcsrc/common/items/item.qh
qcsrc/common/items/item/powerup.qc
qcsrc/common/mapinfo.qc
qcsrc/common/minigames/cl_minigames.qh
qcsrc/common/monsters/spawn.qc
qcsrc/common/monsters/sv_monsters.qc
qcsrc/common/movetypes/movetypes.qc
qcsrc/common/nades/all.qc
qcsrc/common/notifications.qc
qcsrc/common/playerstats.qc
qcsrc/common/triggers/trigger/viewloc.qc
qcsrc/common/util-post.qh [deleted file]
qcsrc/common/util-pre.qh [deleted file]
qcsrc/common/util.qc
qcsrc/common/viewloc.qc
qcsrc/common/weapons/all.qc
qcsrc/common/weapons/config.qc
qcsrc/csqcmodellib/cl_model.qc
qcsrc/csqcmodellib/cl_player.qc
qcsrc/csqcmodellib/interpolate.qc
qcsrc/csqcmodellib/sv_model.qc
qcsrc/lib/_all.inc
qcsrc/lib/bool.qh
qcsrc/lib/compiler.qh [new file with mode: 0644]
qcsrc/lib/defer.qh
qcsrc/lib/functional.qh [new file with mode: 0644]
qcsrc/lib/int.qh [new file with mode: 0644]
qcsrc/lib/iter.qh [new file with mode: 0644]
qcsrc/lib/misc.qh [new file with mode: 0644]
qcsrc/lib/nil.qh
qcsrc/lib/oo.qh
qcsrc/lib/self.qh [new file with mode: 0644]
qcsrc/lib/test.qh
qcsrc/lib/urllib.qh
qcsrc/menu/_all.qh
qcsrc/menu/anim/animation.qc
qcsrc/menu/anim/animhost.qc
qcsrc/menu/item.qc
qcsrc/menu/menu.qh
qcsrc/menu/oo/base.qh [deleted file]
qcsrc/menu/oo/classes.qc
qcsrc/menu/progs.inc
qcsrc/menu/xonotic/util.qc
qcsrc/server/_all.qh
qcsrc/server/anticheat.qc
qcsrc/server/antilag.qc
qcsrc/server/bot/_all.inc [new file with mode: 0644]
qcsrc/server/bot/bot.qc
qcsrc/server/bot/havocbot/_all.inc [new file with mode: 0644]
qcsrc/server/csqceffects.qc
qcsrc/server/g_damage.qh
qcsrc/server/g_models.qc
qcsrc/server/ipban.qc
qcsrc/server/mutators/mutators.qc
qcsrc/server/mutators/mutators_include.qc
qcsrc/server/pathlib/_all.inc [new file with mode: 0644]
qcsrc/server/playerdemo.qc
qcsrc/server/progs.inc
qcsrc/server/steerlib.qc
qcsrc/server/t_items.qh
qcsrc/test/compilationunit.sh
qcsrc/warpzonelib/anglestransform.qc
qcsrc/warpzonelib/client.qc
qcsrc/warpzonelib/common.qc
qcsrc/warpzonelib/mathlib.qc
qcsrc/warpzonelib/server.qc
qcsrc/warpzonelib/util_server.qc

index 0fe1c61..7ae1430 100644 (file)
@@ -6,8 +6,6 @@
 #include "main.qh"
 #include "miscfunctions.qh"
 
-#include "../dpdefs/csprogsdefs.qh"
-
 #include "../common/models/all.qh"
 #include "../common/sounds/all.qh"
 
index dbae62c..81fa575 100644 (file)
@@ -7,8 +7,6 @@
 #include "teamradar.qh"
 #include "t_items.qh"
 
-#include "../dpdefs/keycodes.qh"
-
 #include "../common/buffs/all.qh"
 #include "../common/constants.qh"
 #include "../common/deathtypes.qh"
index 2cdb9fc..55c6c06 100644 (file)
@@ -5,8 +5,6 @@
 
 #include "../common/constants.qh"
 
-#include "../dpdefs/keycodes.qh"
-
 
 #define HUD_Write(s) fputs(fh, s)
 // q: quoted, n: not quoted
index 945f312..010f424 100644 (file)
@@ -7,8 +7,6 @@
 #include "../common/mapinfo.qh"
 #include "../common/util.qh"
 
-#include "../dpdefs/keycodes.qh"
-
 
 int mv_num_maps;
 
index ec5c318..e1e96ef 100644 (file)
@@ -1,7 +1,3 @@
-#include "../common/util-pre.qh"
-#include "../dpdefs/csprogsdefs.qh"
-#include "../common/util-post.qh"
-
 #include "../lib/_all.inc"
 
 #include "announcer.qc"
index 5f896be..dd2ba03 100644 (file)
@@ -2,8 +2,6 @@
 
 #include "hud_config.qh"
 
-#include "../dpdefs/keycodes.qh"
-
 // QUICKMENU_MAXLINES must be <= 10
 const int QUICKMENU_MAXLINES = 10;
 // visible entries are loaded from QuickMenu_Buffer into QuickMenu_Page_* arrays
index 0db1a6a..e2bda23 100644 (file)
@@ -1,12 +1,6 @@
-#if defined(CSQC)
-       #include "../dpdefs/csprogsdefs.qh"
-       #include "animdecide.qh"
-#elif defined(MENUQC)
-#elif defined(SVQC)
-       #include "../dpdefs/progsdefs.qh"
-    #include "../dpdefs/dpextensions.qh"
+#include "animdecide.qh"
+#if defined(SVQC)
     #include "util.qh"
-    #include "animdecide.qh"
     #include "../server/defs.qh"
 #endif
 
index 190c627..c6a6f49 100644 (file)
@@ -1,10 +1,7 @@
 #if defined(CSQC)
-       #include "../../dpdefs/csprogsdefs.qh"
        #include "../../client/defs.qh"
 #elif defined(MENUQC)
 #elif defined(SVQC)
-       #include "../../dpdefs/progsdefs.qh"
-    #include "../../dpdefs/dpextensions.qh"
 #endif
 #include "all.qh"
 
index 69dbb0b..a8bbe8e 100644 (file)
@@ -1,8 +1,6 @@
 #if defined(CSQC)
 #elif defined(MENUQC)
 #elif defined(SVQC)
-       #include "../dpdefs/progsdefs.qh"
-    #include "../dpdefs/dpextensions.qh"
     #include "util.qh"
     #include "campaign_common.qh"
 #endif
index b822c34..8c20c75 100644 (file)
@@ -1,7 +1,6 @@
 #if defined(CSQC)
 #elif defined(MENUQC)
 #elif defined(SVQC)
-       #include "../dpdefs/progsdefs.qh"
     #include "campaign_common.qh"
     #include "mapinfo.qh"
 #endif
index ceb9a0a..7a12b30 100644 (file)
@@ -1,5 +1,46 @@
 #ifndef GAMEITEM_H
 #define GAMEITEM_H
+
+const int IT_UNLIMITED_WEAPON_AMMO             =       1; // when this bit is set, using a weapon does not reduce ammo. Checkpoints can give this powerup.
+const int IT_UNLIMITED_SUPERWEAPONS            =       2; // when this bit is set, superweapons don't expire. Checkpoints can give this powerup.
+const int IT_CTF_SHIELDED                      =       4; // set for the flag shield
+const int IT_USING_JETPACK                     =       8; // confirmation that button is pressed
+const int IT_JETPACK                           =      16; // actual item
+const int IT_FUEL_REGEN                        =      32; // fuel regeneration trigger
+// where is 64... ?
+const int IT_FUEL                                      =     128;
+// -Wdouble-declaration
+#define IT_SHELLS                                        256
+// -Wdouble-declaration
+#define IT_NAILS                                         512
+// -Wdouble-declaration
+#define IT_ROCKETS                                      1024
+// -Wdouble-declaration
+#define IT_CELLS                                        2048
+const int IT_SUPERWEAPON                               =    4096;
+const int IT_STRENGTH                                  =    8192;
+const int IT_INVINCIBLE                                =   16384;
+const int IT_HEALTH                                    =   32768;
+const int IT_PLASMA                                    =   65536;
+
+// shared value space (union):
+       // for items:
+       // -Wdouble-declaration
+       #define IT_KEY1                                                 131072
+       // -Wdouble-declaration
+       #define IT_KEY2                                                 262144
+// end
+
+const int IT_5HP                               =  524288;
+const int IT_25HP                              = 1048576;
+const int IT_ARMOR_SHARD                       = 2097152;
+const int IT_ARMOR                             = 4194304;
+
+// item masks
+const int IT_AMMO                              =    3968; // IT_FUEL | IT_SHELLS | IT_NAILS | IT_ROCKETS | IT_CELLS | IT_PLASMA;
+const int IT_PICKUPMASK                        =      51; // IT_FUEL_REGEN | IT_JETPACK | IT_UNLIMITED_AMMO; // strength and invincible are handled separately
+const int IT_UNLIMITED_AMMO                    =       3; // IT_UNLIMITED_SUPERWEAPONS | IT_UNLIMITED_WEAPON_AMMO;
+
 #define ITEM_HANDLE(signal, ...) __Item_Send_##signal(__VA_ARGS__)
 /** If you register a new item, make sure to add it to all.inc */
 CLASS(GameItem, Object)
index f411d74..a1b2f14 100644 (file)
@@ -1,5 +1,4 @@
 #include "powerup.qh"
-#include "../../../server/t_items.qh"
 
 #ifndef SVQC
 .int m_itemid;
index ba21ff4..1daf862 100644 (file)
@@ -1,5 +1,4 @@
 #if defined(CSQC)
-       #include "../dpdefs/csprogsdefs.qh"
     #include "../client/defs.qh"
     #include "util.qh"
     #include "buffs/all.qh"
@@ -7,8 +6,6 @@
     #include "mapinfo.qh"
 #elif defined(MENUQC)
 #elif defined(SVQC)
-       #include "../dpdefs/progsdefs.qh"
-    #include "../dpdefs/dpextensions.qh"
     #include "util.qh"
     #include "buffs/all.qh"
     #include "monsters/all.qh"
index a073af8..016e8a3 100644 (file)
@@ -1,8 +1,6 @@
 #ifndef CL_MINIGAMES_H
 #define CL_MINIGAMES_H
 
-#include "../../dpdefs/keycodes.qh"
-
 // Get a square in the center of the avaliable area
 // \note macro to pass by reference pos and mySize
 #define minigame_hud_fitsqare(pos, mySize) \
index cf23639..f7e2e29 100644 (file)
@@ -1,7 +1,6 @@
 #if defined(CSQC)
 #elif defined(MENUQC)
 #elif defined(SVQC)
-       #include "../../dpdefs/progsdefs.qh"
     #include "../util.qh"
     #include "all.qh"
     #include "sv_monsters.qh"
index 8b05f78..b8bff02 100644 (file)
@@ -1,8 +1,6 @@
 #if defined(CSQC)
 #elif defined(MENUQC)
 #elif defined(SVQC)
-       #include "../../dpdefs/progsdefs.qh"
-    #include "../../dpdefs/dpextensions.qh"
     #include "../../warpzonelib/common.qh"
     #include "../constants.qh"
     #include "../teams.qh"
index cfa6346..0fed28f 100644 (file)
@@ -2,7 +2,6 @@
 #include "../physics.qh"
 
 #if defined(CSQC)
-       #include "../../dpdefs/csprogsdefs.qh"
        #include "../../client/defs.qh"
        #include "../stats.qh"
        #include "../util.qh"
index 90d7ca3..724837b 100644 (file)
@@ -1,5 +1,4 @@
 #if defined(CSQC)
-       #include "../../dpdefs/csprogsdefs.qh"
        #include "../../client/defs.qh"
        #include "all.qh"
        #include "../buffs/all.qh"
@@ -8,7 +7,6 @@
        #include "../../csqcmodellib/cl_model.qh"
 #elif defined(MENUQC)
 #elif defined(SVQC)
-       #include "../../dpdefs/progsdefs.qh"
     #include "../constants.qh"
     #include "../../server/constants.qh"
        #include "../turrets/sv_turrets.qh"
index 13097a4..600ddaa 100644 (file)
@@ -1,8 +1,6 @@
 #if defined(CSQC)
 #elif defined(MENUQC)
 #elif defined(SVQC)
-       #include "../dpdefs/progsdefs.qh"
-    #include "../dpdefs/dpextensions.qh"
     #include "constants.qh"
     #include "teams.qh"
     #include "../server/autocvars.qh"
index 3a44d71..0fcbd42 100644 (file)
@@ -1,8 +1,6 @@
 #if defined(CSQC)
 #elif defined(MENUQC)
 #elif defined(SVQC)
-       #include "../dpdefs/progsdefs.qh"
-    #include "../dpdefs/dpextensions.qh"
     #include "constants.qh"
     #include "util.qh"
     #include "weapons/all.qh"
index 65deb39..00695cf 100644 (file)
@@ -1,7 +1,6 @@
 #if defined(CSQC)
 #elif defined(MENUQC)
 #elif defined(SVQC)
-       #include "../../../dpdefs/progsdefs.qh"
     #include "../../../warpzonelib/util_server.qh"
     #include "../../../server/defs.qh"
 #endif
diff --git a/qcsrc/common/util-post.qh b/qcsrc/common/util-post.qh
deleted file mode 100644 (file)
index f796b6e..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-#ifndef UTIL_POST_H
-#define UTIL_POST_H
-
-[[alias("self")]] entity __self;
-
-// Can't wrap with do-while as block may contain continue or break
-#define WITH(type, name, value, block) { \
-    type __with_save = (name); \
-    name = (value); \
-    LAMBDA(block) \
-    name = __with_save; \
-} do { } while (0)
-
-// Transition from global 'self' to local 'this'
-
-// Step 1: auto oldself
-#if 1
-#define SELFPARAM() noref entity this = __self
-#define setself(s) (__self = s)
-#define self __self
-#endif
-
-// Step 2: check SELFPARAM() is present for functions that use self
-#if 0
-#define SELFPARAM() [[alias("__self")]] noref entity this = __self
-#define setself(s) (__self = s)
-#define self this
-#endif
-
-// Step 3: const self
-#if 0
-#define SELFPARAM() noref const entity this = __self
-entity setself(entity e) { return self = e; }
-entity getself() { return self; }
-#define self getself()
-#endif
-
-// Step 4: enable when possible
-// TODO: Remove SELFPARAM in favor of a parameter
-#if 0
-#define SELFPARAM() noref const entity this = __self
-#define self this
-#endif
-
-#define spawn() new(entity)
-
-#endif
diff --git a/qcsrc/common/util-pre.qh b/qcsrc/common/util-pre.qh
deleted file mode 100644 (file)
index dfb4071..0000000
+++ /dev/null
@@ -1,116 +0,0 @@
-#ifndef UTIL_PRE_H
-#define UTIL_PRE_H
-
-#ifndef NOCOMPAT
-    #define COMPAT_NO_MOD_IS_XONOTIC
-#endif
-
-#ifndef QCC_SUPPORT_ACCUMULATE
-    #ifdef GMQCC
-        #define QCC_SUPPORT_ACCUMULATE
-    #endif
-#endif
-
-#ifndef QCC_SUPPORT_NIL
-    #ifdef GMQCC
-        #define QCC_SUPPORT_NIL 1
-    #endif
-#endif
-
-#ifndef QCC_SUPPORT_INT
-    #define int float
-
-    #define stoi(s) stof(s)
-    #define stob(s) stof(s)
-    #define itos(i) ftos(i)
-#else
-    #define stoi(s) ((int) stof(s))
-    #define stob(s) ((bool) stof(s))
-    #define itos(i) ftos(i)
-#endif
-
-#define FOREACH_ARRAY(arr, start, end, cond, body) do { \
-    for (int i = start; i < end; ++i) {                 \
-        const noref entity it = arr[i];                 \
-        if (cond) { body }                              \
-    }                                                   \
-} while(0)
-
-#define FOREACH_LIST(list, next, cond, body) do {               \
-    noref int i = 0;                                            \
-    for (entity it = list##_first; it; (it = it.next, ++i)) {   \
-        if (cond) { body }                                      \
-    }                                                           \
-} while(0)
-
-#define FOREACH(list, cond, body) FOREACH_LIST(list, enemy, cond, body)
-
-#ifdef GMQCC
-    #define EVAL(...)           __VA_ARGS__
-
-    #define OVERLOAD_(F, ...)   F##_##__VA_COUNT__(__VA_ARGS__)
-    #define OVERLOAD(F, ...)    F##_##__VA_COUNT__(__VA_ARGS__)
-#else
-    #define EMPTY()
-    #define DEFER(id) id EMPTY()
-
-    #define EVAL(...)  EVAL1(EVAL1(EVAL1(__VA_ARGS__)))
-    #define EVAL1(...) EVAL2(EVAL2(EVAL2(__VA_ARGS__)))
-    #define EVAL2(...) EVAL3(EVAL3(EVAL3(__VA_ARGS__)))
-    #define EVAL3(...) EVAL4(EVAL4(EVAL4(__VA_ARGS__)))
-    #define EVAL4(...) EVAL5(EVAL5(EVAL5(__VA_ARGS__)))
-    #define EVAL5(...) __VA_ARGS__
-
-    #define OVERLOAD___(F,_16,_15,_14,_13,_12,_11,_10,_9,_8,_7,_6,_5,_4,_3,_2,_1,n,...) F##_##n
-    #define OVERLOAD__(F, ...)  OVERLOAD___(F,##__VA_ARGS__,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0)
-    #define OVERLOAD_(...)      DEFER(OVERLOAD__(__VA_ARGS__))
-    #define OVERLOAD(F, ...)    OVERLOAD_(F,##__VA_ARGS__)(__VA_ARGS__)
-#endif
-
-#define LAMBDA(...) { __VA_ARGS__ ; }
-
-#define MAP(f, ...) EVAL(OVERLOAD(MAP, f, __VA_ARGS__))
-#define MAP_2(f, it) f(it)
-#define MAP_3(f, it, ...) f(it)MAP_2(f, __VA_ARGS__)
-#define MAP_4(f, it, ...) f(it)MAP_3(f, __VA_ARGS__)
-#define MAP_5(f, it, ...) f(it)MAP_4(f, __VA_ARGS__)
-#define MAP_6(f, it, ...) f(it)MAP_5(f, __VA_ARGS__)
-#define MAP_7(f, it, ...) f(it)MAP_6(f, __VA_ARGS__)
-#define MAP_8(f, it, ...) f(it)MAP_7(f, __VA_ARGS__)
-#define MAP_9(f, it, ...) f(it)MAP_8(f, __VA_ARGS__)
-#define MAP_10(f, it, ...) f(it)MAP_9(f, __VA_ARGS__)
-#define MAP_11(f, it, ...) f(it)MAP_10(f, __VA_ARGS__)
-#define MAP_12(f, it, ...) f(it)MAP_11(f, __VA_ARGS__)
-#define MAP_13(f, it, ...) f(it)MAP_12(f, __VA_ARGS__)
-#define MAP_14(f, it, ...) f(it)MAP_13(f, __VA_ARGS__)
-#define MAP_15(f, it, ...) f(it)MAP_14(f, __VA_ARGS__)
-#define MAP_16(f, it, ...) f(it)MAP_15(f, __VA_ARGS__)
-#define MAP_17(f, it, ...) f(it)MAP_16(f, __VA_ARGS__)
-#define MAP_18(f, it, ...) f(it)MAP_17(f, __VA_ARGS__)
-#define MAP_19(f, it, ...) f(it)MAP_18(f, __VA_ARGS__)
-#define MAP_20(f, it, ...) f(it)MAP_19(f, __VA_ARGS__)
-
-#define IDENTITY(it) it
-
-#define UNWORDS(...) MAP(IDENTITY, __VA_ARGS__)
-
-#define APPLY(f, ...) f(__VA_ARGS__)
-
-#ifdef SVQC
-    #define SV(f, ...) f(__VA_ARGS__)
-#else
-    #define SV(f, ...)
-#endif
-
-#ifdef CSQC
-    #define CL(f, ...) f(__VA_ARGS__)
-#else
-    #define CL(f, ...)
-#endif
-
-#define IF(cond, f, ...) cond(f, __VA_ARGS__)
-
-#define GET(name) name##get
-#define GETTER(type, name) type GET(name)() { return name; }
-
-#endif
index c304ed8..9c794c0 100644 (file)
@@ -1,7 +1,6 @@
 #include "util.qh"
 
 #if defined(CSQC)
-       #include "../dpdefs/csprogsdefs.qh"
     #include "../client/defs.qh"
     #include "constants.qh"
        #include "../client/mutators/events.qh"
@@ -10,8 +9,6 @@
     #include "deathtypes.qh"
 #elif defined(MENUQC)
 #elif defined(SVQC)
-       #include "../dpdefs/progsdefs.qh"
-    #include "../dpdefs/dpextensions.qh"
     #include "constants.qh"
     #include "../server/autocvars.qh"
     #include "../server/defs.qh"
index ce89bde..e992c4d 100644 (file)
@@ -1,7 +1,6 @@
 #include "util.qh"
 
 #if defined(CSQC)
-       #include "../dpdefs/csprogsdefs.qh"
     #include "../client/defs.qh"
     #include "constants.qh"
 #elif defined(MENUQC)
index 2c72d38..0121433 100644 (file)
@@ -4,7 +4,6 @@
 #include "all.qh"
 
 #if defined(CSQC)
-       #include "../../dpdefs/csprogsdefs.qh"
        #include "../../client/defs.qh"
        #include "../constants.qh"
        #include "../stats.qh"
@@ -21,8 +20,6 @@
        #include "../../csqcmodellib/cl_model.qh"
 #elif defined(MENUQC)
 #elif defined(SVQC)
-       #include "../../dpdefs/progsdefs.qh"
-    #include "../../dpdefs/dpextensions.qh"
     #include "../../warpzonelib/anglestransform.qh"
     #include "../../warpzonelib/common.qh"
     #include "../../warpzonelib/util_server.qh"
index d932224..7d1b4e3 100644 (file)
@@ -1,8 +1,6 @@
 #if defined(CSQC)
 #elif defined(MENUQC)
 #elif defined(SVQC)
-       #include "../../dpdefs/progsdefs.qh"
-    #include "../../dpdefs/dpextensions.qh"
     #include "../util.qh"
     #include "config.qh"
     #include "all.qh"
index ab93b01..b42f5c4 100644 (file)
@@ -20,7 +20,6 @@
  * IN THE SOFTWARE.
  */
  #if defined(CSQC)
-        #include "../dpdefs/csprogsdefs.qh"
         #include "../client/defs.qh"
         #include "../common/util.qh"
         #include "../common/animdecide.qh"
index 1a96e23..7aedd52 100644 (file)
@@ -21,7 +21,6 @@
  * IN THE SOFTWARE.
  */
 #if defined(CSQC)
-       #include "../dpdefs/csprogsdefs.qh"
        #include "../client/defs.qh"
        #include "../common/constants.qh"
        #include "../common/stats.qh"
index 78fb051..fb1094f 100644 (file)
@@ -20,7 +20,6 @@
  * IN THE SOFTWARE.
  */
 #if defined(CSQC)
-       #include "../dpdefs/csprogsdefs.qh"
        #include "../client/defs.qh"
        #include "../warpzonelib/anglestransform.qh"
        #include "../client/autocvars.qh"
index ebe0b6e..0fc2ad8 100644 (file)
@@ -23,8 +23,6 @@
 #if defined(CSQC)
 #elif defined(MENUQC)
 #elif defined(SVQC)
-       #include "../dpdefs/progsdefs.qh"
-       #include "../dpdefs/dpextensions.qh"
        #include "../common/constants.qh"
        #include "../common/util.qh"
        #include "../common/animdecide.qh"
index c00c5a1..5addff3 100644 (file)
@@ -1,18 +1,48 @@
-#include "bool.qh"
+#ifndef NOCOMPAT
+    #define COMPAT_NO_MOD_IS_XONOTIC
+#endif
+
+#include "compiler.qh"
+
+#ifndef QCC_SUPPORT_INT
+    #define int float
+#endif
+
+#ifndef QCC_SUPPORT_BOOL
+    #define bool float
+#endif
+
+#if defined(CSQC)
+    #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"
+#elif defined(MENUQC)
+    #include "../dpdefs/menudefs.qh"
+    #include "../dpdefs/keycodes.qh"
+#endif
 
 #include "../warpzonelib/mathlib.qc"
 
 #include "accumulate.qh"
 #include "bits.qh"
+#include "bool.qh"
 #include "counting.qh"
 #include "cvar.qh"
 #include "defer.qh"
 #include "draw.qh"
 #include "file.qh"
+#include "functional.qh"
 #include "i18n.qh"
+#include "int.qh"
+#include "iter.qh"
 #include "lazy.qh"
 #include "log.qh"
 #include "math.qh"
+#include "misc.qh"
 #include "net.qh"
 #include "nil.qh"
 #include "noise.qc"
@@ -23,8 +53,9 @@
 #include "random.qc"
 #include "registry.qh"
 #include "replicate.qh"
-#include "sort.qh"
+#include "self.qh"
 #include "sortlist.qc"
+#include "sort.qh"
 #include "spawnfunc.qh"
 #include "static.qh"
 #include "string.qh"
index 26169cd..7a719af 100644 (file)
@@ -2,8 +2,6 @@
 #define BOOL_H
 
 #ifndef QCC_SUPPORT_BOOL
-    #define bool float
-
     // Boolean Constants
     const int true     = 1;
     const int false = 0;
diff --git a/qcsrc/lib/compiler.qh b/qcsrc/lib/compiler.qh
new file mode 100644 (file)
index 0000000..69aad5c
--- /dev/null
@@ -0,0 +1,16 @@
+#ifndef COMPILER_H
+#define COMPILER_H
+
+#ifndef QCC_SUPPORT_ACCUMULATE
+    #ifdef GMQCC
+        #define QCC_SUPPORT_ACCUMULATE
+    #endif
+#endif
+
+#ifndef QCC_SUPPORT_NIL
+    #ifdef GMQCC
+        #define QCC_SUPPORT_NIL
+    #endif
+#endif
+
+#endif
index 2a13611..6c49566 100644 (file)
@@ -1,7 +1,9 @@
 #ifndef MENUQC
 #ifndef DEFER_H
 #define DEFER_H
+
 #include "oo.qh"
+#include "self.qh"
 
 entityclass(Defer);
 class(Defer) .entity owner;
diff --git a/qcsrc/lib/functional.qh b/qcsrc/lib/functional.qh
new file mode 100644 (file)
index 0000000..2bbe7d5
--- /dev/null
@@ -0,0 +1,45 @@
+#ifndef FUNCTIONAL_H
+#define FUNCTIONAL_H
+
+#define MAP(f, ...) EVAL(OVERLOAD(MAP, f, __VA_ARGS__))
+#define MAP_2(f, it) f(it)
+#define MAP_3(f, it, ...) f(it)MAP_2(f, __VA_ARGS__)
+#define MAP_4(f, it, ...) f(it)MAP_3(f, __VA_ARGS__)
+#define MAP_5(f, it, ...) f(it)MAP_4(f, __VA_ARGS__)
+#define MAP_6(f, it, ...) f(it)MAP_5(f, __VA_ARGS__)
+#define MAP_7(f, it, ...) f(it)MAP_6(f, __VA_ARGS__)
+#define MAP_8(f, it, ...) f(it)MAP_7(f, __VA_ARGS__)
+#define MAP_9(f, it, ...) f(it)MAP_8(f, __VA_ARGS__)
+#define MAP_10(f, it, ...) f(it)MAP_9(f, __VA_ARGS__)
+#define MAP_11(f, it, ...) f(it)MAP_10(f, __VA_ARGS__)
+#define MAP_12(f, it, ...) f(it)MAP_11(f, __VA_ARGS__)
+#define MAP_13(f, it, ...) f(it)MAP_12(f, __VA_ARGS__)
+#define MAP_14(f, it, ...) f(it)MAP_13(f, __VA_ARGS__)
+#define MAP_15(f, it, ...) f(it)MAP_14(f, __VA_ARGS__)
+#define MAP_16(f, it, ...) f(it)MAP_15(f, __VA_ARGS__)
+#define MAP_17(f, it, ...) f(it)MAP_16(f, __VA_ARGS__)
+#define MAP_18(f, it, ...) f(it)MAP_17(f, __VA_ARGS__)
+#define MAP_19(f, it, ...) f(it)MAP_18(f, __VA_ARGS__)
+#define MAP_20(f, it, ...) f(it)MAP_19(f, __VA_ARGS__)
+
+#define IDENTITY(it) it
+
+#define UNWORDS(...) MAP(IDENTITY, __VA_ARGS__)
+
+#define APPLY(f, ...) f(__VA_ARGS__)
+
+#ifdef SVQC
+    #define SV(f, ...) f(__VA_ARGS__)
+#else
+    #define SV(f, ...)
+#endif
+
+#ifdef CSQC
+    #define CL(f, ...) f(__VA_ARGS__)
+#else
+    #define CL(f, ...)
+#endif
+
+#define IF(cond, f, ...) cond(f, __VA_ARGS__)
+
+#endif
diff --git a/qcsrc/lib/int.qh b/qcsrc/lib/int.qh
new file mode 100644 (file)
index 0000000..d9ea61f
--- /dev/null
@@ -0,0 +1,14 @@
+#ifndef INT_H
+#define INT_H
+
+#ifndef QCC_SUPPORT_INT
+    #define stoi(s) stof(s)
+    #define stob(s) stof(s)
+    #define itos(i) ftos(i)
+#else
+    #define stoi(s) ((int) stof(s))
+    #define stob(s) ((bool) stof(s))
+    #define itos(i) ftos(i)
+#endif
+
+#endif
diff --git a/qcsrc/lib/iter.qh b/qcsrc/lib/iter.qh
new file mode 100644 (file)
index 0000000..53b3d66
--- /dev/null
@@ -0,0 +1,20 @@
+#ifndef ITER_H
+#define ITER_H
+
+#define FOREACH_ARRAY(arr, start, end, cond, body) do { \
+    for (int i = start; i < end; ++i) {                 \
+        const noref entity it = arr[i];                 \
+        if (cond) { body }                              \
+    }                                                   \
+} while(0)
+
+#define FOREACH_LIST(list, next, cond, body) do {               \
+    noref int i = 0;                                            \
+    for (entity it = list##_first; it; (it = it.next, ++i)) {   \
+        if (cond) { body }                                      \
+    }                                                           \
+} while(0)
+
+#define FOREACH(list, cond, body) FOREACH_LIST(list, enemy, cond, body)
+
+#endif
diff --git a/qcsrc/lib/misc.qh b/qcsrc/lib/misc.qh
new file mode 100644 (file)
index 0000000..8a6e117
--- /dev/null
@@ -0,0 +1,39 @@
+#ifndef MISC_H
+#define MISC_H
+
+#ifdef GMQCC
+    #define EVAL(...)           __VA_ARGS__
+
+    #define OVERLOAD_(F, ...)   F##_##__VA_COUNT__(__VA_ARGS__)
+    #define OVERLOAD(F, ...)    F##_##__VA_COUNT__(__VA_ARGS__)
+#else
+    #define EMPTY()
+    #define DEFER(id) id EMPTY()
+
+    #define EVAL(...)  EVAL1(EVAL1(EVAL1(__VA_ARGS__)))
+    #define EVAL1(...) EVAL2(EVAL2(EVAL2(__VA_ARGS__)))
+    #define EVAL2(...) EVAL3(EVAL3(EVAL3(__VA_ARGS__)))
+    #define EVAL3(...) EVAL4(EVAL4(EVAL4(__VA_ARGS__)))
+    #define EVAL4(...) EVAL5(EVAL5(EVAL5(__VA_ARGS__)))
+    #define EVAL5(...) __VA_ARGS__
+
+    #define OVERLOAD___(F,_16,_15,_14,_13,_12,_11,_10,_9,_8,_7,_6,_5,_4,_3,_2,_1,n,...) F##_##n
+    #define OVERLOAD__(F, ...)  OVERLOAD___(F,##__VA_ARGS__,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0)
+    #define OVERLOAD_(...)      DEFER(OVERLOAD__(__VA_ARGS__))
+    #define OVERLOAD(F, ...)    OVERLOAD_(F,##__VA_ARGS__)(__VA_ARGS__)
+#endif
+
+#define GET(name) name##get
+#define GETTER(type, name) type GET(name)() { return name; }
+
+#define LAMBDA(...) { __VA_ARGS__ ; }
+
+// Can't wrap with do-while as block may contain continue or break
+#define WITH(type, name, value, block) { \
+    type __with_save = (name); \
+    name = (value); \
+    LAMBDA(block) \
+    name = __with_save; \
+} do { } while (0)
+
+#endif
index 789b1f9..87e3aea 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef NIL_H
 #define NIL_H
 
-#if QCC_SUPPORT_NIL
+#ifdef QCC_SUPPORT_NIL
 #define func_null nil
 #define string_null nil
 #else
index fce18cb..0615282 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef OO_H
 #define OO_H
 
+#include "misc.qh"
 #include "nil.qh"
 
 #ifdef MENUQC
@@ -35,6 +36,7 @@ entity __spawn(string _classname, string _sourceFile, int _sourceLine) {
     #define class(name) [[class(name)]]
     #define new(class) ((class) __spawn(#class, __FILE__, __LINE__))
 #endif
+#define spawn() new(entity)
 
 // Classes have a `spawn##cname(entity)` constructor
 // The parameter is used across [[accumulate]] functions
diff --git a/qcsrc/lib/self.qh b/qcsrc/lib/self.qh
new file mode 100644 (file)
index 0000000..eac0c64
--- /dev/null
@@ -0,0 +1,37 @@
+#ifndef SELF_H
+#define SELF_H
+
+// Transition from global 'self' to local 'this'
+
+[[alias("self")]] entity __self;
+
+// Step 1: auto oldself
+#if 1
+#define SELFPARAM() noref entity this = __self
+#define setself(s) (__self = s)
+#define self __self
+#endif
+
+// Step 2: check SELFPARAM() is present for functions that use self
+#if 0
+#define SELFPARAM() [[alias("__self")]] noref entity this = __self
+#define setself(s) (__self = s)
+#define self this
+#endif
+
+// Step 3: const self
+#if 0
+#define SELFPARAM() noref const entity this = __self
+entity setself(entity e) { return self = e; }
+entity getself() { return self; }
+#define self getself()
+#endif
+
+// Step 4: enable when possible
+// TODO: Remove SELFPARAM in favor of a parameter
+#if 0
+#define SELFPARAM() noref const entity this = __self
+#define self this
+#endif
+
+#endif
index d1f5357..edc2f5b 100644 (file)
@@ -1,8 +1,6 @@
 #ifndef TEST_H
 #define TEST_H
 
-#include "../common/util.qh"
-
 #define TEST_Check(cond) do { if(!(cond)) TEST_Fail(#cond); } while(0)
 
 void TEST_OK();
index 6f19678..e4b8a8f 100644 (file)
@@ -1,8 +1,6 @@
 #ifndef URLLIB_H
 #define URLLIB_H
 
-#include "../common/util.qh"
-
 // URI handles
 const int URI_GET_DISCARD = 0;
 const int URI_GET_IPBAN = 1;
index a6903ae..7834cdb 100644 (file)
@@ -1,7 +1,4 @@
 #ifndef CLIENT_ALL_H
 #define CLIENT_ALL_H
 
-#include "../dpdefs/menudefs.qh"
-#include "../dpdefs/keycodes.qh"
-
 #endif
index 5563b96..d24220f 100644 (file)
@@ -1,6 +1,5 @@
 #ifndef ANIM_ANIMATION_H
 #define ANIM_ANIMATION_H
-#include "../oo/base.qh"
 void setterDummy(entity, float);
 CLASS(Animation, Object)
        METHOD(Animation, configureAnimation, void(entity, entity, void(entity, float), float, float, float, float));
index 4489de3..55ca901 100644 (file)
@@ -2,7 +2,6 @@
 
 #ifndef ANIM_ANIMHOST_H
 #define ANIM_ANIMHOST_H
-#include "../oo/base.qh"
 CLASS(AnimHost, Object)
        METHOD(AnimHost, addAnim, void(entity, entity));
        METHOD(AnimHost, removeAnim, void(entity, entity));
index 8788f2e..fa6161a 100644 (file)
@@ -1,7 +1,6 @@
 #ifndef ITEM_H
 #define ITEM_H
 #include "skin.qh"
-#include "oo/base.qh"
 CLASS(Item, Object)
        METHOD(Item, draw, void(entity));
        METHOD(Item, keyDown, float(entity, float, float, float));
index 0ece40c..6d45ca8 100644 (file)
@@ -4,8 +4,6 @@
 #include "draw.qh"
 #include "skin.qh"
 
-#include "oo/base.qh"
-
 #include "xonotic/util.qh"
 
 #include "../common/constants.qh"
diff --git a/qcsrc/menu/oo/base.qh b/qcsrc/menu/oo/base.qh
deleted file mode 100644 (file)
index 894b4b9..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-#ifndef BASE_H
-#define BASE_H
-
-#include "../../common/util.qh"
-#include "../../dpdefs/keycodes.qh"
-
-#define world NULL
-
-#endif
index 4a14eea..16a830d 100644 (file)
@@ -1,6 +1,5 @@
 #ifndef CLASSES_H
 #define CLASSES_H
-#include "base.qh"
 
 #include "../classes.inc"
 #define IMPLEMENTATION
index ba7411b..ae221de 100644 (file)
@@ -1,10 +1,7 @@
-#include "../common/util-pre.qh"
-#include "../dpdefs/menudefs.qh"
-#include "../dpdefs/keycodes.qh"
-#include "../common/util-post.qh"
-
 #include "../lib/_all.inc"
 
+#define world NULL
+
 #include "oo/classes.qc"
 
 #include "draw.qc"
index f4faea6..3ef0213 100644 (file)
@@ -1,6 +1,5 @@
 #include "util.qh"
 #include "../menu.qh"
-#include "../oo/base.qh"
 #include "../../common/campaign_common.qh"
 #include "../../common/constants.qh"
 #include "../../common/mapinfo.qh"
index 3e99cab..dd3b1aa 100644 (file)
@@ -6,8 +6,6 @@
 #include "defs.qh"
 #include "miscfunctions.qh"
 
-#include "../dpdefs/progsdefs.qh"
-#include "../dpdefs/dpextensions.qh"
 
 #include "../common/models/all.qh"
 #include "../common/sounds/all.qh"
index 32742d8..61bb611 100644 (file)
@@ -5,8 +5,6 @@
 #include "defs.qh"
 #include "miscfunctions.qh"
 
-#include "../dpdefs/progsdefs.qh"
-#include "../dpdefs/dpextensions.qh"
 
 
 #include "command/common.qh"
index f152c82..64db8da 100644 (file)
@@ -1,8 +1,6 @@
 #if defined(CSQC)
 #elif defined(MENUQC)
 #elif defined(SVQC)
-       #include "../dpdefs/progsdefs.qh"
-    #include "../dpdefs/dpextensions.qh"
     #include "../common/vehicles/all.qh"
     #include "antilag.qh"
 #endif
diff --git a/qcsrc/server/bot/_all.inc b/qcsrc/server/bot/_all.inc
new file mode 100644 (file)
index 0000000..2965baa
--- /dev/null
@@ -0,0 +1,7 @@
+#include "aim.qc"
+#include "bot.qc"
+#include "navigation.qc"
+#include "scripting.qc"
+#include "waypoints.qc"
+
+#include "havocbot/_all.inc"
index 00051ca..c033dae 100644 (file)
@@ -31,9 +31,6 @@
 
 #include "../../csqcmodellib/sv_model.qh"
 
-#include "../../dpdefs/dpextensions.qh"
-#include "../../dpdefs/progsdefs.qh"
-
 #include "../../warpzonelib/common.qh"
 #include "../../warpzonelib/util_server.qh"
 
diff --git a/qcsrc/server/bot/havocbot/_all.inc b/qcsrc/server/bot/havocbot/_all.inc
new file mode 100644 (file)
index 0000000..fb73954
--- /dev/null
@@ -0,0 +1,3 @@
+#include "havocbot.qc"
+#include "role_keyhunt.qc"
+#include "roles.qc"
index 4ebe76b..a26fa97 100644 (file)
@@ -1,7 +1,6 @@
 #if defined(CSQC)
 #elif defined(MENUQC)
 #elif defined(SVQC)
-       #include "../dpdefs/progsdefs.qh"
     #include "../common/constants.qh"
 #endif
 
index e743069..6e0f5b5 100644 (file)
@@ -4,8 +4,6 @@
 #if defined(CSQC)
 #elif defined(MENUQC)
 #elif defined(SVQC)
-       #include "../dpdefs/progsdefs.qh"
-    #include "../dpdefs/dpextensions.qh"
     #include "../warpzonelib/common.qh"
     #include "../common/constants.qh"
     #include "../common/teams.qh"
index 781ecc6..2002026 100644 (file)
@@ -2,7 +2,12 @@
 
 #include "../common/triggers/subs.qh"
 
-#include "../client/bgmscript.qh"
+entityclass(BGMScript);
+class(BGMScript) .string bgmscript;
+class(BGMScript) .float bgmscriptattack;
+class(BGMScript) .float bgmscriptdecay;
+class(BGMScript) .float bgmscriptsustain;
+class(BGMScript) .float bgmscriptrelease;
 
 #include "../common/constants.qh"
 #include "../csqcmodellib/sv_model.qh"
index 5bf648a..f185d4a 100644 (file)
@@ -6,8 +6,6 @@
 #include "defs.qh"
 #include "../common/constants.qh"
 #include "../common/util.qh"
-#include "../dpdefs/dpextensions.qh"
-#include "../dpdefs/progsdefs.qh"
 
 /*
  * Protocol of online ban list:
index 0c63015..de32a17 100644 (file)
@@ -1,7 +1,6 @@
 #if defined(CSQC)
 #elif defined(MENUQC)
 #elif defined(SVQC)
-       #include "../../dpdefs/progsdefs.qh"
     #include "mutators_include.qh"
     #include "../../common/mapinfo.qh"
 #endif
index 8564d34..e948ab6 100644 (file)
@@ -1,8 +1,6 @@
 #if defined(CSQC)
 #elif defined(MENUQC)
 #elif defined(SVQC)
-    #include "../../dpdefs/progsdefs.qh"
-    #include "../../dpdefs/dpextensions.qh"
     #include "../../warpzonelib/anglestransform.qh"
     #include "../../warpzonelib/common.qh"
     #include "../../warpzonelib/util_server.qh"
diff --git a/qcsrc/server/pathlib/_all.inc b/qcsrc/server/pathlib/_all.inc
new file mode 100644 (file)
index 0000000..8622734
--- /dev/null
@@ -0,0 +1,6 @@
+#include "costs.qc"
+#include "expandnode.qc"
+#include "main.qc"
+#include "movenode.qc"
+#include "path_waypoint.qc"
+#include "utility.qc"
index b21ed2e..082356a 100644 (file)
@@ -1,8 +1,6 @@
 #if defined(CSQC)
 #elif defined(MENUQC)
 #elif defined(SVQC)
-       #include "../dpdefs/progsdefs.qh"
-    #include "../dpdefs/dpextensions.qh"
     #include "defs.qh"
     #include "playerdemo.qh"
 #endif
index adb8cf6..d8eda49 100644 (file)
@@ -1,10 +1,3 @@
-#include "../common/util-pre.qh"
-#include "sys-pre.qh"
-#include "../dpdefs/progsdefs.qh"
-#include "../dpdefs/dpextensions.qh"
-#include "sys-post.qh"
-#include "../common/util-post.qh"
-
 #include "../lib/_all.inc"
 
 #include "anticheat.qc"
 #include "t_quake3.qc"
 #include "t_quake.qc"
 
-#include "bot/aim.qc"
-#include "bot/bot.qc"
-#include "bot/navigation.qc"
-#include "bot/scripting.qc"
-#include "bot/waypoints.qc"
-
-#include "bot/havocbot/havocbot.qc"
-#include "bot/havocbot/role_keyhunt.qc"
-#include "bot/havocbot/roles.qc"
+#include "bot/_all.inc"
 
 #include "command/all.qc"
 
 #include "mutators/mutators_include.qc"
 #include "mutators/mutators.qc"
 
-#include "pathlib/costs.qc"
-#include "pathlib/expandnode.qc"
-#include "pathlib/main.qc"
-#include "pathlib/movenode.qc"
-#include "pathlib/path_waypoint.qc"
-#include "pathlib/utility.qc"
+#include "pathlib/_all.inc"
 
 #include "weapons/accuracy.qc"
 #include "weapons/common.qc"
index fbf84da..4941b55 100644 (file)
@@ -1,8 +1,6 @@
 #if defined(CSQC)
 #elif defined(MENUQC)
 #elif defined(SVQC)
-    #include "../dpdefs/progsdefs.qh"
-    #include "../dpdefs/dpextensions.qh"
 #endif
 
 /**
index dd79b17..81554c4 100644 (file)
@@ -1,47 +1,6 @@
 #ifndef T_ITEMS_H
 #define T_ITEMS_H
 
-// constants
-const int IT_UNLIMITED_WEAPON_AMMO             =       1; // when this bit is set, using a weapon does not reduce ammo. Checkpoints can give this powerup.
-const int IT_UNLIMITED_SUPERWEAPONS            =       2; // when this bit is set, superweapons don't expire. Checkpoints can give this powerup.
-const int IT_CTF_SHIELDED                      =       4; // set for the flag shield
-const int IT_USING_JETPACK                     =       8; // confirmation that button is pressed
-const int IT_JETPACK                           =      16; // actual item
-const int IT_FUEL_REGEN                        =      32; // fuel regeneration trigger
-// where is 64... ?
-const int IT_FUEL                                      =     128;
-// -Wdouble-declaration
-#define IT_SHELLS                                        256
-// -Wdouble-declaration
-#define IT_NAILS                                         512
-// -Wdouble-declaration
-#define IT_ROCKETS                                      1024
-// -Wdouble-declaration
-#define IT_CELLS                                        2048
-const int IT_SUPERWEAPON                               =    4096;
-const int IT_STRENGTH                                  =    8192;
-const int IT_INVINCIBLE                                =   16384;
-const int IT_HEALTH                                    =   32768;
-const int IT_PLASMA                                    =   65536;
-
-// shared value space (union):
-       // for items:
-       // -Wdouble-declaration
-       #define IT_KEY1                                                 131072
-       // -Wdouble-declaration
-       #define IT_KEY2                                                 262144
-// end
-
-const int IT_5HP                               =  524288;
-const int IT_25HP                              = 1048576;
-const int IT_ARMOR_SHARD                       = 2097152;
-const int IT_ARMOR                             = 4194304;
-
-// item masks
-const int IT_AMMO                              =    3968; // IT_FUEL | IT_SHELLS | IT_NAILS | IT_ROCKETS | IT_CELLS | IT_PLASMA;
-const int IT_PICKUPMASK                        =      51; // IT_FUEL_REGEN | IT_JETPACK | IT_UNLIMITED_AMMO; // strength and invincible are handled separately
-const int IT_UNLIMITED_AMMO                    =       3; // IT_UNLIMITED_SUPERWEAPONS | IT_UNLIMITED_WEAPON_AMMO;
-
 const int AMMO_COUNT = 4; // amount of ammo types to show in the inventory panel
 
 // item networking
index e4f3878..e31476f 100755 (executable)
@@ -4,30 +4,35 @@ cd "$(dirname "$0")"
 cd ..
 
 declare -a NOWARN=(
-  '-Wno-field-redeclared'
-  '-Wno-unused-variable'
-  '-Wno-implicit-function-pointer'
+  -Wno-field-redeclared
+  -Wno-unused-variable
+  -Wno-implicit-function-pointer
 )
 declare -a FEATURES=(
-  '-DVEHICLES_ENABLED=1'
-  '-DVEHICLES_USE_ODE=0'
+  -DVEHICLES_ENABLED=1
+  -DVEHICLES_USE_ODE=0
 )
 declare QCC=../../../gmqcc/gmqcc
 
+declare -a QCC_FLAGS=(
+  -std=gmqcc
+  -Wall -Werror
+  -fftepp -fftepp-predefs -Wcpp
+  -futf8
+  -freturn-assignments
+  -frelaxed-switch
+  -O3
+)
+
 function check() {
-  declare -l base="$1"
-  declare -la predefs=("${!2}")
-  find "$base" -type f -name '*.qc' -print0 | sort -z | while IFS= read -r -d '' file; do
+  declare -l base="${1}"
+  declare -la predefs=("-D${2}" "lib/_all.inc")
+  find "$base" -type f -name '*.qc' -print0 | sort -z | while read -r -d '' file; do
     echo "$file"
-    ${QCC} -std=gmqcc -fftepp -fftepp-predefs -Werror -Wall "${NOWARN[@]}" "${FEATURES[@]}" -futf8 -O3 "${predefs[@]}" "$file" >/dev/null
+    ${QCC} "${QCC_FLAGS[@]}" "${NOWARN[@]}" "${FEATURES[@]}" "${predefs[@]}" "$file" >/dev/null
   done
 }
 
-clientdefs=("-DCSQC" "common/util-pre.qh" "dpdefs/csprogsdefs.qh")
-check "client" clientdefs[@]
-
-serverdefs=("-DSVQC" "common/util-pre.qh" "server/sys-pre.qh" "dpdefs/progsdefs.qh" "dpdefs/dpextensions.qh" "server/sys-post.qh" "server/defs.qh" "server/autocvars.qh")
-check "server" serverdefs[@]
-
-menudefs=("-DMENUQC" "common/util-pre.qh" "dpdefs/menudefs.qh")
-check "menu" menudefs[@]
+check client CSQC
+check server SVQC
+check menu MENUQC
index 079ceaa..f92947f 100644 (file)
@@ -1,11 +1,8 @@
 #include "anglestransform.qh"
 
 #if defined(CSQC)
-       #include "../dpdefs/csprogsdefs.qh"
 #elif defined(MENUQC)
 #elif defined(SVQC)
-       #include "../dpdefs/progsdefs.qh"
-    #include "../dpdefs/dpextensions.qh"
 #endif
 
 #ifdef POSITIVE_PITCH_IS_DOWN
index 85fbdd9..68c2984 100644 (file)
@@ -4,7 +4,6 @@
 #if defined(CSQC)
        #include "../client/autocvars.qh"
        #include "../csqcmodellib/cl_model.qh"
-       #include "../dpdefs/csprogsdefs.qh"
 #elif defined(MENUQC)
 #elif defined(SVQC)
 #endif
index 0eaaac9..044b4d8 100644 (file)
@@ -1,13 +1,10 @@
 #include "common.qh"
 
 #if defined(CSQC)
-       #include "../dpdefs/csprogsdefs.qh"
     #include "../server/t_items.qh"
 #elif defined(MENUQC)
 #elif defined(SVQC)
     #include "../common/weapons/all.qh"
-    #include "../dpdefs/dpextensions.qh"
-       #include "../dpdefs/progsdefs.qh"
 #endif
 
 void WarpZone_Accumulator_Clear(entity acc)
index f61712d..92b7ee1 100644 (file)
@@ -1,10 +1,7 @@
 #include "mathlib.qh"
 #if defined(CSQC)
-       #include "../dpdefs/csprogsdefs.qh"
 #elif defined(MENUQC)
 #elif defined(SVQC)
-    #include "../dpdefs/dpextensions.qh"
-       #include "../dpdefs/progsdefs.qh"
 #endif
 
 int fpclassify(float x)
index d34870e..033594d 100644 (file)
@@ -7,8 +7,6 @@
        #include "../common/constants.qh"
        #include "../common/triggers/subs.qh"
        #include "../common/util.qh"
-       #include "../dpdefs/dpextensions.qh"
-       #include "../dpdefs/progsdefs.qh"
        #include "../server/command/common.qh"
        #include "../server/constants.qh"
        #include "../server/defs.qh"
index 0b983c2..61c0636 100644 (file)
@@ -6,8 +6,6 @@
 #elif defined(MENUQC)
 #elif defined(SVQC)
     #include "../csqcmodellib/sv_model.qh"
-    #include "../dpdefs/dpextensions.qh"
-       #include "../dpdefs/progsdefs.qh"
 #endif
 #include "common.qh"