]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
ECS: Initial commit
authorTimePath <andrew.hardaker1995@gmail.com>
Thu, 7 Apr 2016 12:43:11 +0000 (22:43 +1000)
committerTimePath <andrew.hardaker1995@gmail.com>
Fri, 8 Apr 2016 14:24:33 +0000 (00:24 +1000)
136 files changed:
qcsrc/Makefile
qcsrc/client/_mod.qh [new file with mode: 0644]
qcsrc/client/commands/_mod.qh [new file with mode: 0644]
qcsrc/client/defs.qh
qcsrc/client/hud/_mod.qh [new file with mode: 0644]
qcsrc/client/hud/panel/_mod.qh [new file with mode: 0644]
qcsrc/client/mutators/_mod.qh [new file with mode: 0644]
qcsrc/client/progs.inc
qcsrc/client/weapons/_mod.qh [new file with mode: 0644]
qcsrc/common/_mod.qh [new file with mode: 0644]
qcsrc/common/command/_mod.qh [new file with mode: 0644]
qcsrc/common/deathtypes/_mod.qh [new file with mode: 0644]
qcsrc/common/effects/_mod.qh [new file with mode: 0644]
qcsrc/common/effects/qc/_mod.qh [new file with mode: 0644]
qcsrc/common/gamemodes/_mod.qh [new file with mode: 0644]
qcsrc/common/gamemodes/gamemode/_mod.qh [new file with mode: 0644]
qcsrc/common/gamemodes/gamemode/nexball/_mod.qh [new file with mode: 0644]
qcsrc/common/gamemodes/gamemode/onslaught/_mod.qh [new file with mode: 0644]
qcsrc/common/impulses/_mod.qh [new file with mode: 0644]
qcsrc/common/items/_mod.qh [new file with mode: 0644]
qcsrc/common/items/item/_mod.qh [new file with mode: 0644]
qcsrc/common/minigames/_mod.inc
qcsrc/common/minigames/_mod.qh [new file with mode: 0644]
qcsrc/common/minigames/minigame/_mod.qh [new file with mode: 0644]
qcsrc/common/models/_mod.qh [new file with mode: 0644]
qcsrc/common/monsters/_mod.qh [new file with mode: 0644]
qcsrc/common/monsters/monster/_mod.qh [new file with mode: 0644]
qcsrc/common/mutators/_mod.qh [new file with mode: 0644]
qcsrc/common/mutators/base.qh
qcsrc/common/mutators/mutator/_mod.qh [new file with mode: 0644]
qcsrc/common/mutators/mutator/bloodloss/_mod.qh [new file with mode: 0644]
qcsrc/common/mutators/mutator/breakablehook/_mod.qh [new file with mode: 0644]
qcsrc/common/mutators/mutator/buffs/_mod.qh [new file with mode: 0644]
qcsrc/common/mutators/mutator/bugrigs/_mod.qh [new file with mode: 0644]
qcsrc/common/mutators/mutator/campcheck/_mod.qh [new file with mode: 0644]
qcsrc/common/mutators/mutator/cloaked/_mod.qh [new file with mode: 0644]
qcsrc/common/mutators/mutator/damagetext/_mod.qh [new file with mode: 0644]
qcsrc/common/mutators/mutator/dodging/_mod.qh [new file with mode: 0644]
qcsrc/common/mutators/mutator/doublejump/_mod.qh [new file with mode: 0644]
qcsrc/common/mutators/mutator/hook/_mod.qh [new file with mode: 0644]
qcsrc/common/mutators/mutator/instagib/_mod.qh [new file with mode: 0644]
qcsrc/common/mutators/mutator/invincibleproj/_mod.qh [new file with mode: 0644]
qcsrc/common/mutators/mutator/melee_only/_mod.qh [new file with mode: 0644]
qcsrc/common/mutators/mutator/midair/_mod.qh [new file with mode: 0644]
qcsrc/common/mutators/mutator/multijump/_mod.qh [new file with mode: 0644]
qcsrc/common/mutators/mutator/nades/_mod.qh [new file with mode: 0644]
qcsrc/common/mutators/mutator/new_toys/_mod.qh [new file with mode: 0644]
qcsrc/common/mutators/mutator/nix/_mod.qh [new file with mode: 0644]
qcsrc/common/mutators/mutator/overkill/_mod.qh [new file with mode: 0644]
qcsrc/common/mutators/mutator/physical_items/_mod.qh [new file with mode: 0644]
qcsrc/common/mutators/mutator/pinata/_mod.qh [new file with mode: 0644]
qcsrc/common/mutators/mutator/random_gravity/_mod.qh [new file with mode: 0644]
qcsrc/common/mutators/mutator/rocketflying/_mod.qh [new file with mode: 0644]
qcsrc/common/mutators/mutator/rocketminsta/_mod.qh [new file with mode: 0644]
qcsrc/common/mutators/mutator/running_guns/_mod.qh [new file with mode: 0644]
qcsrc/common/mutators/mutator/sandbox/_mod.qh [new file with mode: 0644]
qcsrc/common/mutators/mutator/spawn_near_teammate/_mod.qh [new file with mode: 0644]
qcsrc/common/mutators/mutator/superspec/_mod.qh [new file with mode: 0644]
qcsrc/common/mutators/mutator/touchexplode/_mod.qh [new file with mode: 0644]
qcsrc/common/mutators/mutator/vampire/_mod.qh [new file with mode: 0644]
qcsrc/common/mutators/mutator/vampirehook/_mod.qh [new file with mode: 0644]
qcsrc/common/mutators/mutator/waypoints/_mod.qh [new file with mode: 0644]
qcsrc/common/mutators/mutator/weaponarena_random/_mod.qh [new file with mode: 0644]
qcsrc/common/notifications/_mod.qh [new file with mode: 0644]
qcsrc/common/physics/_mod.qh [new file with mode: 0644]
qcsrc/common/physics/movetypes/_mod.qh [new file with mode: 0644]
qcsrc/common/sounds/_mod.qh [new file with mode: 0644]
qcsrc/common/triggers/_mod.qh [new file with mode: 0644]
qcsrc/common/triggers/func/_mod.qh [new file with mode: 0644]
qcsrc/common/triggers/misc/_mod.qh [new file with mode: 0644]
qcsrc/common/triggers/target/_mod.qh [new file with mode: 0644]
qcsrc/common/triggers/trigger/_mod.qh [new file with mode: 0644]
qcsrc/common/turrets/_mod.qh [new file with mode: 0644]
qcsrc/common/turrets/turret/_mod.qh [new file with mode: 0644]
qcsrc/common/vehicles/_mod.qh [new file with mode: 0644]
qcsrc/common/vehicles/vehicle/_mod.qh [new file with mode: 0644]
qcsrc/common/weapons/_mod.qh [new file with mode: 0644]
qcsrc/common/weapons/weapon/_mod.qh [new file with mode: 0644]
qcsrc/dpdefs/doc.md
qcsrc/ecs/README.md [new file with mode: 0644]
qcsrc/ecs/_lib.inc [new file with mode: 0644]
qcsrc/ecs/_mod.inc [new file with mode: 0644]
qcsrc/ecs/_mod.qh [new file with mode: 0644]
qcsrc/ecs/cl_main.qc [new file with mode: 0644]
qcsrc/ecs/components/_mod.inc [new file with mode: 0644]
qcsrc/ecs/components/_mod.qh [new file with mode: 0644]
qcsrc/ecs/components/input.qc [new file with mode: 0644]
qcsrc/ecs/components/input.qh [new file with mode: 0644]
qcsrc/ecs/components/physics.qc [new file with mode: 0644]
qcsrc/ecs/components/physics.qh [new file with mode: 0644]
qcsrc/ecs/events/_mod.inc [new file with mode: 0644]
qcsrc/ecs/events/_mod.qh [new file with mode: 0644]
qcsrc/ecs/events/physics.qc [new file with mode: 0644]
qcsrc/ecs/events/physics.qh [new file with mode: 0644]
qcsrc/ecs/main.qc [new file with mode: 0644]
qcsrc/ecs/main.qh [new file with mode: 0644]
qcsrc/ecs/systems/_mod.inc [new file with mode: 0644]
qcsrc/ecs/systems/_mod.qh [new file with mode: 0644]
qcsrc/ecs/systems/physics.qc [new file with mode: 0644]
qcsrc/ecs/systems/physics.qh [new file with mode: 0644]
qcsrc/lib/_all.inc
qcsrc/lib/_mod.qh [new file with mode: 0644]
qcsrc/lib/csqcmodel/_mod.qh [new file with mode: 0644]
qcsrc/lib/draw.qh
qcsrc/lib/macro.qh
qcsrc/lib/matrix/_mod.qh [new file with mode: 0644]
qcsrc/lib/misc.qh
qcsrc/lib/net.qh
qcsrc/lib/vector.qh
qcsrc/lib/warpzone/_mod.qh [new file with mode: 0644]
qcsrc/menu/_mod.qh [new file with mode: 0644]
qcsrc/menu/anim/_mod.qh [new file with mode: 0644]
qcsrc/menu/command/_mod.qh [new file with mode: 0644]
qcsrc/menu/command/all.qc
qcsrc/menu/command/all.qh [new file with mode: 0644]
qcsrc/menu/item/_mod.qh [new file with mode: 0644]
qcsrc/menu/matrix.qc
qcsrc/menu/matrix.qh [new file with mode: 0644]
qcsrc/menu/mutators/_mod.qh [new file with mode: 0644]
qcsrc/menu/progs.inc
qcsrc/menu/xonotic/_mod.qh [new file with mode: 0644]
qcsrc/server/_mod.qh [new file with mode: 0644]
qcsrc/server/bot/_mod.qh [new file with mode: 0644]
qcsrc/server/bot/havocbot/_mod.qh [new file with mode: 0644]
qcsrc/server/cl_player.qc
qcsrc/server/command/_mod.inc
qcsrc/server/command/_mod.qh [new file with mode: 0644]
qcsrc/server/matrix.qc
qcsrc/server/mutators/_mod.qh [new file with mode: 0644]
qcsrc/server/mutators/mutator/_mod.qh [new file with mode: 0644]
qcsrc/server/pathlib/_mod.qh [new file with mode: 0644]
qcsrc/server/progs.inc
qcsrc/server/weapons/_mod.qh [new file with mode: 0644]
qcsrc/tools/compilationunits.sh
qcsrc/tools/genmod.sh
qcsrc/tools/headerstyle.sh

index ee335d9b0013817edf041d88082c9d8a8a9d2cea..0ed67281b4259d18fdd466d6f29912b94f011a63 100644 (file)
@@ -7,6 +7,7 @@ WORKDIR ?= ../.tmp
 QCCFLAGS_WATERMARK ?= $(shell git describe --tags --dirty='~')
 VER = $(subst *,\*,$(QCCFLAGS_WATERMARK))
 NDEBUG ?= 1
+XONOTIC ?= 1
 BUILD_MOD ?= 0
 
 ifndef ZIP
@@ -30,6 +31,7 @@ QCCFLAGS_WTFS ?= \
        -Wno-field-redeclared
 
 QCCDEFS ?= \
+       -DXONOTIC=$(XONOTIC) \
        -DWATERMARK="$(QCCFLAGS_WATERMARK)" \
        -DNDEBUG=$(NDEBUG) \
        -DBUILD_MOD=$(BUILD_MOD) \
diff --git a/qcsrc/client/_mod.qh b/qcsrc/client/_mod.qh
new file mode 100644 (file)
index 0000000..17c2a81
--- /dev/null
@@ -0,0 +1,13 @@
+// generated file; do not modify
+#include "announcer.qh"
+#include "bgmscript.qh"
+#include "csqcmodel_hooks.qh"
+#include "main.qh"
+#include "mapvoting.qh"
+#include "miscfunctions.qh"
+#include "player_skeleton.qh"
+#include "scoreboard.qh"
+#include "shownames.qh"
+#include "teamradar.qh"
+#include "view.qh"
+#include "wall.qh"
diff --git a/qcsrc/client/commands/_mod.qh b/qcsrc/client/commands/_mod.qh
new file mode 100644 (file)
index 0000000..25c01a4
--- /dev/null
@@ -0,0 +1,3 @@
+// generated file; do not modify
+#include "all.qh"
+#include "cl_cmd.qh"
index 84bcb2b3d1de61b9417c250c5f28d1ad4ce79270..708358d9be2e018d892652309716e79ab6757caf 100644 (file)
@@ -27,7 +27,6 @@ float         dmg_take;
 .int team;
 .int team_size;
 
-float vid_conwidth, vid_conheight;
 int binddb;
 
 // QUALIFYING
@@ -86,7 +85,7 @@ vector lightning_shotorigin[4];
 float blurtest_time0, blurtest_time1, blurtest_radius, blurtest_power;
 #endif
 
-float servertime, serverprevtime, serverdeltatime;
+float serverprevtime, serverdeltatime;
 
 float ticrate;
 
diff --git a/qcsrc/client/hud/_mod.qh b/qcsrc/client/hud/_mod.qh
new file mode 100644 (file)
index 0000000..805149a
--- /dev/null
@@ -0,0 +1,3 @@
+// generated file; do not modify
+#include "hud.qh"
+#include "hud_config.qh"
diff --git a/qcsrc/client/hud/panel/_mod.qh b/qcsrc/client/hud/panel/_mod.qh
new file mode 100644 (file)
index 0000000..5afd4e0
--- /dev/null
@@ -0,0 +1,20 @@
+// generated file; do not modify
+#include "ammo.qh"
+#include "centerprint.qh"
+#include "chat.qh"
+#include "engineinfo.qh"
+#include "healtharmor.qh"
+#include "infomessages.qh"
+#include "minigame.qh"
+#include "modicons.qh"
+#include "notify.qh"
+#include "physics.qh"
+#include "powerups.qh"
+#include "pressedkeys.qh"
+#include "quickmenu.qh"
+#include "racetimer.qh"
+#include "radar.qh"
+#include "score.qh"
+#include "timer.qh"
+#include "vote.qh"
+#include "weapons.qh"
diff --git a/qcsrc/client/mutators/_mod.qh b/qcsrc/client/mutators/_mod.qh
new file mode 100644 (file)
index 0000000..98fb481
--- /dev/null
@@ -0,0 +1 @@
+// generated file; do not modify
index 8817a2c71bfa14506774e73886ad3a00a93b5e43..68a61c26670772c64fb9107a331df79eb8858a45 100644 (file)
@@ -1,25 +1,29 @@
 #include <lib/_all.inc>
-#include "_all.qh"
+#if XONOTIC
+       #include "_all.qh"
 
-#include "_mod.inc"
-#include "commands/_mod.inc"
-#include "hud/_mod.inc"
-#include "mutators/_mod.inc"
-#include "weapons/_mod.inc"
+       #include "_mod.inc"
+       #include "commands/_mod.inc"
+       #include "hud/_mod.inc"
+       #include "mutators/_mod.inc"
+       #include "weapons/_mod.inc"
 
-#include <common/_all.inc>
-#include <common/effects/qc/all.qc>
+       #include <common/_all.inc>
+       #include <common/effects/qc/all.qc>
 
-#include <lib/csqcmodel/cl_model.qc>
-#include <lib/csqcmodel/cl_player.qc>
-#include <lib/csqcmodel/interpolate.qc>
+       #include <lib/csqcmodel/cl_model.qc>
+       #include <lib/csqcmodel/cl_player.qc>
+       #include <lib/csqcmodel/interpolate.qc>
 
-#include <lib/warpzone/anglestransform.qc>
-#include <lib/warpzone/common.qc>
-#include <lib/warpzone/client.qc>
-#include <lib/warpzone/server.qc>
-#include <lib/warpzone/util_server.qc>
+       #include <lib/warpzone/anglestransform.qc>
+       #include <lib/warpzone/common.qc>
+       #include <lib/warpzone/client.qc>
+       #include <lib/warpzone/server.qc>
+       #include <lib/warpzone/util_server.qc>
+#endif
+
+#include <ecs/_lib.inc>
 
 #if BUILD_MOD
-#include "../../mod/client/progs.inc"
+       #include "../../mod/client/progs.inc"
 #endif
diff --git a/qcsrc/client/weapons/_mod.qh b/qcsrc/client/weapons/_mod.qh
new file mode 100644 (file)
index 0000000..2ca20e2
--- /dev/null
@@ -0,0 +1,2 @@
+// generated file; do not modify
+#include "projectile.qh"
diff --git a/qcsrc/common/_mod.qh b/qcsrc/common/_mod.qh
new file mode 100644 (file)
index 0000000..6c4dabf
--- /dev/null
@@ -0,0 +1,13 @@
+// generated file; do not modify
+#include "anim.qh"
+#include "animdecide.qh"
+#include "campaign_file.qh"
+#include "campaign_setup.qh"
+#include "ent_cs.qh"
+#include "mapinfo.qh"
+#include "net_notice.qh"
+#include "playerstats.qh"
+#include "state.qh"
+#include "t_items.qh"
+#include "util.qh"
+#include "viewloc.qh"
diff --git a/qcsrc/common/command/_mod.qh b/qcsrc/common/command/_mod.qh
new file mode 100644 (file)
index 0000000..dbad75c
--- /dev/null
@@ -0,0 +1,5 @@
+// generated file; do not modify
+#include "all.qh"
+#include "generic.qh"
+#include "markup.qh"
+#include "rpn.qh"
diff --git a/qcsrc/common/deathtypes/_mod.qh b/qcsrc/common/deathtypes/_mod.qh
new file mode 100644 (file)
index 0000000..56565b0
--- /dev/null
@@ -0,0 +1,2 @@
+// generated file; do not modify
+#include "all.qh"
diff --git a/qcsrc/common/effects/_mod.qh b/qcsrc/common/effects/_mod.qh
new file mode 100644 (file)
index 0000000..b1eb229
--- /dev/null
@@ -0,0 +1,3 @@
+// generated file; do not modify
+#include "all.qh"
+#include "effectinfo.qh"
diff --git a/qcsrc/common/effects/qc/_mod.qh b/qcsrc/common/effects/qc/_mod.qh
new file mode 100644 (file)
index 0000000..5333ac7
--- /dev/null
@@ -0,0 +1,8 @@
+// generated file; do not modify
+#include "all.qh"
+#include "casings.qh"
+#include "damageeffects.qh"
+#include "gibs.qh"
+#include "globalsound.qh"
+#include "lightningarc.qh"
+#include "modeleffects.qh"
diff --git a/qcsrc/common/gamemodes/_mod.qh b/qcsrc/common/gamemodes/_mod.qh
new file mode 100644 (file)
index 0000000..56565b0
--- /dev/null
@@ -0,0 +1,2 @@
+// generated file; do not modify
+#include "all.qh"
diff --git a/qcsrc/common/gamemodes/gamemode/_mod.qh b/qcsrc/common/gamemodes/gamemode/_mod.qh
new file mode 100644 (file)
index 0000000..98fb481
--- /dev/null
@@ -0,0 +1 @@
+// generated file; do not modify
diff --git a/qcsrc/common/gamemodes/gamemode/nexball/_mod.qh b/qcsrc/common/gamemodes/gamemode/nexball/_mod.qh
new file mode 100644 (file)
index 0000000..dff00b4
--- /dev/null
@@ -0,0 +1,3 @@
+// generated file; do not modify
+#include "nexball.qh"
+#include "weapon.qh"
diff --git a/qcsrc/common/gamemodes/gamemode/onslaught/_mod.qh b/qcsrc/common/gamemodes/gamemode/onslaught/_mod.qh
new file mode 100644 (file)
index 0000000..235bc76
--- /dev/null
@@ -0,0 +1,6 @@
+// generated file; do not modify
+#include "cl_controlpoint.qh"
+#include "cl_generator.qh"
+#include "onslaught.qh"
+#include "sv_controlpoint.qh"
+#include "sv_generator.qh"
diff --git a/qcsrc/common/impulses/_mod.qh b/qcsrc/common/impulses/_mod.qh
new file mode 100644 (file)
index 0000000..56565b0
--- /dev/null
@@ -0,0 +1,2 @@
+// generated file; do not modify
+#include "all.qh"
diff --git a/qcsrc/common/items/_mod.qh b/qcsrc/common/items/_mod.qh
new file mode 100644 (file)
index 0000000..56565b0
--- /dev/null
@@ -0,0 +1,2 @@
+// generated file; do not modify
+#include "all.qh"
diff --git a/qcsrc/common/items/item/_mod.qh b/qcsrc/common/items/item/_mod.qh
new file mode 100644 (file)
index 0000000..e2c7d1b
--- /dev/null
@@ -0,0 +1,7 @@
+// generated file; do not modify
+#include "ammo.qh"
+#include "armor.qh"
+#include "health.qh"
+#include "jetpack.qh"
+#include "pickup.qh"
+#include "powerup.qh"
index 47690d32b9358f6b45d811f59f687ba6c288c90d..98f44b70491476b78c2b8a12b9110352576475f4 100644 (file)
@@ -1,5 +1,9 @@
 // generated file; do not modify
-#include "cl_minigames.qc"
 #include "cl_minigames_hud.qc"
 #include "minigames.qc"
-#include "sv_minigames.qc"
+#ifdef CSQC
+    #include "cl_minigames.qc"
+#endif
+#ifdef SVQC
+    #include "sv_minigames.qc"
+#endif
diff --git a/qcsrc/common/minigames/_mod.qh b/qcsrc/common/minigames/_mod.qh
new file mode 100644 (file)
index 0000000..db3da28
--- /dev/null
@@ -0,0 +1,3 @@
+// generated file; do not modify
+#include "cl_minigames_hud.qh"
+#include "minigames.qh"
diff --git a/qcsrc/common/minigames/minigame/_mod.qh b/qcsrc/common/minigames/minigame/_mod.qh
new file mode 100644 (file)
index 0000000..6808360
--- /dev/null
@@ -0,0 +1,9 @@
+// generated file; do not modify
+#include "bd.qh"
+#include "c4.qh"
+#include "nmm.qh"
+#include "pong.qh"
+#include "pp.qh"
+#include "ps.qh"
+#include "snake.qh"
+#include "ttt.qh"
diff --git a/qcsrc/common/models/_mod.qh b/qcsrc/common/models/_mod.qh
new file mode 100644 (file)
index 0000000..98fb481
--- /dev/null
@@ -0,0 +1 @@
+// generated file; do not modify
diff --git a/qcsrc/common/monsters/_mod.qh b/qcsrc/common/monsters/_mod.qh
new file mode 100644 (file)
index 0000000..88114f7
--- /dev/null
@@ -0,0 +1,4 @@
+// generated file; do not modify
+#include "all.qh"
+#include "spawn.qh"
+#include "sv_monsters.qh"
diff --git a/qcsrc/common/monsters/monster/_mod.qh b/qcsrc/common/monsters/monster/_mod.qh
new file mode 100644 (file)
index 0000000..0802f6e
--- /dev/null
@@ -0,0 +1,6 @@
+// generated file; do not modify
+#include "mage.qh"
+#include "shambler.qh"
+#include "spider.qh"
+#include "wyvern.qh"
+#include "zombie.qh"
diff --git a/qcsrc/common/mutators/_mod.qh b/qcsrc/common/mutators/_mod.qh
new file mode 100644 (file)
index 0000000..56565b0
--- /dev/null
@@ -0,0 +1,2 @@
+// generated file; do not modify
+#include "all.qh"
index 4d92b5d40578c111b334ace23da86b39f560a60e..c1f7501c9bc5528536590c5e3b9cd4082e2afd9c 100644 (file)
@@ -120,9 +120,10 @@ ENDCLASS(CallbackChain)
 void RegisterHooks() {};
 void RegisterCallbacks() {};
 
-#define _MUTATOR_HOOKABLE(id, ...) CallbackChain HOOK_##id; bool __Mutator_Send_##id(__VA_ARGS__)
-#define MUTATOR_HOOKABLE(id, params) \
-    _MUTATOR_HOOKABLE(id, int params(_MUTATOR_HANDLE_PARAMS, _MUTATOR_HANDLE_NOP)) { \
+#define MUTATOR_HOOKABLE(id, params) _MUTATOR_HOOKABLE(id, params)
+#define _MUTATOR_HOOKABLE(id, params) \
+    CallbackChain HOOK_##id;  \
+    bool __Mutator_Send_##id(int params(_MUTATOR_HANDLE_PARAMS, _MUTATOR_HANDLE_NOP)) { \
         params(_MUTATOR_HANDLE_PUSHTMP, _MUTATOR_HANDLE_NOP) \
         params(_MUTATOR_HANDLE_PREPARE, _MUTATOR_HANDLE_NOP) \
         bool ret = CallbackChain_Call(HOOK_##id); \
@@ -132,10 +133,12 @@ void RegisterCallbacks() {};
         return ret; \
     } \
     [[accumulate]] void RegisterHooks() { HOOK_##id = NEW(CallbackChain, #id); }
+
+#define MUTATOR_CALLHOOK(id, ...) _MUTATOR_CALLHOOK(id, __VA_ARGS__)
 #ifdef __STDC__
-    #define MUTATOR_CALLHOOK(id, ...) APPLY(__Mutator_Send_##id, 0 P99_IF_EMPTY(__VA_ARGS__)()(, __VA_ARGS__))
+    #define _MUTATOR_CALLHOOK(id, ...) APPLY(__Mutator_Send_##id, 0 P99_IF_EMPTY(__VA_ARGS__)()(, __VA_ARGS__))
 #else
-    #define MUTATOR_CALLHOOK(id, ...) APPLY(__Mutator_Send_##id, 0, ##__VA_ARGS__)
+    #define _MUTATOR_CALLHOOK(id, ...) APPLY(__Mutator_Send_##id, 0, ##__VA_ARGS__)
 #endif
 
 enum {
diff --git a/qcsrc/common/mutators/mutator/_mod.qh b/qcsrc/common/mutators/mutator/_mod.qh
new file mode 100644 (file)
index 0000000..beb4356
--- /dev/null
@@ -0,0 +1,2 @@
+// generated file; do not modify
+#include "itemstime.qh"
diff --git a/qcsrc/common/mutators/mutator/bloodloss/_mod.qh b/qcsrc/common/mutators/mutator/bloodloss/_mod.qh
new file mode 100644 (file)
index 0000000..d1fcbb9
--- /dev/null
@@ -0,0 +1,2 @@
+// generated file; do not modify
+#include "bloodloss.qh"
diff --git a/qcsrc/common/mutators/mutator/breakablehook/_mod.qh b/qcsrc/common/mutators/mutator/breakablehook/_mod.qh
new file mode 100644 (file)
index 0000000..abd9612
--- /dev/null
@@ -0,0 +1,2 @@
+// generated file; do not modify
+#include "breakablehook.qh"
diff --git a/qcsrc/common/mutators/mutator/buffs/_mod.qh b/qcsrc/common/mutators/mutator/buffs/_mod.qh
new file mode 100644 (file)
index 0000000..17f5952
--- /dev/null
@@ -0,0 +1,3 @@
+// generated file; do not modify
+#include "all.qh"
+#include "buffs.qh"
diff --git a/qcsrc/common/mutators/mutator/bugrigs/_mod.qh b/qcsrc/common/mutators/mutator/bugrigs/_mod.qh
new file mode 100644 (file)
index 0000000..5c4aa00
--- /dev/null
@@ -0,0 +1,2 @@
+// generated file; do not modify
+#include "bugrigs.qh"
diff --git a/qcsrc/common/mutators/mutator/campcheck/_mod.qh b/qcsrc/common/mutators/mutator/campcheck/_mod.qh
new file mode 100644 (file)
index 0000000..fd05c7e
--- /dev/null
@@ -0,0 +1,2 @@
+// generated file; do not modify
+#include "campcheck.qh"
diff --git a/qcsrc/common/mutators/mutator/cloaked/_mod.qh b/qcsrc/common/mutators/mutator/cloaked/_mod.qh
new file mode 100644 (file)
index 0000000..ee9bf7e
--- /dev/null
@@ -0,0 +1,2 @@
+// generated file; do not modify
+#include "cloaked.qh"
diff --git a/qcsrc/common/mutators/mutator/damagetext/_mod.qh b/qcsrc/common/mutators/mutator/damagetext/_mod.qh
new file mode 100644 (file)
index 0000000..1c608e3
--- /dev/null
@@ -0,0 +1,2 @@
+// generated file; do not modify
+#include "damagetext.qh"
diff --git a/qcsrc/common/mutators/mutator/dodging/_mod.qh b/qcsrc/common/mutators/mutator/dodging/_mod.qh
new file mode 100644 (file)
index 0000000..cdaf3d0
--- /dev/null
@@ -0,0 +1,2 @@
+// generated file; do not modify
+#include "dodging.qh"
diff --git a/qcsrc/common/mutators/mutator/doublejump/_mod.qh b/qcsrc/common/mutators/mutator/doublejump/_mod.qh
new file mode 100644 (file)
index 0000000..90e06da
--- /dev/null
@@ -0,0 +1,2 @@
+// generated file; do not modify
+#include "doublejump.qh"
diff --git a/qcsrc/common/mutators/mutator/hook/_mod.qh b/qcsrc/common/mutators/mutator/hook/_mod.qh
new file mode 100644 (file)
index 0000000..3d46a37
--- /dev/null
@@ -0,0 +1,2 @@
+// generated file; do not modify
+#include "hook.qh"
diff --git a/qcsrc/common/mutators/mutator/instagib/_mod.qh b/qcsrc/common/mutators/mutator/instagib/_mod.qh
new file mode 100644 (file)
index 0000000..ce3e4d1
--- /dev/null
@@ -0,0 +1,3 @@
+// generated file; do not modify
+#include "instagib.qh"
+#include "items.qh"
diff --git a/qcsrc/common/mutators/mutator/invincibleproj/_mod.qh b/qcsrc/common/mutators/mutator/invincibleproj/_mod.qh
new file mode 100644 (file)
index 0000000..aad5200
--- /dev/null
@@ -0,0 +1,2 @@
+// generated file; do not modify
+#include "invincibleproj.qh"
diff --git a/qcsrc/common/mutators/mutator/melee_only/_mod.qh b/qcsrc/common/mutators/mutator/melee_only/_mod.qh
new file mode 100644 (file)
index 0000000..ea508c7
--- /dev/null
@@ -0,0 +1,2 @@
+// generated file; do not modify
+#include "melee_only.qh"
diff --git a/qcsrc/common/mutators/mutator/midair/_mod.qh b/qcsrc/common/mutators/mutator/midair/_mod.qh
new file mode 100644 (file)
index 0000000..718da86
--- /dev/null
@@ -0,0 +1,2 @@
+// generated file; do not modify
+#include "midair.qh"
diff --git a/qcsrc/common/mutators/mutator/multijump/_mod.qh b/qcsrc/common/mutators/mutator/multijump/_mod.qh
new file mode 100644 (file)
index 0000000..82884cb
--- /dev/null
@@ -0,0 +1,2 @@
+// generated file; do not modify
+#include "multijump.qh"
diff --git a/qcsrc/common/mutators/mutator/nades/_mod.qh b/qcsrc/common/mutators/mutator/nades/_mod.qh
new file mode 100644 (file)
index 0000000..9871ce4
--- /dev/null
@@ -0,0 +1,3 @@
+// generated file; do not modify
+#include "nades.qh"
+#include "net.qh"
diff --git a/qcsrc/common/mutators/mutator/new_toys/_mod.qh b/qcsrc/common/mutators/mutator/new_toys/_mod.qh
new file mode 100644 (file)
index 0000000..65bce7d
--- /dev/null
@@ -0,0 +1,2 @@
+// generated file; do not modify
+#include "new_toys.qh"
diff --git a/qcsrc/common/mutators/mutator/nix/_mod.qh b/qcsrc/common/mutators/mutator/nix/_mod.qh
new file mode 100644 (file)
index 0000000..c97e58e
--- /dev/null
@@ -0,0 +1,2 @@
+// generated file; do not modify
+#include "nix.qh"
diff --git a/qcsrc/common/mutators/mutator/overkill/_mod.qh b/qcsrc/common/mutators/mutator/overkill/_mod.qh
new file mode 100644 (file)
index 0000000..54b55f9
--- /dev/null
@@ -0,0 +1,4 @@
+// generated file; do not modify
+#include "hmg.qh"
+#include "overkill.qh"
+#include "rpc.qh"
diff --git a/qcsrc/common/mutators/mutator/physical_items/_mod.qh b/qcsrc/common/mutators/mutator/physical_items/_mod.qh
new file mode 100644 (file)
index 0000000..4b54835
--- /dev/null
@@ -0,0 +1,2 @@
+// generated file; do not modify
+#include "physical_items.qh"
diff --git a/qcsrc/common/mutators/mutator/pinata/_mod.qh b/qcsrc/common/mutators/mutator/pinata/_mod.qh
new file mode 100644 (file)
index 0000000..b1e3d12
--- /dev/null
@@ -0,0 +1,2 @@
+// generated file; do not modify
+#include "pinata.qh"
diff --git a/qcsrc/common/mutators/mutator/random_gravity/_mod.qh b/qcsrc/common/mutators/mutator/random_gravity/_mod.qh
new file mode 100644 (file)
index 0000000..83e6641
--- /dev/null
@@ -0,0 +1,2 @@
+// generated file; do not modify
+#include "random_gravity.qh"
diff --git a/qcsrc/common/mutators/mutator/rocketflying/_mod.qh b/qcsrc/common/mutators/mutator/rocketflying/_mod.qh
new file mode 100644 (file)
index 0000000..96e1d2d
--- /dev/null
@@ -0,0 +1,2 @@
+// generated file; do not modify
+#include "rocketflying.qh"
diff --git a/qcsrc/common/mutators/mutator/rocketminsta/_mod.qh b/qcsrc/common/mutators/mutator/rocketminsta/_mod.qh
new file mode 100644 (file)
index 0000000..8be2dec
--- /dev/null
@@ -0,0 +1,2 @@
+// generated file; do not modify
+#include "rocketminsta.qh"
diff --git a/qcsrc/common/mutators/mutator/running_guns/_mod.qh b/qcsrc/common/mutators/mutator/running_guns/_mod.qh
new file mode 100644 (file)
index 0000000..3d07a8b
--- /dev/null
@@ -0,0 +1,2 @@
+// generated file; do not modify
+#include "running_guns.qh"
diff --git a/qcsrc/common/mutators/mutator/sandbox/_mod.qh b/qcsrc/common/mutators/mutator/sandbox/_mod.qh
new file mode 100644 (file)
index 0000000..ac582a1
--- /dev/null
@@ -0,0 +1,2 @@
+// generated file; do not modify
+#include "sandbox.qh"
diff --git a/qcsrc/common/mutators/mutator/spawn_near_teammate/_mod.qh b/qcsrc/common/mutators/mutator/spawn_near_teammate/_mod.qh
new file mode 100644 (file)
index 0000000..192b364
--- /dev/null
@@ -0,0 +1,2 @@
+// generated file; do not modify
+#include "spawn_near_teammate.qh"
diff --git a/qcsrc/common/mutators/mutator/superspec/_mod.qh b/qcsrc/common/mutators/mutator/superspec/_mod.qh
new file mode 100644 (file)
index 0000000..93171ac
--- /dev/null
@@ -0,0 +1,2 @@
+// generated file; do not modify
+#include "superspec.qh"
diff --git a/qcsrc/common/mutators/mutator/touchexplode/_mod.qh b/qcsrc/common/mutators/mutator/touchexplode/_mod.qh
new file mode 100644 (file)
index 0000000..7014643
--- /dev/null
@@ -0,0 +1,2 @@
+// generated file; do not modify
+#include "touchexplode.qh"
diff --git a/qcsrc/common/mutators/mutator/vampire/_mod.qh b/qcsrc/common/mutators/mutator/vampire/_mod.qh
new file mode 100644 (file)
index 0000000..620c35f
--- /dev/null
@@ -0,0 +1,2 @@
+// generated file; do not modify
+#include "vampire.qh"
diff --git a/qcsrc/common/mutators/mutator/vampirehook/_mod.qh b/qcsrc/common/mutators/mutator/vampirehook/_mod.qh
new file mode 100644 (file)
index 0000000..25fcddd
--- /dev/null
@@ -0,0 +1,2 @@
+// generated file; do not modify
+#include "vampirehook.qh"
diff --git a/qcsrc/common/mutators/mutator/waypoints/_mod.qh b/qcsrc/common/mutators/mutator/waypoints/_mod.qh
new file mode 100644 (file)
index 0000000..248953a
--- /dev/null
@@ -0,0 +1,2 @@
+// generated file; do not modify
+#include "waypointsprites.qh"
diff --git a/qcsrc/common/mutators/mutator/weaponarena_random/_mod.qh b/qcsrc/common/mutators/mutator/weaponarena_random/_mod.qh
new file mode 100644 (file)
index 0000000..ad86e4e
--- /dev/null
@@ -0,0 +1,2 @@
+// generated file; do not modify
+#include "weaponarena_random.qh"
diff --git a/qcsrc/common/notifications/_mod.qh b/qcsrc/common/notifications/_mod.qh
new file mode 100644 (file)
index 0000000..56565b0
--- /dev/null
@@ -0,0 +1,2 @@
+// generated file; do not modify
+#include "all.qh"
diff --git a/qcsrc/common/physics/_mod.qh b/qcsrc/common/physics/_mod.qh
new file mode 100644 (file)
index 0000000..984ab7a
--- /dev/null
@@ -0,0 +1,3 @@
+// generated file; do not modify
+#include "movelib.qh"
+#include "player.qh"
diff --git a/qcsrc/common/physics/movetypes/_mod.qh b/qcsrc/common/physics/movetypes/_mod.qh
new file mode 100644 (file)
index 0000000..ca84318
--- /dev/null
@@ -0,0 +1,7 @@
+// generated file; do not modify
+#include "follow.qh"
+#include "movetypes.qh"
+#include "push.qh"
+#include "step.qh"
+#include "toss.qh"
+#include "walk.qh"
diff --git a/qcsrc/common/sounds/_mod.qh b/qcsrc/common/sounds/_mod.qh
new file mode 100644 (file)
index 0000000..56565b0
--- /dev/null
@@ -0,0 +1,2 @@
+// generated file; do not modify
+#include "all.qh"
diff --git a/qcsrc/common/triggers/_mod.qh b/qcsrc/common/triggers/_mod.qh
new file mode 100644 (file)
index 0000000..e32f7a6
--- /dev/null
@@ -0,0 +1,6 @@
+// generated file; do not modify
+#include "include.qh"
+#include "platforms.qh"
+#include "subs.qh"
+#include "teleporters.qh"
+#include "triggers.qh"
diff --git a/qcsrc/common/triggers/func/_mod.qh b/qcsrc/common/triggers/func/_mod.qh
new file mode 100644 (file)
index 0000000..f6fb323
--- /dev/null
@@ -0,0 +1,19 @@
+// generated file; do not modify
+#include "bobbing.qh"
+#include "breakable.qh"
+#include "button.qh"
+#include "conveyor.qh"
+#include "door.qh"
+#include "door_rotating.qh"
+#include "door_secret.qh"
+#include "fourier.qh"
+#include "include.qh"
+#include "ladder.qh"
+#include "pendulum.qh"
+#include "plat.qh"
+#include "pointparticles.qh"
+#include "rainsnow.qh"
+#include "rotating.qh"
+#include "stardust.qh"
+#include "train.qh"
+#include "vectormamamam.qh"
diff --git a/qcsrc/common/triggers/misc/_mod.qh b/qcsrc/common/triggers/misc/_mod.qh
new file mode 100644 (file)
index 0000000..dae21c5
--- /dev/null
@@ -0,0 +1,6 @@
+// generated file; do not modify
+#include "corner.qh"
+#include "follow.qh"
+#include "include.qh"
+#include "laser.qh"
+#include "teleport_dest.qh"
diff --git a/qcsrc/common/triggers/target/_mod.qh b/qcsrc/common/triggers/target/_mod.qh
new file mode 100644 (file)
index 0000000..0bcfa91
--- /dev/null
@@ -0,0 +1,8 @@
+// generated file; do not modify
+#include "changelevel.qh"
+#include "include.qh"
+#include "location.qh"
+#include "music.qh"
+#include "spawn.qh"
+#include "speaker.qh"
+#include "voicescript.qh"
diff --git a/qcsrc/common/triggers/trigger/_mod.qh b/qcsrc/common/triggers/trigger/_mod.qh
new file mode 100644 (file)
index 0000000..597fd2e
--- /dev/null
@@ -0,0 +1,25 @@
+// generated file; do not modify
+#include "counter.qh"
+#include "delay.qh"
+#include "disablerelay.qh"
+#include "flipflop.qh"
+#include "gamestart.qh"
+#include "gravity.qh"
+#include "heal.qh"
+#include "hurt.qh"
+#include "impulse.qh"
+#include "include.qh"
+#include "jumppads.qh"
+#include "keylock.qh"
+#include "magicear.qh"
+#include "monoflop.qh"
+#include "multi.qh"
+#include "multivibrator.qh"
+#include "relay.qh"
+#include "relay_activators.qh"
+#include "relay_if.qh"
+#include "relay_teamcheck.qh"
+#include "secret.qh"
+#include "swamp.qh"
+#include "teleport.qh"
+#include "viewloc.qh"
diff --git a/qcsrc/common/turrets/_mod.qh b/qcsrc/common/turrets/_mod.qh
new file mode 100644 (file)
index 0000000..6f9e1f7
--- /dev/null
@@ -0,0 +1,8 @@
+// generated file; do not modify
+#include "all.qh"
+#include "checkpoint.qh"
+#include "cl_turrets.qh"
+#include "config.qh"
+#include "sv_turrets.qh"
+#include "targettrigger.qh"
+#include "util.qh"
diff --git a/qcsrc/common/turrets/turret/_mod.qh b/qcsrc/common/turrets/turret/_mod.qh
new file mode 100644 (file)
index 0000000..96b858b
--- /dev/null
@@ -0,0 +1,23 @@
+// generated file; do not modify
+#include "ewheel.qh"
+#include "ewheel_weapon.qh"
+#include "flac.qh"
+#include "flac_weapon.qh"
+#include "fusionreactor.qh"
+#include "hellion.qh"
+#include "hellion_weapon.qh"
+#include "hk.qh"
+#include "hk_weapon.qh"
+#include "machinegun.qh"
+#include "machinegun_weapon.qh"
+#include "mlrs.qh"
+#include "mlrs_weapon.qh"
+#include "phaser.qh"
+#include "phaser_weapon.qh"
+#include "plasma.qh"
+#include "plasma_dual.qh"
+#include "plasma_weapon.qh"
+#include "tesla.qh"
+#include "tesla_weapon.qh"
+#include "walker.qh"
+#include "walker_weapon.qh"
diff --git a/qcsrc/common/vehicles/_mod.qh b/qcsrc/common/vehicles/_mod.qh
new file mode 100644 (file)
index 0000000..c757035
--- /dev/null
@@ -0,0 +1,4 @@
+// generated file; do not modify
+#include "all.qh"
+#include "cl_vehicles.qh"
+#include "sv_vehicles.qh"
diff --git a/qcsrc/common/vehicles/vehicle/_mod.qh b/qcsrc/common/vehicles/vehicle/_mod.qh
new file mode 100644 (file)
index 0000000..d6cf435
--- /dev/null
@@ -0,0 +1,9 @@
+// generated file; do not modify
+#include "bumblebee.qh"
+#include "bumblebee_weapons.qh"
+#include "racer.qh"
+#include "racer_weapon.qh"
+#include "raptor.qh"
+#include "raptor_weapons.qh"
+#include "spiderbot.qh"
+#include "spiderbot_weapons.qh"
diff --git a/qcsrc/common/weapons/_mod.qh b/qcsrc/common/weapons/_mod.qh
new file mode 100644 (file)
index 0000000..fce18fb
--- /dev/null
@@ -0,0 +1,4 @@
+// generated file; do not modify
+#include "all.qh"
+#include "calculations.qh"
+#include "config.qh"
diff --git a/qcsrc/common/weapons/weapon/_mod.qh b/qcsrc/common/weapons/weapon/_mod.qh
new file mode 100644 (file)
index 0000000..34517c4
--- /dev/null
@@ -0,0 +1,21 @@
+// generated file; do not modify
+#include "arc.qh"
+#include "blaster.qh"
+#include "crylink.qh"
+#include "devastator.qh"
+#include "electro.qh"
+#include "fireball.qh"
+#include "hagar.qh"
+#include "hlac.qh"
+#include "hook.qh"
+#include "machinegun.qh"
+#include "minelayer.qh"
+#include "mortar.qh"
+#include "porto.qh"
+#include "rifle.qh"
+#include "seeker.qh"
+#include "shockwave.qh"
+#include "shotgun.qh"
+#include "tuba.qh"
+#include "vaporizer.qh"
+#include "vortex.qh"
index d279ced478d0c48df33ffc0cc8e43837687c73ee..df87b12d89910ec0fed569b7d3a0ce3be93a9404 100644 (file)
@@ -18,7 +18,7 @@
 bool CSQC_InputEvent(int eventtype, int x, int y);
 
 void CSQC_UpdateView(int width, int height);
-bool CSQC_ConsoleCommand(string cmd);
+bool CSQC_ConsoleCommand(string cmd);  // catch commands registered with registercommand
 bool CSQC_Parse_TempEntity();
 bool CSQC_Parse_StuffCmd(string msg);
 bool CSQC_Parse_Print(string msg);
@@ -229,3 +229,85 @@ void URI_Get_Callback(int id, int status, string data);
 void GameCommand(string cmd);
 
 ```
+
+# Misc
+
+## Trace
+
+### tracebox
+
+    void tracebox(vector v1, vector min, vector max, vector v2, int tryents, entity ignoreentity);
+
+attempt to move an object from v1 to v2 of given size
+
+tryents:
+ * MOVE_NORMAL (0)
+ * MOVE_NOMONSTERS (1): ignore monsters
+ * MOVE_MISSILE (2): +15 to every extent
+ * MOVE_WORLDONLY (3): ignore everything except bsp
+ * MOVE_HITMODEL (4): hit model, not bbox
+
+### traceline
+
+    void traceline(vector v1, vector v2, int tryents, entity ignoreentity);
+
+degenerate case of tracebox when min and max are equal
+
+### result globals
+
+    bool trace_allsolid;
+
+trace never left solid
+
+    bool trace_startsolid;
+
+trace started inside solid
+
+    float trace_fraction;
+
+distance before collision: 0..1, 1 if no collision
+
+    vector trace_endpos;
+
+v1 + (v2 - v1) * trace_fraction
+
+    vector trace_plane_normal;
+
+normalized plane normal, '0 0 0' if no collision.
+May be present if edges touch without clipping, use `trace_fraction < 1` as a determinant instead
+
+    float trace_plane_dist;
+
+
+
+    entity trace_ent;
+
+entity hit, if any
+
+    bool trace_inopen;
+
+
+
+    bool trace_inwater;
+
+
+
+    int trace_dpstartcontents;
+
+DPCONTENTS_ value at start position of trace
+
+    int trace_dphitcontents;
+
+DPCONTENTS_ value of impacted surface (not contents at impact point, just contents of the surface that was hit)
+
+    int trace_dphitq3surfaceflags;
+
+Q3SURFACEFLAG_ value of impacted surface
+
+    string trace_dphittexturename;
+
+texture name of impacted surface
+
+    int trace_networkentity;
+
+
diff --git a/qcsrc/ecs/README.md b/qcsrc/ecs/README.md
new file mode 100644 (file)
index 0000000..1c75d95
--- /dev/null
@@ -0,0 +1,48 @@
+# Xonotic entity component system
+
+## guidelines
+
+* avoid #if and #ifdef
+* avoid string
+* avoid declaring entity fields outside of components
+* uncrustify relentlessly
+* shared code in $file, prog specific code uses prefix: { client: cl_, server: sv_, menu: ui_ }. $file must exist
+* component naming =~ com_$component_$name
+* system naming =~ sys_$system_$name
+* event naming =~ evt_$component_$name
+* global naming =~ g_$name
+* cvar naming =~ xon_$name
+
+## components
+
+    COMPONENT($component);
+    .float com_$component_$property;
+
+## entities
+
+    entity e = new(foo);
+    e.com_$component = true;
+    e.com_$component_$property = 42;
+
+## systems
+
+    SYSTEM($system);
+    sys_$system_update(entity, dt) {
+        code;
+    }
+
+## events
+
+### declaring
+
+    EVENT($component_$name, (entity this));
+
+### emitting
+
+    emit($event, it);
+
+### listening
+
+    entity listener = new_pure(someListener);
+    listener.evt_$event = void(entity this) { code; };
+    subscribe(listener, $event);
diff --git a/qcsrc/ecs/_lib.inc b/qcsrc/ecs/_lib.inc
new file mode 100644 (file)
index 0000000..d151fb6
--- /dev/null
@@ -0,0 +1,46 @@
+#define COMPONENT(com) \
+       void com_##com##_interpolate(entity it, float a); \
+       .bool com_##com
+
+#define FOREACH_COMPONENT(com, body) FOREACH_ENTITY_FLOAT(com_##com, true, body)
+
+
+#define EVENT(T, args) .bool evt_##T##_listener; .void args evt_##T
+
+#define emit(T, ...) \
+       MACRO_BEGIN \
+       FOREACH_ENTITY_FLOAT_ORDERED(evt_##T##_listener, true, it.evt_##T(__VA_ARGS__)); \
+       MACRO_END
+
+#define subscribe(listener, T) \
+       MACRO_BEGIN \
+       listener.evt_##T##_listener = true; \
+       MACRO_END
+
+
+#define SYSTEM(sys, fps) \
+       void sys_##sys##_update(entity this, float dt); \
+       float autocvar_xon_sys_##sys##_dt = 1 / (fps)
+
+#define SYSTEM_UPDATE(sys, minfps) \
+       MACRO_BEGIN \
+       static float t = 0; \
+       float dt = autocvar_xon_sys_##sys##_dt; \
+       static float accumulator = 0; \
+       accumulator += min(frametime, 1 / (minfps)); \
+       while (accumulator >= dt) \
+       { \
+               time = t; \
+               FOREACH_COMPONENT(sys, sys_##sys##_update(it, dt)); \
+               t += dt; \
+               accumulator -= dt; \
+       } \
+       float a = accumulator / dt; \
+       FOREACH_COMPONENT(sys, com_##sys##_interpolate(it, a)); \
+       MACRO_END
+
+
+#include "_mod.inc"
+#include "components/_mod.inc"
+#include "events/_mod.inc"
+#include "systems/_mod.inc"
diff --git a/qcsrc/ecs/_mod.inc b/qcsrc/ecs/_mod.inc
new file mode 100644 (file)
index 0000000..dd98e07
--- /dev/null
@@ -0,0 +1,5 @@
+// generated file; do not modify
+#include "main.qc"
+#ifdef CSQC
+    #include "cl_main.qc"
+#endif
diff --git a/qcsrc/ecs/_mod.qh b/qcsrc/ecs/_mod.qh
new file mode 100644 (file)
index 0000000..ab00e52
--- /dev/null
@@ -0,0 +1,2 @@
+// generated file; do not modify
+#include "main.qh"
diff --git a/qcsrc/ecs/cl_main.qc b/qcsrc/ecs/cl_main.qc
new file mode 100644 (file)
index 0000000..6064f7d
--- /dev/null
@@ -0,0 +1,41 @@
+#include "components/_mod.qh"
+
+#if !XONOTIC
+       entity me;
+
+       void CSQC_Init()
+       {
+               entity it = me = spawn();
+               it.mins = '-16 -16 -24';
+               it.maxs = '+16 +16 +45';
+               it.com_phys = true;
+               it.com_phys_nogravityonground = true;
+               it.com_phys_stepheight = 31;
+               it.com_phys_jumpvel = 260;
+               it.com_phys_friction = 6;
+               it.com_phys_gravity = 800;
+       }
+
+       void CSQC_UpdateView(float w, float h)
+       {
+               entity it = me;
+               it.com_in_move = input_movevalues;
+               it.com_in_angles = input_angles;
+               it.com_in_jump = input_buttons & BIT(1);
+               makevectors(it.com_in_angles);
+               vector dir = normalize(it.com_in_move);
+               vector upvec = '0 0 1';
+               vector vel = (v_forward * dir.x + v_right * dir.y + upvec * dir.z);
+               vel = vec_reflect(vel, upvec, 0);
+               vel = normalize(vel);
+               vel *= 360 * frametime * 8;
+               it.com_phys_vel += vel;
+
+               systems_update();
+
+               setproperty(VF_ORIGIN, it.origin + '0 0 35');
+               addentities(MASK_NORMAL);  // .drawmask
+               renderscene();
+               clearscene();
+       }
+#endif
diff --git a/qcsrc/ecs/components/_mod.inc b/qcsrc/ecs/components/_mod.inc
new file mode 100644 (file)
index 0000000..d587dbe
--- /dev/null
@@ -0,0 +1,3 @@
+// generated file; do not modify
+#include "input.qc"
+#include "physics.qc"
diff --git a/qcsrc/ecs/components/_mod.qh b/qcsrc/ecs/components/_mod.qh
new file mode 100644 (file)
index 0000000..31478fa
--- /dev/null
@@ -0,0 +1,3 @@
+// generated file; do not modify
+#include "input.qh"
+#include "physics.qh"
diff --git a/qcsrc/ecs/components/input.qc b/qcsrc/ecs/components/input.qc
new file mode 100644 (file)
index 0000000..0da3f91
--- /dev/null
@@ -0,0 +1 @@
+#include "input.qh"
diff --git a/qcsrc/ecs/components/input.qh b/qcsrc/ecs/components/input.qh
new file mode 100644 (file)
index 0000000..37944ca
--- /dev/null
@@ -0,0 +1,6 @@
+#pragma once
+
+COMPONENT(in);
+.vector com_in_move;
+.vector com_in_angles;
+.bool   com_in_jump;
diff --git a/qcsrc/ecs/components/physics.qc b/qcsrc/ecs/components/physics.qc
new file mode 100644 (file)
index 0000000..bfca3d1
--- /dev/null
@@ -0,0 +1,10 @@
+#include "physics.qh"
+
+bool autocvar_xon_com_phys_interpolate = true;
+
+void com_phys_interpolate(entity it, float a)
+{
+       if (!autocvar_xon_com_phys_interpolate) a = 1;
+       it.origin = it.com_phys_pos * a + it.com_phys_pos_prev * (1 - a);
+       // TODO: orientation (slerp it)
+}
diff --git a/qcsrc/ecs/components/physics.qh b/qcsrc/ecs/components/physics.qh
new file mode 100644 (file)
index 0000000..92dae4c
--- /dev/null
@@ -0,0 +1,15 @@
+#pragma once
+
+COMPONENT(phys);
+.vector com_phys_pos;
+.vector com_phys_pos_prev;
+.vector com_phys_vel;
+.vector com_phys_acc;
+
+.bool   com_phys_grounded;
+.bool   com_phys_nogravityonground;
+.float  com_phys_stepheight;
+.float  com_phys_jumpvel;
+.float  com_phys_bounce;
+.float  com_phys_friction;
+.float  com_phys_gravity;
diff --git a/qcsrc/ecs/events/_mod.inc b/qcsrc/ecs/events/_mod.inc
new file mode 100644 (file)
index 0000000..a2a9d2d
--- /dev/null
@@ -0,0 +1,2 @@
+// generated file; do not modify
+#include "physics.qc"
diff --git a/qcsrc/ecs/events/_mod.qh b/qcsrc/ecs/events/_mod.qh
new file mode 100644 (file)
index 0000000..d7133fa
--- /dev/null
@@ -0,0 +1,2 @@
+// generated file; do not modify
+#include "physics.qh"
diff --git a/qcsrc/ecs/events/physics.qc b/qcsrc/ecs/events/physics.qc
new file mode 100644 (file)
index 0000000..909f45c
--- /dev/null
@@ -0,0 +1 @@
+#include "physics.qh"
diff --git a/qcsrc/ecs/events/physics.qh b/qcsrc/ecs/events/physics.qh
new file mode 100644 (file)
index 0000000..99e75d3
--- /dev/null
@@ -0,0 +1,4 @@
+#pragma once
+
+EVENT(phys_stepfall, (entity this));
+EVENT(phys_stepland, (entity this));
diff --git a/qcsrc/ecs/main.qc b/qcsrc/ecs/main.qc
new file mode 100644 (file)
index 0000000..e30b704
--- /dev/null
@@ -0,0 +1,12 @@
+#include "main.qh"
+
+#include "components/_mod.qh"
+#include "events/_mod.qh"
+#include "systems/_mod.qh"
+
+void systems_update()
+{
+       float realtime = time;
+       SYSTEM_UPDATE(phys, 10);
+       time = realtime;
+}
diff --git a/qcsrc/ecs/main.qh b/qcsrc/ecs/main.qh
new file mode 100644 (file)
index 0000000..9b7bf35
--- /dev/null
@@ -0,0 +1,3 @@
+#pragma once
+
+void systems_update();
diff --git a/qcsrc/ecs/systems/_mod.inc b/qcsrc/ecs/systems/_mod.inc
new file mode 100644 (file)
index 0000000..a2a9d2d
--- /dev/null
@@ -0,0 +1,2 @@
+// generated file; do not modify
+#include "physics.qc"
diff --git a/qcsrc/ecs/systems/_mod.qh b/qcsrc/ecs/systems/_mod.qh
new file mode 100644 (file)
index 0000000..d7133fa
--- /dev/null
@@ -0,0 +1,2 @@
+// generated file; do not modify
+#include "physics.qh"
diff --git a/qcsrc/ecs/systems/physics.qc b/qcsrc/ecs/systems/physics.qc
new file mode 100644 (file)
index 0000000..f4cefc2
--- /dev/null
@@ -0,0 +1,155 @@
+#include "physics.qh"
+
+const int PHYSICS_TRACE_PLANE_MAX = 5;
+
+// NOTE: currently unsuitable for players
+void sys_phys_update(entity this, float dt)
+{
+       // x: { 60: 0.5, 45: ~0.7, 30: ~0.9 }, from: 'vec2(0, 1) * vec2(cos(90 - x), sin(90 - x))'
+       // read as 'within x degrees'
+       float maxgrounddot = 0.5;
+       float maxstepdot = 0.7;
+       vector upvec = '0 0 1';
+       float groundsnap = 1;
+       bool jump = this.com_in_jump;
+       bool jumpstep = true;
+
+       vector mn = this.mins;
+       vector mx = this.maxs;
+
+       vector acc = this.com_phys_acc;
+       vector vel = this.com_phys_vel;
+       vector pos = this.com_phys_pos_prev = this.com_phys_pos;
+       bool onground = this.com_phys_grounded;
+
+       bool nogravityonground = this.com_phys_nogravityonground;
+       float stepheight = this.com_phys_stepheight;
+       float stepdownheight = -stepheight;
+       float jumpvel = this.com_phys_jumpvel;
+       float bounce = this.com_phys_bounce;
+       float friction = this.com_phys_friction;
+       float gravity = this.com_phys_gravity;
+
+       vector g = upvec * -gravity;
+
+       // apply accelaration in two steps: https://www.niksula.hut.fi/~hkankaan/Homepages/gravity.html
+       // alternatives: rk4, verlet, euler
+       vel += (acc + g) * dt / 2;
+       {
+               if (onground)
+               {
+                       if (nogravityonground)
+                       {
+                g = '0 0 0';
+                           if (vel * upvec < 0) vel = vec_reflect(vel, upvec, 0);  // kill downward velocity
+                       }
+                       if (jump)
+                       {
+                               vel += upvec * jumpvel;
+                       }
+                       else  // the first landing frame is free
+                       {
+                               // friction
+                               vector slide = vec_reflect(vel, upvec, 0);
+                               vector push = vel - slide;
+                               // TODO: slick
+                               slide *= 1 - friction * dt;
+                               vel = slide + push;
+                       }
+               }
+               vector step = vel * dt;
+               bool pass = false;
+               bool foundground = false;                  // assume until proven otherwise
+               if (nogravityonground) foundground = true; // override
+               bool steplimit = 1;
+               for (int i = 0; i < PHYSICS_TRACE_PLANE_MAX; ++i)
+               {
+                       vector p0 = pos;
+                       vector p1 = p0 + step;
+                       tracebox(p0, mn, mx, p1, MOVE_NORMAL, this);
+                       float frac = trace_fraction;
+                       vector norm = trace_plane_normal;
+                       if (frac == 1)
+                       {
+                               // all clear
+                               if (steplimit > 0 && onground && vel * upvec <= 0)
+                               {
+                                       // can we step down?
+                                       tracebox(p1, mn, mx, p1 + upvec * stepdownheight, MOVE_NORMAL, this);
+                                       if (trace_fraction == 1)
+                                       {
+                                               // no stairs here
+                                       }
+                                       else if (trace_plane_normal * upvec >= maxstepdot)
+                                       {
+                                               // step down
+                                               step += upvec * (stepdownheight * trace_fraction);
+                                       }
+                               }
+                               pass = true;
+                               break;
+                       }
+                       // hit something
+                       if (norm * upvec >= maxgrounddot) foundground = true;
+                       if (steplimit > 0 && (jumpstep || onground))    // try: vel * upvec >= 0
+                       {
+                               // can we step up?
+                               vector slide = vec_reflect(step, upvec, 0); // remove fall component
+                               vector p1 = p0 + slide;                     // step is here
+                               tracebox(p1 + upvec * stepheight, mn, mx, p1, MOVE_NORMAL, this);
+                               if (trace_fraction < 1 && trace_plane_normal * upvec >= maxstepdot)
+                               {
+                                       // there is a step in front of us, get above it
+                                       // TODO: not if it's slippery (slick)
+                                       vector stepup = upvec * (1 - trace_fraction) * stepheight;
+                                       tracebox(p0, mn, mx, p0 + stepup, MOVE_NORMAL, this);
+                                       if (trace_fraction == 1)
+                                       {
+                                               // go over
+                                               tracebox(p0 + stepup, mn, mx, p1 + stepup, MOVE_NORMAL, this);
+                                               if (trace_fraction == 1)
+                                               {
+                                                       // all clear
+                                                       steplimit -= 1;
+                                                       pos += stepup;
+                                                       if (vel * upvec < 0) vel = vec_reflect(vel, upvec, 0);  // kill downward velocity
+                                                       step = p1 - p0;
+                                                       pass = true;
+                                                       break;
+                                               }
+                                       }
+                               }
+                       }
+                       // no stairs here
+                       pos += frac * step;
+                       vel = vec_reflect(vel, norm, bounce);
+                       step = (1 - frac) * vel * dt;
+                       continue;
+               }
+               if (nogravityonground)
+               {
+                       vector p1 = pos + step;
+                       tracebox(p1, mn, mx, p1 - groundsnap * upvec, MOVE_NORMAL, this);
+                       foundground = trace_plane_normal * upvec >= maxgrounddot;
+               }
+               if (pass)
+               {
+                       pos += step;
+                       if (!foundground)
+                       {
+                               if (onground) emit(phys_stepfall, this);
+                       }
+                       else
+                       {
+                               if (!onground) emit(phys_stepland, this);
+                       }
+                       onground = foundground;
+               }
+       }
+       vel += (acc + g) * dt / 2;
+
+       this.com_phys_acc = acc;
+       this.com_phys_vel = vel;
+       this.com_phys_pos = pos;
+       this.com_phys_grounded = onground;
+}
diff --git a/qcsrc/ecs/systems/physics.qh b/qcsrc/ecs/systems/physics.qh
new file mode 100644 (file)
index 0000000..29ea243
--- /dev/null
@@ -0,0 +1,3 @@
+#pragma once
+
+SYSTEM(phys, 30);
index c5e020660d3980f5f029bf97af8112b17603f6f6..ea1075a6eb593056d1d20493dd78098785f05be5 100644 (file)
 #include "macro.qh"
 
 #if NDEBUG
-    #define TC(T, sym) MACRO_BEGIN MACRO_END
+       #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
+       #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)); }
+#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"
 
@@ -104,4 +106,96 @@ void    isnt_bool(   float this) { print(ftos(this)); }
 #include "vector.qh"
 #include "yenc.qh"
 
-#include "matrix/_mod.inc"
+#ifdef MENUQC
+       void _m_init();
+       void m_init() { if (_m_init) _m_init(); }
+       #define m_init _m_init
+
+       void _m_shutdown();
+       void m_shutdown() { if (_m_shutdown) _m_shutdown(); }
+       #define m_shutdown _m_shutdown
+
+       void _m_draw(float width, float height);
+       void m_draw(float width, float height) { if (_m_draw) _m_draw(width, height); }
+       #define m_draw _m_draw
+
+       void _m_keydown(int keynr, int ascii);
+       void m_keydown(int keynr, int ascii) { if (_m_keydown) _m_keydown(keynr, ascii); }
+       #define m_keydown _m_keydown
+
+       void _m_toggle(int mode);
+       void m_toggle(int mode) { if (_m_toggle) _m_toggle(mode); }
+       #define m_toggle _m_toggle
+#endif
+
+#ifdef SVQC
+       void _main();
+       void main() { if (_main) _main(); }
+       #define main _main
+
+    void _SV_Shutdown();
+    void SV_Shutdown() { if (_SV_Shutdown) _SV_Shutdown(); }
+    #define SV_Shutdown _SV_Shutdown
+
+       void _StartFrame();
+       void StartFrame() { if (_StartFrame) _StartFrame(); }
+       #define StartFrame _StartFrame
+
+       void _SetNewParms();
+       void SetNewParms() { if (_SetNewParms) _SetNewParms(); }
+       #define SetNewParms _SetNewParms
+
+       void _SetChangeParms();
+       void SetChangeParms() { if (_SetChangeParms) _SetChangeParms(); }
+       #define SetChangeParms _SetChangeParms
+
+       void _ClientConnect();
+       void ClientConnect() { if (_ClientConnect) _ClientConnect(); }
+       #define ClientConnect _ClientConnect
+
+       void _ClientDisconnect();
+       void ClientDisconnect() { if (_ClientDisconnect) _ClientDisconnect(); }
+       #define ClientDisconnect _ClientDisconnect
+
+       void _PutClientInServer();
+       void PutClientInServer() { if (_PutClientInServer) _PutClientInServer(); }
+       #define PutClientInServer _PutClientInServer
+
+       void _ClientKill();
+       void ClientKill() { if (_ClientKill) _ClientKill(); }
+       #define ClientKill _ClientKill
+
+       void _PlayerPreThink();
+       void PlayerPreThink() { if (_PlayerPreThink) _PlayerPreThink(); }
+       #define PlayerPreThink _PlayerPreThink
+
+       void _PlayerPostThink();
+       void PlayerPostThink() { if (_PlayerPostThink) _PlayerPostThink(); }
+       #define PlayerPostThink _PlayerPostThink
+#endif
+
+#ifdef CSQC
+       void _CSQC_Init();
+       void CSQC_Init() { if (_CSQC_Init) _CSQC_Init(); }
+       #define CSQC_Init _CSQC_Init
+
+    void _CSQC_Shutdown();
+    void CSQC_Shutdown() { if (_CSQC_Shutdown) _CSQC_Shutdown(); }
+    #define CSQC_Shutdown _CSQC_Shutdown
+
+       void _CSQC_UpdateView(float w, float h);
+       void CSQC_UpdateView(float w, float h) { if (_CSQC_UpdateView) _CSQC_UpdateView(w, h); }
+       #define CSQC_UpdateView _CSQC_UpdateView
+
+       bool _CSQC_InputEvent(int inputType, float nPrimary, float nSecondary);
+       bool CSQC_InputEvent(int inputType, float nPrimary, float nSecondary)
+       {
+               return _CSQC_InputEvent ? _CSQC_InputEvent(inputType, nPrimary, nSecondary) : false;
+       }
+       #define CSQC_InputEvent _CSQC_InputEvent
+
+       bool _CSQC_ConsoleCommand(string s);
+       bool CSQC_ConsoleCommand(string s) { return _CSQC_ConsoleCommand ? _CSQC_ConsoleCommand(s) : false; }
+       #define CSQC_ConsoleCommand _CSQC_ConsoleCommand
+
+#endif
diff --git a/qcsrc/lib/_mod.qh b/qcsrc/lib/_mod.qh
new file mode 100644 (file)
index 0000000..3b4cf80
--- /dev/null
@@ -0,0 +1,8 @@
+// generated file; do not modify
+#include "angle.qh"
+#include "json.qh"
+#include "p2mathlib.qh"
+#include "random.qh"
+#include "sortlist.qh"
+#include "test.qh"
+#include "urllib.qh"
diff --git a/qcsrc/lib/csqcmodel/_mod.qh b/qcsrc/lib/csqcmodel/_mod.qh
new file mode 100644 (file)
index 0000000..5e9b472
--- /dev/null
@@ -0,0 +1,5 @@
+// generated file; do not modify
+#include "cl_model.qh"
+#include "cl_player.qh"
+#include "interpolate.qh"
+#include "sv_model.qh"
index c8d9ae8de9b4dedee783b3ac3d4f0e531cef9286..8a2dc8880a49f1ab315ceef7e97fdd79ea0c9286 100644 (file)
@@ -5,7 +5,7 @@
        #include "i18n.qh"
        #include "vector.qh"
 
-       #include <client/defs.qh>
+       noref float vid_conwidth, vid_conheight;
 
        void Draw_CylindricLine(vector from, vector to, float thickness, string texture, float aspect, float shift, vector rgb, float theAlpha, float drawflag, vector vieworg)
        {
index 809708d7439e57fc3870b47714422a653a54667c..6f08db459bab6ad55dd9f8a07a30655bf5315df1 100644 (file)
@@ -14,3 +14,6 @@
 
 #define _STR(it) #it
 #define STR(it) _STR(it)
+
+#define EMPTY()
+#define DEFER(id) id EMPTY()
diff --git a/qcsrc/lib/matrix/_mod.qh b/qcsrc/lib/matrix/_mod.qh
new file mode 100644 (file)
index 0000000..3ce2f75
--- /dev/null
@@ -0,0 +1,3 @@
+// generated file; do not modify
+#include "command.qh"
+#include "matrix.qh"
index 950000f04756ac028e77b1b2859c0fa63dcad215..21e0c5239f59aa7399533f5c35aca8c0e0c2487b 100644 (file)
@@ -1,9 +1,6 @@
 #pragma once
 
 #ifdef __STDC__
-       #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__)))
index 03e5c9dd8941d6a1143effdf28ce3290638f9333..faa24e71ae2c20f19d2f6d17f9491fbeb8d4236d 100644 (file)
@@ -266,12 +266,14 @@ STATIC_INIT(C2S_Protocol_renumber) { FOREACH(C2S_Protocol, true, it.m_id = i); }
                #define ReadInt48_t() vec3(ReadInt24_t(), ReadInt24_t(), 0)
                #define ReadInt72_t() vec3(ReadInt24_t(), ReadInt24_t(), ReadInt24_t())
 
-               int _ReadSByte;
+               noref int _ReadSByte;
                #define ReadSByte() (_ReadSByte = ReadByte(), (_ReadSByte & BIT(7) ? -128 : 0) + (_ReadSByte & BITS(7)))
                #define ReadFloat() ReadCoord()
                #define ReadVector() vec3(ReadFloat(), ReadFloat(), ReadFloat())
                #define ReadVector2D() vec3(ReadFloat(), ReadFloat(), 0)
 
+        float servertime;
+
                float ReadApproxPastTime()
                {
                        float dt = ReadByte();
index def1dae2d489f512a0c677087943814c00f8b8a7..adb6d6a95b272fdfc59f6c650e318411ad3738c3 100644 (file)
@@ -116,6 +116,14 @@ vector reflect(vector dir, vector norm)
        return dir - 2 * (dir * norm) * norm;
 }
 
+/**
+ * clip vel along the plane defined by norm (assuming 0 distance away), bounciness determined by bounce 0..1
+ */
+vector vec_reflect(vector vel, vector norm, float bounce)
+{
+       return vel - (1 + bounce) * (vel * norm) * norm;
+}
+
 #ifndef MENUQC
        vector get_corner_position(entity box, int corner)
        {
diff --git a/qcsrc/lib/warpzone/_mod.qh b/qcsrc/lib/warpzone/_mod.qh
new file mode 100644 (file)
index 0000000..8ed1a13
--- /dev/null
@@ -0,0 +1,7 @@
+// generated file; do not modify
+#include "anglestransform.qh"
+#include "client.qh"
+#include "common.qh"
+#include "mathlib.qh"
+#include "server.qh"
+#include "util_server.qh"
diff --git a/qcsrc/menu/_mod.qh b/qcsrc/menu/_mod.qh
new file mode 100644 (file)
index 0000000..02d26ad
--- /dev/null
@@ -0,0 +1,5 @@
+// generated file; do not modify
+#include "draw.qh"
+#include "item.qh"
+#include "matrix.qh"
+#include "menu.qh"
diff --git a/qcsrc/menu/anim/_mod.qh b/qcsrc/menu/anim/_mod.qh
new file mode 100644 (file)
index 0000000..dc436a9
--- /dev/null
@@ -0,0 +1,5 @@
+// generated file; do not modify
+#include "animation.qh"
+#include "animhost.qh"
+#include "easing.qh"
+#include "keyframe.qh"
diff --git a/qcsrc/menu/command/_mod.qh b/qcsrc/menu/command/_mod.qh
new file mode 100644 (file)
index 0000000..28c893a
--- /dev/null
@@ -0,0 +1,3 @@
+// generated file; do not modify
+#include "all.qh"
+#include "menu_cmd.qh"
index 283cca0c1b98b1d0c5dfc61917c00c946175c43f..2f8df96b6bfb57d773d6e237a6ad9f542c63f3a4 100644 (file)
@@ -1 +1,3 @@
+#include "all.qh"
+
 #include <common/command/all.qc>
diff --git a/qcsrc/menu/command/all.qh b/qcsrc/menu/command/all.qh
new file mode 100644 (file)
index 0000000..6f70f09
--- /dev/null
@@ -0,0 +1 @@
+#pragma once
diff --git a/qcsrc/menu/item/_mod.qh b/qcsrc/menu/item/_mod.qh
new file mode 100644 (file)
index 0000000..7dc1d1e
--- /dev/null
@@ -0,0 +1,17 @@
+// generated file; do not modify
+#include "borderimage.qh"
+#include "button.qh"
+#include "checkbox.qh"
+#include "container.qh"
+#include "dialog.qh"
+#include "image.qh"
+#include "inputbox.qh"
+#include "inputcontainer.qh"
+#include "label.qh"
+#include "listbox.qh"
+#include "modalcontroller.qh"
+#include "nexposee.qh"
+#include "radiobutton.qh"
+#include "slider.qh"
+#include "tab.qh"
+#include "textslider.qh"
index b0c4ec880c1b2da9c3bb014270f4e6fc5c2b8e80..3039b4a7d4222bda22044f2dc60c8aee5a89c7ad 100644 (file)
@@ -1,3 +1,5 @@
+#include "matrix.qh"
+
 var void MX_Handle(int buf, string ancestor)
 {
     string type = json_get(buf, strcat(ancestor, ".type"));
diff --git a/qcsrc/menu/matrix.qh b/qcsrc/menu/matrix.qh
new file mode 100644 (file)
index 0000000..6f70f09
--- /dev/null
@@ -0,0 +1 @@
+#pragma once
diff --git a/qcsrc/menu/mutators/_mod.qh b/qcsrc/menu/mutators/_mod.qh
new file mode 100644 (file)
index 0000000..98fb481
--- /dev/null
@@ -0,0 +1 @@
+// generated file; do not modify
index 57a34c36c7d9c0776876957a32968222b36e8f45..3707ec886b38aec4ee8497deacfa60a5b47158ed 100644 (file)
@@ -1,14 +1,18 @@
 #include <lib/_all.inc>
 
-#include "_mod.inc"
-#include "anim/_mod.inc"
-#include "command/_mod.inc"
-#include "item/_mod.inc"
-#include "mutators/_mod.inc"
-#include "xonotic/_mod.inc"
+#if XONOTIC
+    #include <lib/matrix/_mod.inc>
 
-#include <common/_all.inc>
+       #include "_mod.inc"
+       #include "anim/_mod.inc"
+       #include "command/_mod.inc"
+       #include "item/_mod.inc"
+       #include "mutators/_mod.inc"
+       #include "xonotic/_mod.inc"
+
+       #include <common/_all.inc>
+#endif
 
 #if BUILD_MOD
-#include "../../mod/menu/progs.inc"
+       #include "../../mod/menu/progs.inc"
 #endif
diff --git a/qcsrc/menu/xonotic/_mod.qh b/qcsrc/menu/xonotic/_mod.qh
new file mode 100644 (file)
index 0000000..0ae6618
--- /dev/null
@@ -0,0 +1,116 @@
+// generated file; do not modify
+#include "bigbutton.qh"
+#include "bigcommandbutton.qh"
+#include "button.qh"
+#include "campaign.qh"
+#include "charmap.qh"
+#include "checkbox.qh"
+#include "checkbox_slider_invalid.qh"
+#include "checkbox_string.qh"
+#include "colorbutton.qh"
+#include "colorpicker.qh"
+#include "colorpicker_string.qh"
+#include "commandbutton.qh"
+#include "credits.qh"
+#include "crosshairpicker.qh"
+#include "crosshairpreview.qh"
+#include "cvarlist.qh"
+#include "datasource.qh"
+#include "demolist.qh"
+#include "dialog.qh"
+#include "dialog_credits.qh"
+#include "dialog_firstrun.qh"
+#include "dialog_hudpanel_ammo.qh"
+#include "dialog_hudpanel_centerprint.qh"
+#include "dialog_hudpanel_chat.qh"
+#include "dialog_hudpanel_engineinfo.qh"
+#include "dialog_hudpanel_healtharmor.qh"
+#include "dialog_hudpanel_infomessages.qh"
+#include "dialog_hudpanel_itemstime.qh"
+#include "dialog_hudpanel_modicons.qh"
+#include "dialog_hudpanel_notification.qh"
+#include "dialog_hudpanel_physics.qh"
+#include "dialog_hudpanel_powerups.qh"
+#include "dialog_hudpanel_pressedkeys.qh"
+#include "dialog_hudpanel_quickmenu.qh"
+#include "dialog_hudpanel_racetimer.qh"
+#include "dialog_hudpanel_radar.qh"
+#include "dialog_hudpanel_score.qh"
+#include "dialog_hudpanel_timer.qh"
+#include "dialog_hudpanel_vote.qh"
+#include "dialog_hudpanel_weapons.qh"
+#include "dialog_hudsetup_exit.qh"
+#include "dialog_monstertools.qh"
+#include "dialog_multiplayer.qh"
+#include "dialog_multiplayer_create.qh"
+#include "dialog_multiplayer_create_mapinfo.qh"
+#include "dialog_multiplayer_create_mutators.qh"
+#include "dialog_multiplayer_join.qh"
+#include "dialog_multiplayer_join_serverinfo.qh"
+#include "dialog_multiplayer_media.qh"
+#include "dialog_multiplayer_media_demo.qh"
+#include "dialog_multiplayer_media_demo_startconfirm.qh"
+#include "dialog_multiplayer_media_demo_timeconfirm.qh"
+#include "dialog_multiplayer_media_musicplayer.qh"
+#include "dialog_multiplayer_media_screenshot.qh"
+#include "dialog_multiplayer_media_screenshot_viewer.qh"
+#include "dialog_multiplayer_profile.qh"
+#include "dialog_quit.qh"
+#include "dialog_sandboxtools.qh"
+#include "dialog_settings.qh"
+#include "dialog_settings_audio.qh"
+#include "dialog_settings_effects.qh"
+#include "dialog_settings_game.qh"
+#include "dialog_settings_game_crosshair.qh"
+#include "dialog_settings_game_hud.qh"
+#include "dialog_settings_game_hudconfirm.qh"
+#include "dialog_settings_game_messages.qh"
+#include "dialog_settings_game_model.qh"
+#include "dialog_settings_game_view.qh"
+#include "dialog_settings_game_weapons.qh"
+#include "dialog_settings_input.qh"
+#include "dialog_settings_input_userbind.qh"
+#include "dialog_settings_misc.qh"
+#include "dialog_settings_misc_cvars.qh"
+#include "dialog_settings_misc_reset.qh"
+#include "dialog_settings_user.qh"
+#include "dialog_settings_user_languagewarning.qh"
+#include "dialog_settings_video.qh"
+#include "dialog_singleplayer.qh"
+#include "dialog_singleplayer_winner.qh"
+#include "dialog_teamselect.qh"
+#include "gametypelist.qh"
+#include "hudskinlist.qh"
+#include "image.qh"
+#include "inputbox.qh"
+#include "keybinder.qh"
+#include "languagelist.qh"
+#include "listbox.qh"
+#include "mainwindow.qh"
+#include "maplist.qh"
+#include "nexposee.qh"
+#include "picker.qh"
+#include "playerlist.qh"
+#include "playermodel.qh"
+#include "playlist.qh"
+#include "radiobutton.qh"
+#include "rootdialog.qh"
+#include "screenshotimage.qh"
+#include "screenshotlist.qh"
+#include "serverlist.qh"
+#include "skinlist.qh"
+#include "slider.qh"
+#include "slider_decibels.qh"
+#include "slider_particles.qh"
+#include "slider_picmip.qh"
+#include "slider_resolution.qh"
+#include "slider_sbfadetime.qh"
+#include "soundlist.qh"
+#include "statslist.qh"
+#include "tab.qh"
+#include "tabcontroller.qh"
+#include "textlabel.qh"
+#include "textslider.qh"
+#include "util.qh"
+#include "weaponarenacheckbox.qh"
+#include "weaponslist.qh"
diff --git a/qcsrc/server/_mod.qh b/qcsrc/server/_mod.qh
new file mode 100644 (file)
index 0000000..c8b679e
--- /dev/null
@@ -0,0 +1,33 @@
+// generated file; do not modify
+#include "anticheat.qh"
+#include "antilag.qh"
+#include "campaign.qh"
+#include "cheats.qh"
+#include "cl_client.qh"
+#include "cl_impulse.qh"
+#include "cl_player.qh"
+#include "g_damage.qh"
+#include "g_hook.qh"
+#include "g_lights.qh"
+#include "g_models.qh"
+#include "g_subs.qh"
+#include "g_world.qh"
+#include "ipban.qh"
+#include "item_key.qh"
+#include "mapvoting.qh"
+#include "matrix.qh"
+#include "miscfunctions.qh"
+#include "playerdemo.qh"
+#include "portals.qh"
+#include "race.qh"
+#include "round_handler.qh"
+#include "scores.qh"
+#include "scores_rules.qh"
+#include "spawnpoints.qh"
+#include "steerlib.qh"
+#include "sv_main.qh"
+#include "teamplay.qh"
+#include "tests.qh"
+#include "t_halflife.qh"
+#include "t_quake.qh"
+#include "t_quake3.qh"
diff --git a/qcsrc/server/bot/_mod.qh b/qcsrc/server/bot/_mod.qh
new file mode 100644 (file)
index 0000000..0bb1e70
--- /dev/null
@@ -0,0 +1,6 @@
+// generated file; do not modify
+#include "aim.qh"
+#include "bot.qh"
+#include "navigation.qh"
+#include "scripting.qh"
+#include "waypoints.qh"
diff --git a/qcsrc/server/bot/havocbot/_mod.qh b/qcsrc/server/bot/havocbot/_mod.qh
new file mode 100644 (file)
index 0000000..8613886
--- /dev/null
@@ -0,0 +1,3 @@
+// generated file; do not modify
+#include "havocbot.qh"
+#include "roles.qh"
index 8aaf68cda69dac1753364cfe1e84cd07c10129c3..0713fc3ef869adde6e64c1d9c6402d68169c0427 100644 (file)
@@ -29,6 +29,8 @@
 
 #include "../common/animdecide.qh"
 
+#include <lib/matrix/matrix.qh>
+
 void Drop_Special_Items(entity player)
 {
        // called when the player has become stuck or frozen
index 1f2b37a0dcf4c17cf24a3264bd95cc617a362c4a..652bf04f35ae27a01d61187b737623843fccb83c 100644 (file)
@@ -2,8 +2,10 @@
 #include "all.qc"
 #include "banning.qc"
 #include "cmd.qc"
+#ifdef SVQC
+    #include "sv_cmd.qc"
+#endif
 #include "common.qc"
 #include "getreplies.qc"
 #include "radarmap.qc"
-#include "sv_cmd.qc"
 #include "vote.qc"
diff --git a/qcsrc/server/command/_mod.qh b/qcsrc/server/command/_mod.qh
new file mode 100644 (file)
index 0000000..c06b48d
--- /dev/null
@@ -0,0 +1,8 @@
+// generated file; do not modify
+#include "all.qh"
+#include "banning.qh"
+#include "cmd.qh"
+#include "common.qh"
+#include "getreplies.qh"
+#include "radarmap.qh"
+#include "vote.qh"
index b7d26decf53d883dd5f099f7444f6e9a7ed144bb..602d751325337551e701a01238596d1be2e3356d 100644 (file)
@@ -2,6 +2,8 @@
 
 #include "cl_player.qh"
 
+#include <lib/matrix/matrix.qh>
+
 var void MX_Handle(int buf, string ancestor)
 {
     string type = json_get(buf, strcat(ancestor, ".type"));
diff --git a/qcsrc/server/mutators/_mod.qh b/qcsrc/server/mutators/_mod.qh
new file mode 100644 (file)
index 0000000..56565b0
--- /dev/null
@@ -0,0 +1,2 @@
+// generated file; do not modify
+#include "all.qh"
diff --git a/qcsrc/server/mutators/mutator/_mod.qh b/qcsrc/server/mutators/mutator/_mod.qh
new file mode 100644 (file)
index 0000000..7e0e336
--- /dev/null
@@ -0,0 +1,14 @@
+// generated file; do not modify
+#include "gamemode_assault.qh"
+#include "gamemode_ca.qh"
+#include "gamemode_ctf.qh"
+#include "gamemode_cts.qh"
+#include "gamemode_deathmatch.qh"
+#include "gamemode_domination.qh"
+#include "gamemode_freezetag.qh"
+#include "gamemode_invasion.qh"
+#include "gamemode_keepaway.qh"
+#include "gamemode_keyhunt.qh"
+#include "gamemode_lms.qh"
+#include "gamemode_race.qh"
+#include "gamemode_tdm.qh"
diff --git a/qcsrc/server/pathlib/_mod.qh b/qcsrc/server/pathlib/_mod.qh
new file mode 100644 (file)
index 0000000..992b83a
--- /dev/null
@@ -0,0 +1,8 @@
+// generated file; do not modify
+#include "costs.qh"
+#include "debug.qh"
+#include "expandnode.qh"
+#include "main.qh"
+#include "movenode.qh"
+#include "path_waypoint.qh"
+#include "utility.qh"
index 2c7eb92536fe73e2255453d417caecc539642982..7529a6a0722cfb084573d5fba37606fe192dc252 100644 (file)
@@ -1,28 +1,35 @@
-#ifndef DEBUGPATHING
-       #define DEBUGPATHING 0
-#endif
-
 #include <lib/_all.inc>
-#include "_all.qh"
 
-#include "_mod.inc"
-#include "bot/_mod.inc"
-#include "bot/havocbot/_mod.inc"
-#include "command/_mod.inc"
-#include "mutators/_mod.inc"
-#include "pathlib/_all.inc"
-#include "weapons/_mod.inc"
+#if XONOTIC
+    #include <lib/matrix/_mod.inc>
+
+       #ifndef DEBUGPATHING
+               #define DEBUGPATHING 0
+       #endif
+
+       #include "_all.qh"
 
-#include <common/_all.inc>
-#include <common/effects/qc/all.qc>
+       #include "_mod.inc"
+       #include "bot/_mod.inc"
+       #include "bot/havocbot/_mod.inc"
+       #include "command/_mod.inc"
+       #include "mutators/_mod.inc"
+       #include "pathlib/_all.inc"
+       #include "weapons/_mod.inc"
 
-#include <lib/csqcmodel/sv_model.qc>
+       #include <common/_all.inc>
+       #include <common/effects/qc/all.qc>
+
+       #include <lib/csqcmodel/sv_model.qc>
+
+       #include <lib/warpzone/anglestransform.qc>
+       #include <lib/warpzone/common.qc>
+       #include <lib/warpzone/server.qc>
+       #include <lib/warpzone/util_server.qc>
+#endif
 
-#include <lib/warpzone/anglestransform.qc>
-#include <lib/warpzone/common.qc>
-#include <lib/warpzone/server.qc>
-#include <lib/warpzone/util_server.qc>
+#include <ecs/_lib.inc>
 
 #if BUILD_MOD
-#include "../../mod/server/progs.inc"
+       #include "../../mod/server/progs.inc"
 #endif
diff --git a/qcsrc/server/weapons/_mod.qh b/qcsrc/server/weapons/_mod.qh
new file mode 100644 (file)
index 0000000..fd903bf
--- /dev/null
@@ -0,0 +1,11 @@
+// generated file; do not modify
+#include "accuracy.qh"
+#include "common.qh"
+#include "csqcprojectile.qh"
+#include "hitplot.qh"
+#include "selection.qh"
+#include "spawning.qh"
+#include "throwing.qh"
+#include "tracing.qh"
+#include "weaponstats.qh"
+#include "weaponsystem.qh"
index 3c794e93fbba747b9eb43b6954a86a3c4a0856cf..0a03de360292dfb4eef7b84ece96d524466207f4 100755 (executable)
@@ -9,6 +9,7 @@ CPP="cc -xc -E"
 
 declare -a QCCDEFS=(
     -DNDEBUG=1
+    -DXONOTIC=1
     -DWATERMARK="\"$(git describe --tags --dirty='~')\""
     -DDEBUGPATHING=0
 )
index 269c631f7800987dd3ab30357de1340082b3f058..f133e97840991e73cef6004dfa773034e8673e85 100755 (executable)
@@ -3,12 +3,22 @@ set -eu
 cd "$(dirname "$0")"
 cd ..
 
-MOD=_mod.inc
+MOD=_mod
 
 function genmod() {
-    echo '// generated file; do not modify' > ${MOD}
+    echo '// generated file; do not modify' > ${MOD}.inc
+    echo '// generated file; do not modify' > ${MOD}.qh
     for f in $(ls | sort -k 1,1 -t .); do
-        if [[ "$f" == *.qc ]]; then echo "#include \"$f\"" >> ${MOD}; fi
+        if [[ "$f" == cl_* ]]; then if [[ -f "${f#cl_}" ]]; then continue; fi; fi
+        if [[ "$f" == sv_* ]]; then if [[ -f "${f#sv_}" ]]; then continue; fi; fi
+        if [[ "$f" == ui_* ]]; then if [[ -f "${f#ui_}" ]]; then continue; fi; fi
+        if [[ "$f" == *.qc ]]; then
+            echo "#include \"$f\"" >> ${MOD}.inc
+            echo "#include \"${f%.qc}.qh\"" >> ${MOD}.qh
+            if [[ -f "cl_$f" ]]; then echo -e "#ifdef CSQC\n    #include \"cl_$f\"\n#endif" >> ${MOD}.inc; fi
+            if [[ -f "sv_$f" ]]; then echo -e "#ifdef SVQC\n    #include \"sv_$f\"\n#endif" >> ${MOD}.inc; fi
+            if [[ -f "ui_$f" ]]; then echo -e "#ifdef MENUQC\n    #include \"ui_$f\"\n#endif" >> ${MOD}.inc; fi
+        fi
     done
     # echo >> ${MOD}
     for f in *; do if [ -d "$f" ]; then
@@ -18,6 +28,7 @@ function genmod() {
 }
 
 (cd lib; genmod)
+(cd ecs; genmod)
 (cd common; genmod)
 (cd client; genmod)
 (cd server; genmod)
index ef1731592646e86da9bb2858b8a769634df7fd07..b638927bf4a50441d0adef391b4f48101337cef6 100755 (executable)
@@ -24,7 +24,7 @@ function check() {
         include="#include \"${include}\""
         startswith "$file" "$include"
     done
-    find "$base" -type f -name '*.qh' -print0 | sort -z | while read -r -d '' file; do
+    find "$base" -type f -name '*.qh' -a \! -name '_mod.qh' -print0 | sort -z | while read -r -d '' file; do
         echo "$file"
         startswith "$file" "#pragma once"
     done