From 65f79cc103dac145eebf7c179a16408935c176b9 Mon Sep 17 00:00:00 2001 From: TimePath Date: Thu, 7 Apr 2016 22:43:11 +1000 Subject: [PATCH] ECS: Initial commit --- qcsrc/Makefile | 2 + qcsrc/client/_mod.qh | 13 ++ qcsrc/client/commands/_mod.qh | 3 + qcsrc/client/defs.qh | 3 +- qcsrc/client/hud/_mod.qh | 3 + qcsrc/client/hud/panel/_mod.qh | 20 +++ qcsrc/client/mutators/_mod.qh | 1 + qcsrc/client/progs.inc | 38 +++-- qcsrc/client/weapons/_mod.qh | 2 + qcsrc/common/_mod.qh | 13 ++ qcsrc/common/command/_mod.qh | 5 + qcsrc/common/deathtypes/_mod.qh | 2 + qcsrc/common/effects/_mod.qh | 3 + qcsrc/common/effects/qc/_mod.qh | 8 + qcsrc/common/gamemodes/_mod.qh | 2 + qcsrc/common/gamemodes/gamemode/_mod.qh | 1 + .../common/gamemodes/gamemode/nexball/_mod.qh | 3 + .../gamemodes/gamemode/onslaught/_mod.qh | 6 + qcsrc/common/impulses/_mod.qh | 2 + qcsrc/common/items/_mod.qh | 2 + qcsrc/common/items/item/_mod.qh | 7 + qcsrc/common/minigames/_mod.inc | 8 +- qcsrc/common/minigames/_mod.qh | 3 + qcsrc/common/minigames/minigame/_mod.qh | 9 + qcsrc/common/models/_mod.qh | 1 + qcsrc/common/monsters/_mod.qh | 4 + qcsrc/common/monsters/monster/_mod.qh | 6 + qcsrc/common/mutators/_mod.qh | 2 + qcsrc/common/mutators/base.qh | 13 +- qcsrc/common/mutators/mutator/_mod.qh | 2 + .../common/mutators/mutator/bloodloss/_mod.qh | 2 + .../mutators/mutator/breakablehook/_mod.qh | 2 + qcsrc/common/mutators/mutator/buffs/_mod.qh | 3 + qcsrc/common/mutators/mutator/bugrigs/_mod.qh | 2 + .../common/mutators/mutator/campcheck/_mod.qh | 2 + qcsrc/common/mutators/mutator/cloaked/_mod.qh | 2 + .../mutators/mutator/damagetext/_mod.qh | 2 + qcsrc/common/mutators/mutator/dodging/_mod.qh | 2 + .../mutators/mutator/doublejump/_mod.qh | 2 + qcsrc/common/mutators/mutator/hook/_mod.qh | 2 + .../common/mutators/mutator/instagib/_mod.qh | 3 + .../mutators/mutator/invincibleproj/_mod.qh | 2 + .../mutators/mutator/melee_only/_mod.qh | 2 + qcsrc/common/mutators/mutator/midair/_mod.qh | 2 + .../common/mutators/mutator/multijump/_mod.qh | 2 + qcsrc/common/mutators/mutator/nades/_mod.qh | 3 + .../common/mutators/mutator/new_toys/_mod.qh | 2 + qcsrc/common/mutators/mutator/nix/_mod.qh | 2 + .../common/mutators/mutator/overkill/_mod.qh | 4 + .../mutators/mutator/physical_items/_mod.qh | 2 + qcsrc/common/mutators/mutator/pinata/_mod.qh | 2 + .../mutators/mutator/random_gravity/_mod.qh | 2 + .../mutators/mutator/rocketflying/_mod.qh | 2 + .../mutators/mutator/rocketminsta/_mod.qh | 2 + .../mutators/mutator/running_guns/_mod.qh | 2 + qcsrc/common/mutators/mutator/sandbox/_mod.qh | 2 + .../mutator/spawn_near_teammate/_mod.qh | 2 + .../common/mutators/mutator/superspec/_mod.qh | 2 + .../mutators/mutator/touchexplode/_mod.qh | 2 + qcsrc/common/mutators/mutator/vampire/_mod.qh | 2 + .../mutators/mutator/vampirehook/_mod.qh | 2 + .../common/mutators/mutator/waypoints/_mod.qh | 2 + .../mutator/weaponarena_random/_mod.qh | 2 + qcsrc/common/notifications/_mod.qh | 2 + qcsrc/common/physics/_mod.qh | 3 + qcsrc/common/physics/movetypes/_mod.qh | 7 + qcsrc/common/sounds/_mod.qh | 2 + qcsrc/common/triggers/_mod.qh | 6 + qcsrc/common/triggers/func/_mod.qh | 19 +++ qcsrc/common/triggers/misc/_mod.qh | 6 + qcsrc/common/triggers/target/_mod.qh | 8 + qcsrc/common/triggers/trigger/_mod.qh | 25 +++ qcsrc/common/turrets/_mod.qh | 8 + qcsrc/common/turrets/turret/_mod.qh | 23 +++ qcsrc/common/vehicles/_mod.qh | 4 + qcsrc/common/vehicles/vehicle/_mod.qh | 9 + qcsrc/common/weapons/_mod.qh | 4 + qcsrc/common/weapons/weapon/_mod.qh | 21 +++ qcsrc/dpdefs/doc.md | 84 +++++++++- qcsrc/ecs/README.md | 48 ++++++ qcsrc/ecs/_lib.inc | 46 ++++++ qcsrc/ecs/_mod.inc | 5 + qcsrc/ecs/_mod.qh | 2 + qcsrc/ecs/cl_main.qc | 41 +++++ qcsrc/ecs/components/_mod.inc | 3 + qcsrc/ecs/components/_mod.qh | 3 + qcsrc/ecs/components/input.qc | 1 + qcsrc/ecs/components/input.qh | 6 + qcsrc/ecs/components/physics.qc | 10 ++ qcsrc/ecs/components/physics.qh | 15 ++ qcsrc/ecs/events/_mod.inc | 2 + qcsrc/ecs/events/_mod.qh | 2 + qcsrc/ecs/events/physics.qc | 1 + qcsrc/ecs/events/physics.qh | 4 + qcsrc/ecs/main.qc | 12 ++ qcsrc/ecs/main.qh | 3 + qcsrc/ecs/systems/_mod.inc | 2 + qcsrc/ecs/systems/_mod.qh | 2 + qcsrc/ecs/systems/physics.qc | 155 ++++++++++++++++++ qcsrc/ecs/systems/physics.qh | 3 + qcsrc/lib/_all.inc | 134 ++++++++++++--- qcsrc/lib/_mod.qh | 8 + qcsrc/lib/csqcmodel/_mod.qh | 5 + qcsrc/lib/draw.qh | 2 +- qcsrc/lib/macro.qh | 3 + qcsrc/lib/matrix/_mod.qh | 3 + qcsrc/lib/misc.qh | 3 - qcsrc/lib/net.qh | 4 +- qcsrc/lib/vector.qh | 8 + qcsrc/lib/warpzone/_mod.qh | 7 + qcsrc/menu/_mod.qh | 5 + qcsrc/menu/anim/_mod.qh | 5 + qcsrc/menu/command/_mod.qh | 3 + qcsrc/menu/command/all.qc | 2 + qcsrc/menu/command/all.qh | 1 + qcsrc/menu/item/_mod.qh | 17 ++ qcsrc/menu/matrix.qc | 2 + qcsrc/menu/matrix.qh | 1 + qcsrc/menu/mutators/_mod.qh | 1 + qcsrc/menu/progs.inc | 20 ++- qcsrc/menu/xonotic/_mod.qh | 116 +++++++++++++ qcsrc/server/_mod.qh | 33 ++++ qcsrc/server/bot/_mod.qh | 6 + qcsrc/server/bot/havocbot/_mod.qh | 3 + qcsrc/server/cl_player.qc | 2 + qcsrc/server/command/_mod.inc | 4 +- qcsrc/server/command/_mod.qh | 8 + qcsrc/server/matrix.qc | 2 + qcsrc/server/mutators/_mod.qh | 2 + qcsrc/server/mutators/mutator/_mod.qh | 14 ++ qcsrc/server/pathlib/_mod.qh | 8 + qcsrc/server/progs.inc | 47 +++--- qcsrc/server/weapons/_mod.qh | 11 ++ qcsrc/tools/compilationunits.sh | 1 + qcsrc/tools/genmod.sh | 17 +- qcsrc/tools/headerstyle.sh | 2 +- 136 files changed, 1280 insertions(+), 85 deletions(-) create mode 100644 qcsrc/client/_mod.qh create mode 100644 qcsrc/client/commands/_mod.qh create mode 100644 qcsrc/client/hud/_mod.qh create mode 100644 qcsrc/client/hud/panel/_mod.qh create mode 100644 qcsrc/client/mutators/_mod.qh create mode 100644 qcsrc/client/weapons/_mod.qh create mode 100644 qcsrc/common/_mod.qh create mode 100644 qcsrc/common/command/_mod.qh create mode 100644 qcsrc/common/deathtypes/_mod.qh create mode 100644 qcsrc/common/effects/_mod.qh create mode 100644 qcsrc/common/effects/qc/_mod.qh create mode 100644 qcsrc/common/gamemodes/_mod.qh create mode 100644 qcsrc/common/gamemodes/gamemode/_mod.qh create mode 100644 qcsrc/common/gamemodes/gamemode/nexball/_mod.qh create mode 100644 qcsrc/common/gamemodes/gamemode/onslaught/_mod.qh create mode 100644 qcsrc/common/impulses/_mod.qh create mode 100644 qcsrc/common/items/_mod.qh create mode 100644 qcsrc/common/items/item/_mod.qh create mode 100644 qcsrc/common/minigames/_mod.qh create mode 100644 qcsrc/common/minigames/minigame/_mod.qh create mode 100644 qcsrc/common/models/_mod.qh create mode 100644 qcsrc/common/monsters/_mod.qh create mode 100644 qcsrc/common/monsters/monster/_mod.qh create mode 100644 qcsrc/common/mutators/_mod.qh create mode 100644 qcsrc/common/mutators/mutator/_mod.qh create mode 100644 qcsrc/common/mutators/mutator/bloodloss/_mod.qh create mode 100644 qcsrc/common/mutators/mutator/breakablehook/_mod.qh create mode 100644 qcsrc/common/mutators/mutator/buffs/_mod.qh create mode 100644 qcsrc/common/mutators/mutator/bugrigs/_mod.qh create mode 100644 qcsrc/common/mutators/mutator/campcheck/_mod.qh create mode 100644 qcsrc/common/mutators/mutator/cloaked/_mod.qh create mode 100644 qcsrc/common/mutators/mutator/damagetext/_mod.qh create mode 100644 qcsrc/common/mutators/mutator/dodging/_mod.qh create mode 100644 qcsrc/common/mutators/mutator/doublejump/_mod.qh create mode 100644 qcsrc/common/mutators/mutator/hook/_mod.qh create mode 100644 qcsrc/common/mutators/mutator/instagib/_mod.qh create mode 100644 qcsrc/common/mutators/mutator/invincibleproj/_mod.qh create mode 100644 qcsrc/common/mutators/mutator/melee_only/_mod.qh create mode 100644 qcsrc/common/mutators/mutator/midair/_mod.qh create mode 100644 qcsrc/common/mutators/mutator/multijump/_mod.qh create mode 100644 qcsrc/common/mutators/mutator/nades/_mod.qh create mode 100644 qcsrc/common/mutators/mutator/new_toys/_mod.qh create mode 100644 qcsrc/common/mutators/mutator/nix/_mod.qh create mode 100644 qcsrc/common/mutators/mutator/overkill/_mod.qh create mode 100644 qcsrc/common/mutators/mutator/physical_items/_mod.qh create mode 100644 qcsrc/common/mutators/mutator/pinata/_mod.qh create mode 100644 qcsrc/common/mutators/mutator/random_gravity/_mod.qh create mode 100644 qcsrc/common/mutators/mutator/rocketflying/_mod.qh create mode 100644 qcsrc/common/mutators/mutator/rocketminsta/_mod.qh create mode 100644 qcsrc/common/mutators/mutator/running_guns/_mod.qh create mode 100644 qcsrc/common/mutators/mutator/sandbox/_mod.qh create mode 100644 qcsrc/common/mutators/mutator/spawn_near_teammate/_mod.qh create mode 100644 qcsrc/common/mutators/mutator/superspec/_mod.qh create mode 100644 qcsrc/common/mutators/mutator/touchexplode/_mod.qh create mode 100644 qcsrc/common/mutators/mutator/vampire/_mod.qh create mode 100644 qcsrc/common/mutators/mutator/vampirehook/_mod.qh create mode 100644 qcsrc/common/mutators/mutator/waypoints/_mod.qh create mode 100644 qcsrc/common/mutators/mutator/weaponarena_random/_mod.qh create mode 100644 qcsrc/common/notifications/_mod.qh create mode 100644 qcsrc/common/physics/_mod.qh create mode 100644 qcsrc/common/physics/movetypes/_mod.qh create mode 100644 qcsrc/common/sounds/_mod.qh create mode 100644 qcsrc/common/triggers/_mod.qh create mode 100644 qcsrc/common/triggers/func/_mod.qh create mode 100644 qcsrc/common/triggers/misc/_mod.qh create mode 100644 qcsrc/common/triggers/target/_mod.qh create mode 100644 qcsrc/common/triggers/trigger/_mod.qh create mode 100644 qcsrc/common/turrets/_mod.qh create mode 100644 qcsrc/common/turrets/turret/_mod.qh create mode 100644 qcsrc/common/vehicles/_mod.qh create mode 100644 qcsrc/common/vehicles/vehicle/_mod.qh create mode 100644 qcsrc/common/weapons/_mod.qh create mode 100644 qcsrc/common/weapons/weapon/_mod.qh create mode 100644 qcsrc/ecs/README.md create mode 100644 qcsrc/ecs/_lib.inc create mode 100644 qcsrc/ecs/_mod.inc create mode 100644 qcsrc/ecs/_mod.qh create mode 100644 qcsrc/ecs/cl_main.qc create mode 100644 qcsrc/ecs/components/_mod.inc create mode 100644 qcsrc/ecs/components/_mod.qh create mode 100644 qcsrc/ecs/components/input.qc create mode 100644 qcsrc/ecs/components/input.qh create mode 100644 qcsrc/ecs/components/physics.qc create mode 100644 qcsrc/ecs/components/physics.qh create mode 100644 qcsrc/ecs/events/_mod.inc create mode 100644 qcsrc/ecs/events/_mod.qh create mode 100644 qcsrc/ecs/events/physics.qc create mode 100644 qcsrc/ecs/events/physics.qh create mode 100644 qcsrc/ecs/main.qc create mode 100644 qcsrc/ecs/main.qh create mode 100644 qcsrc/ecs/systems/_mod.inc create mode 100644 qcsrc/ecs/systems/_mod.qh create mode 100644 qcsrc/ecs/systems/physics.qc create mode 100644 qcsrc/ecs/systems/physics.qh create mode 100644 qcsrc/lib/_mod.qh create mode 100644 qcsrc/lib/csqcmodel/_mod.qh create mode 100644 qcsrc/lib/matrix/_mod.qh create mode 100644 qcsrc/lib/warpzone/_mod.qh create mode 100644 qcsrc/menu/_mod.qh create mode 100644 qcsrc/menu/anim/_mod.qh create mode 100644 qcsrc/menu/command/_mod.qh create mode 100644 qcsrc/menu/command/all.qh create mode 100644 qcsrc/menu/item/_mod.qh create mode 100644 qcsrc/menu/matrix.qh create mode 100644 qcsrc/menu/mutators/_mod.qh create mode 100644 qcsrc/menu/xonotic/_mod.qh create mode 100644 qcsrc/server/_mod.qh create mode 100644 qcsrc/server/bot/_mod.qh create mode 100644 qcsrc/server/bot/havocbot/_mod.qh create mode 100644 qcsrc/server/command/_mod.qh create mode 100644 qcsrc/server/mutators/_mod.qh create mode 100644 qcsrc/server/mutators/mutator/_mod.qh create mode 100644 qcsrc/server/pathlib/_mod.qh create mode 100644 qcsrc/server/weapons/_mod.qh diff --git a/qcsrc/Makefile b/qcsrc/Makefile index ee335d9b0..0ed67281b 100644 --- a/qcsrc/Makefile +++ b/qcsrc/Makefile @@ -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 index 000000000..17c2a813e --- /dev/null +++ b/qcsrc/client/_mod.qh @@ -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 index 000000000..25c01a459 --- /dev/null +++ b/qcsrc/client/commands/_mod.qh @@ -0,0 +1,3 @@ +// generated file; do not modify +#include "all.qh" +#include "cl_cmd.qh" diff --git a/qcsrc/client/defs.qh b/qcsrc/client/defs.qh index 84bcb2b3d..708358d9b 100644 --- a/qcsrc/client/defs.qh +++ b/qcsrc/client/defs.qh @@ -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 index 000000000..805149ac8 --- /dev/null +++ b/qcsrc/client/hud/_mod.qh @@ -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 index 000000000..5afd4e018 --- /dev/null +++ b/qcsrc/client/hud/panel/_mod.qh @@ -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 index 000000000..98fb4815c --- /dev/null +++ b/qcsrc/client/mutators/_mod.qh @@ -0,0 +1 @@ +// generated file; do not modify diff --git a/qcsrc/client/progs.inc b/qcsrc/client/progs.inc index 8817a2c71..68a61c266 100644 --- a/qcsrc/client/progs.inc +++ b/qcsrc/client/progs.inc @@ -1,25 +1,29 @@ #include -#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 -#include + #include + #include -#include -#include -#include + #include + #include + #include -#include -#include -#include -#include -#include + #include + #include + #include + #include + #include +#endif + +#include #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 index 000000000..2ca20e237 --- /dev/null +++ b/qcsrc/client/weapons/_mod.qh @@ -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 index 000000000..6c4dabf77 --- /dev/null +++ b/qcsrc/common/_mod.qh @@ -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 index 000000000..dbad75c00 --- /dev/null +++ b/qcsrc/common/command/_mod.qh @@ -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 index 000000000..56565b078 --- /dev/null +++ b/qcsrc/common/deathtypes/_mod.qh @@ -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 index 000000000..b1eb229e2 --- /dev/null +++ b/qcsrc/common/effects/_mod.qh @@ -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 index 000000000..5333ac756 --- /dev/null +++ b/qcsrc/common/effects/qc/_mod.qh @@ -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 index 000000000..56565b078 --- /dev/null +++ b/qcsrc/common/gamemodes/_mod.qh @@ -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 index 000000000..98fb4815c --- /dev/null +++ b/qcsrc/common/gamemodes/gamemode/_mod.qh @@ -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 index 000000000..dff00b445 --- /dev/null +++ b/qcsrc/common/gamemodes/gamemode/nexball/_mod.qh @@ -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 index 000000000..235bc762c --- /dev/null +++ b/qcsrc/common/gamemodes/gamemode/onslaught/_mod.qh @@ -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 index 000000000..56565b078 --- /dev/null +++ b/qcsrc/common/impulses/_mod.qh @@ -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 index 000000000..56565b078 --- /dev/null +++ b/qcsrc/common/items/_mod.qh @@ -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 index 000000000..e2c7d1bcb --- /dev/null +++ b/qcsrc/common/items/item/_mod.qh @@ -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" diff --git a/qcsrc/common/minigames/_mod.inc b/qcsrc/common/minigames/_mod.inc index 47690d32b..98f44b704 100644 --- a/qcsrc/common/minigames/_mod.inc +++ b/qcsrc/common/minigames/_mod.inc @@ -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 index 000000000..db3da28a9 --- /dev/null +++ b/qcsrc/common/minigames/_mod.qh @@ -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 index 000000000..6808360c7 --- /dev/null +++ b/qcsrc/common/minigames/minigame/_mod.qh @@ -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 index 000000000..98fb4815c --- /dev/null +++ b/qcsrc/common/models/_mod.qh @@ -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 index 000000000..88114f7fb --- /dev/null +++ b/qcsrc/common/monsters/_mod.qh @@ -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 index 000000000..0802f6e1f --- /dev/null +++ b/qcsrc/common/monsters/monster/_mod.qh @@ -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 index 000000000..56565b078 --- /dev/null +++ b/qcsrc/common/mutators/_mod.qh @@ -0,0 +1,2 @@ +// generated file; do not modify +#include "all.qh" diff --git a/qcsrc/common/mutators/base.qh b/qcsrc/common/mutators/base.qh index 4d92b5d40..c1f7501c9 100644 --- a/qcsrc/common/mutators/base.qh +++ b/qcsrc/common/mutators/base.qh @@ -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 index 000000000..beb435683 --- /dev/null +++ b/qcsrc/common/mutators/mutator/_mod.qh @@ -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 index 000000000..d1fcbb90f --- /dev/null +++ b/qcsrc/common/mutators/mutator/bloodloss/_mod.qh @@ -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 index 000000000..abd961251 --- /dev/null +++ b/qcsrc/common/mutators/mutator/breakablehook/_mod.qh @@ -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 index 000000000..17f5952d5 --- /dev/null +++ b/qcsrc/common/mutators/mutator/buffs/_mod.qh @@ -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 index 000000000..5c4aa007b --- /dev/null +++ b/qcsrc/common/mutators/mutator/bugrigs/_mod.qh @@ -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 index 000000000..fd05c7ebd --- /dev/null +++ b/qcsrc/common/mutators/mutator/campcheck/_mod.qh @@ -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 index 000000000..ee9bf7e41 --- /dev/null +++ b/qcsrc/common/mutators/mutator/cloaked/_mod.qh @@ -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 index 000000000..1c608e356 --- /dev/null +++ b/qcsrc/common/mutators/mutator/damagetext/_mod.qh @@ -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 index 000000000..cdaf3d0f1 --- /dev/null +++ b/qcsrc/common/mutators/mutator/dodging/_mod.qh @@ -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 index 000000000..90e06da56 --- /dev/null +++ b/qcsrc/common/mutators/mutator/doublejump/_mod.qh @@ -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 index 000000000..3d46a37b0 --- /dev/null +++ b/qcsrc/common/mutators/mutator/hook/_mod.qh @@ -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 index 000000000..ce3e4d138 --- /dev/null +++ b/qcsrc/common/mutators/mutator/instagib/_mod.qh @@ -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 index 000000000..aad520018 --- /dev/null +++ b/qcsrc/common/mutators/mutator/invincibleproj/_mod.qh @@ -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 index 000000000..ea508c767 --- /dev/null +++ b/qcsrc/common/mutators/mutator/melee_only/_mod.qh @@ -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 index 000000000..718da862d --- /dev/null +++ b/qcsrc/common/mutators/mutator/midair/_mod.qh @@ -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 index 000000000..82884cb1f --- /dev/null +++ b/qcsrc/common/mutators/mutator/multijump/_mod.qh @@ -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 index 000000000..9871ce474 --- /dev/null +++ b/qcsrc/common/mutators/mutator/nades/_mod.qh @@ -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 index 000000000..65bce7d97 --- /dev/null +++ b/qcsrc/common/mutators/mutator/new_toys/_mod.qh @@ -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 index 000000000..c97e58e50 --- /dev/null +++ b/qcsrc/common/mutators/mutator/nix/_mod.qh @@ -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 index 000000000..54b55f988 --- /dev/null +++ b/qcsrc/common/mutators/mutator/overkill/_mod.qh @@ -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 index 000000000..4b5483554 --- /dev/null +++ b/qcsrc/common/mutators/mutator/physical_items/_mod.qh @@ -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 index 000000000..b1e3d12a4 --- /dev/null +++ b/qcsrc/common/mutators/mutator/pinata/_mod.qh @@ -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 index 000000000..83e66416e --- /dev/null +++ b/qcsrc/common/mutators/mutator/random_gravity/_mod.qh @@ -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 index 000000000..96e1d2dfa --- /dev/null +++ b/qcsrc/common/mutators/mutator/rocketflying/_mod.qh @@ -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 index 000000000..8be2decae --- /dev/null +++ b/qcsrc/common/mutators/mutator/rocketminsta/_mod.qh @@ -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 index 000000000..3d07a8b35 --- /dev/null +++ b/qcsrc/common/mutators/mutator/running_guns/_mod.qh @@ -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 index 000000000..ac582a10c --- /dev/null +++ b/qcsrc/common/mutators/mutator/sandbox/_mod.qh @@ -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 index 000000000..192b364c2 --- /dev/null +++ b/qcsrc/common/mutators/mutator/spawn_near_teammate/_mod.qh @@ -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 index 000000000..93171acb4 --- /dev/null +++ b/qcsrc/common/mutators/mutator/superspec/_mod.qh @@ -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 index 000000000..701464381 --- /dev/null +++ b/qcsrc/common/mutators/mutator/touchexplode/_mod.qh @@ -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 index 000000000..620c35fe0 --- /dev/null +++ b/qcsrc/common/mutators/mutator/vampire/_mod.qh @@ -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 index 000000000..25fcddd35 --- /dev/null +++ b/qcsrc/common/mutators/mutator/vampirehook/_mod.qh @@ -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 index 000000000..248953a88 --- /dev/null +++ b/qcsrc/common/mutators/mutator/waypoints/_mod.qh @@ -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 index 000000000..ad86e4e85 --- /dev/null +++ b/qcsrc/common/mutators/mutator/weaponarena_random/_mod.qh @@ -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 index 000000000..56565b078 --- /dev/null +++ b/qcsrc/common/notifications/_mod.qh @@ -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 index 000000000..984ab7a5a --- /dev/null +++ b/qcsrc/common/physics/_mod.qh @@ -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 index 000000000..ca843182a --- /dev/null +++ b/qcsrc/common/physics/movetypes/_mod.qh @@ -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 index 000000000..56565b078 --- /dev/null +++ b/qcsrc/common/sounds/_mod.qh @@ -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 index 000000000..e32f7a6e5 --- /dev/null +++ b/qcsrc/common/triggers/_mod.qh @@ -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 index 000000000..f6fb323dd --- /dev/null +++ b/qcsrc/common/triggers/func/_mod.qh @@ -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 index 000000000..dae21c569 --- /dev/null +++ b/qcsrc/common/triggers/misc/_mod.qh @@ -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 index 000000000..0bcfa91e7 --- /dev/null +++ b/qcsrc/common/triggers/target/_mod.qh @@ -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 index 000000000..597fd2e15 --- /dev/null +++ b/qcsrc/common/triggers/trigger/_mod.qh @@ -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 index 000000000..6f9e1f7ab --- /dev/null +++ b/qcsrc/common/turrets/_mod.qh @@ -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 index 000000000..96b858b7e --- /dev/null +++ b/qcsrc/common/turrets/turret/_mod.qh @@ -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 index 000000000..c757035ac --- /dev/null +++ b/qcsrc/common/vehicles/_mod.qh @@ -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 index 000000000..d6cf43595 --- /dev/null +++ b/qcsrc/common/vehicles/vehicle/_mod.qh @@ -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 index 000000000..fce18fbfe --- /dev/null +++ b/qcsrc/common/weapons/_mod.qh @@ -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 index 000000000..34517c4f7 --- /dev/null +++ b/qcsrc/common/weapons/weapon/_mod.qh @@ -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" diff --git a/qcsrc/dpdefs/doc.md b/qcsrc/dpdefs/doc.md index d279ced47..df87b12d8 100644 --- a/qcsrc/dpdefs/doc.md +++ b/qcsrc/dpdefs/doc.md @@ -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 index 000000000..1c75d95ef --- /dev/null +++ b/qcsrc/ecs/README.md @@ -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 index 000000000..d151fb6f4 --- /dev/null +++ b/qcsrc/ecs/_lib.inc @@ -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 index 000000000..dd98e07ea --- /dev/null +++ b/qcsrc/ecs/_mod.inc @@ -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 index 000000000..ab00e524f --- /dev/null +++ b/qcsrc/ecs/_mod.qh @@ -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 index 000000000..6064f7d64 --- /dev/null +++ b/qcsrc/ecs/cl_main.qc @@ -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 index 000000000..d587dbec6 --- /dev/null +++ b/qcsrc/ecs/components/_mod.inc @@ -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 index 000000000..31478fad3 --- /dev/null +++ b/qcsrc/ecs/components/_mod.qh @@ -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 index 000000000..0da3f9144 --- /dev/null +++ b/qcsrc/ecs/components/input.qc @@ -0,0 +1 @@ +#include "input.qh" diff --git a/qcsrc/ecs/components/input.qh b/qcsrc/ecs/components/input.qh new file mode 100644 index 000000000..37944ca5c --- /dev/null +++ b/qcsrc/ecs/components/input.qh @@ -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 index 000000000..bfca3d1ba --- /dev/null +++ b/qcsrc/ecs/components/physics.qc @@ -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 index 000000000..92dae4cc7 --- /dev/null +++ b/qcsrc/ecs/components/physics.qh @@ -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 index 000000000..a2a9d2d69 --- /dev/null +++ b/qcsrc/ecs/events/_mod.inc @@ -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 index 000000000..d7133faba --- /dev/null +++ b/qcsrc/ecs/events/_mod.qh @@ -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 index 000000000..909f45c1d --- /dev/null +++ b/qcsrc/ecs/events/physics.qc @@ -0,0 +1 @@ +#include "physics.qh" diff --git a/qcsrc/ecs/events/physics.qh b/qcsrc/ecs/events/physics.qh new file mode 100644 index 000000000..99e75d31b --- /dev/null +++ b/qcsrc/ecs/events/physics.qh @@ -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 index 000000000..e30b704cd --- /dev/null +++ b/qcsrc/ecs/main.qc @@ -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 index 000000000..9b7bf3523 --- /dev/null +++ b/qcsrc/ecs/main.qh @@ -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 index 000000000..a2a9d2d69 --- /dev/null +++ b/qcsrc/ecs/systems/_mod.inc @@ -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 index 000000000..d7133faba --- /dev/null +++ b/qcsrc/ecs/systems/_mod.qh @@ -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 index 000000000..f4cefc221 --- /dev/null +++ b/qcsrc/ecs/systems/physics.qc @@ -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 index 000000000..29ea24331 --- /dev/null +++ b/qcsrc/ecs/systems/physics.qh @@ -0,0 +1,3 @@ +#pragma once + +SYSTEM(phys, 30); diff --git a/qcsrc/lib/_all.inc b/qcsrc/lib/_all.inc index c5e020660..ea1075a6e 100644 --- a/qcsrc/lib/_all.inc +++ b/qcsrc/lib/_all.inc @@ -33,28 +33,30 @@ #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 index 000000000..3b4cf8071 --- /dev/null +++ b/qcsrc/lib/_mod.qh @@ -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 index 000000000..5e9b4728a --- /dev/null +++ b/qcsrc/lib/csqcmodel/_mod.qh @@ -0,0 +1,5 @@ +// generated file; do not modify +#include "cl_model.qh" +#include "cl_player.qh" +#include "interpolate.qh" +#include "sv_model.qh" diff --git a/qcsrc/lib/draw.qh b/qcsrc/lib/draw.qh index c8d9ae8de..8a2dc8880 100644 --- a/qcsrc/lib/draw.qh +++ b/qcsrc/lib/draw.qh @@ -5,7 +5,7 @@ #include "i18n.qh" #include "vector.qh" - #include + 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) { diff --git a/qcsrc/lib/macro.qh b/qcsrc/lib/macro.qh index 809708d74..6f08db459 100644 --- a/qcsrc/lib/macro.qh +++ b/qcsrc/lib/macro.qh @@ -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 index 000000000..3ce2f7548 --- /dev/null +++ b/qcsrc/lib/matrix/_mod.qh @@ -0,0 +1,3 @@ +// generated file; do not modify +#include "command.qh" +#include "matrix.qh" diff --git a/qcsrc/lib/misc.qh b/qcsrc/lib/misc.qh index 950000f04..21e0c5239 100644 --- a/qcsrc/lib/misc.qh +++ b/qcsrc/lib/misc.qh @@ -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__))) diff --git a/qcsrc/lib/net.qh b/qcsrc/lib/net.qh index 03e5c9dd8..faa24e71a 100644 --- a/qcsrc/lib/net.qh +++ b/qcsrc/lib/net.qh @@ -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(); diff --git a/qcsrc/lib/vector.qh b/qcsrc/lib/vector.qh index def1dae2d..adb6d6a95 100644 --- a/qcsrc/lib/vector.qh +++ b/qcsrc/lib/vector.qh @@ -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 index 000000000..8ed1a13c9 --- /dev/null +++ b/qcsrc/lib/warpzone/_mod.qh @@ -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 index 000000000..02d26ad55 --- /dev/null +++ b/qcsrc/menu/_mod.qh @@ -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 index 000000000..dc436a9e3 --- /dev/null +++ b/qcsrc/menu/anim/_mod.qh @@ -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 index 000000000..28c893a2e --- /dev/null +++ b/qcsrc/menu/command/_mod.qh @@ -0,0 +1,3 @@ +// generated file; do not modify +#include "all.qh" +#include "menu_cmd.qh" diff --git a/qcsrc/menu/command/all.qc b/qcsrc/menu/command/all.qc index 283cca0c1..2f8df96b6 100644 --- a/qcsrc/menu/command/all.qc +++ b/qcsrc/menu/command/all.qc @@ -1 +1,3 @@ +#include "all.qh" + #include diff --git a/qcsrc/menu/command/all.qh b/qcsrc/menu/command/all.qh new file mode 100644 index 000000000..6f70f09be --- /dev/null +++ b/qcsrc/menu/command/all.qh @@ -0,0 +1 @@ +#pragma once diff --git a/qcsrc/menu/item/_mod.qh b/qcsrc/menu/item/_mod.qh new file mode 100644 index 000000000..7dc1d1e67 --- /dev/null +++ b/qcsrc/menu/item/_mod.qh @@ -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" diff --git a/qcsrc/menu/matrix.qc b/qcsrc/menu/matrix.qc index b0c4ec880..3039b4a7d 100644 --- a/qcsrc/menu/matrix.qc +++ b/qcsrc/menu/matrix.qc @@ -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 index 000000000..6f70f09be --- /dev/null +++ b/qcsrc/menu/matrix.qh @@ -0,0 +1 @@ +#pragma once diff --git a/qcsrc/menu/mutators/_mod.qh b/qcsrc/menu/mutators/_mod.qh new file mode 100644 index 000000000..98fb4815c --- /dev/null +++ b/qcsrc/menu/mutators/_mod.qh @@ -0,0 +1 @@ +// generated file; do not modify diff --git a/qcsrc/menu/progs.inc b/qcsrc/menu/progs.inc index 57a34c36c..3707ec886 100644 --- a/qcsrc/menu/progs.inc +++ b/qcsrc/menu/progs.inc @@ -1,14 +1,18 @@ #include -#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 -#include + #include "_mod.inc" + #include "anim/_mod.inc" + #include "command/_mod.inc" + #include "item/_mod.inc" + #include "mutators/_mod.inc" + #include "xonotic/_mod.inc" + + #include +#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 index 000000000..0ae661828 --- /dev/null +++ b/qcsrc/menu/xonotic/_mod.qh @@ -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 index 000000000..c8b679eea --- /dev/null +++ b/qcsrc/server/_mod.qh @@ -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 index 000000000..0bb1e7070 --- /dev/null +++ b/qcsrc/server/bot/_mod.qh @@ -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 index 000000000..861388668 --- /dev/null +++ b/qcsrc/server/bot/havocbot/_mod.qh @@ -0,0 +1,3 @@ +// generated file; do not modify +#include "havocbot.qh" +#include "roles.qh" diff --git a/qcsrc/server/cl_player.qc b/qcsrc/server/cl_player.qc index 8aaf68cda..0713fc3ef 100644 --- a/qcsrc/server/cl_player.qc +++ b/qcsrc/server/cl_player.qc @@ -29,6 +29,8 @@ #include "../common/animdecide.qh" +#include + void Drop_Special_Items(entity player) { // called when the player has become stuck or frozen diff --git a/qcsrc/server/command/_mod.inc b/qcsrc/server/command/_mod.inc index 1f2b37a0d..652bf04f3 100644 --- a/qcsrc/server/command/_mod.inc +++ b/qcsrc/server/command/_mod.inc @@ -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 index 000000000..c06b48de8 --- /dev/null +++ b/qcsrc/server/command/_mod.qh @@ -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" diff --git a/qcsrc/server/matrix.qc b/qcsrc/server/matrix.qc index b7d26decf..602d75132 100644 --- a/qcsrc/server/matrix.qc +++ b/qcsrc/server/matrix.qc @@ -2,6 +2,8 @@ #include "cl_player.qh" +#include + 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 index 000000000..56565b078 --- /dev/null +++ b/qcsrc/server/mutators/_mod.qh @@ -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 index 000000000..7e0e33665 --- /dev/null +++ b/qcsrc/server/mutators/mutator/_mod.qh @@ -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 index 000000000..992b83a9d --- /dev/null +++ b/qcsrc/server/pathlib/_mod.qh @@ -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" diff --git a/qcsrc/server/progs.inc b/qcsrc/server/progs.inc index 2c7eb9253..7529a6a07 100644 --- a/qcsrc/server/progs.inc +++ b/qcsrc/server/progs.inc @@ -1,28 +1,35 @@ -#ifndef DEBUGPATHING - #define DEBUGPATHING 0 -#endif - #include -#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 + + #ifndef DEBUGPATHING + #define DEBUGPATHING 0 + #endif + + #include "_all.qh" -#include -#include + #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 + #include + #include + + #include + + #include + #include + #include + #include +#endif -#include -#include -#include -#include +#include #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 index 000000000..fd903bf83 --- /dev/null +++ b/qcsrc/server/weapons/_mod.qh @@ -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" diff --git a/qcsrc/tools/compilationunits.sh b/qcsrc/tools/compilationunits.sh index 3c794e93f..0a03de360 100755 --- a/qcsrc/tools/compilationunits.sh +++ b/qcsrc/tools/compilationunits.sh @@ -9,6 +9,7 @@ CPP="cc -xc -E" declare -a QCCDEFS=( -DNDEBUG=1 + -DXONOTIC=1 -DWATERMARK="\"$(git describe --tags --dirty='~')\"" -DDEBUGPATHING=0 ) diff --git a/qcsrc/tools/genmod.sh b/qcsrc/tools/genmod.sh index 269c631f7..f133e9784 100755 --- a/qcsrc/tools/genmod.sh +++ b/qcsrc/tools/genmod.sh @@ -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) diff --git a/qcsrc/tools/headerstyle.sh b/qcsrc/tools/headerstyle.sh index ef1731592..b638927bf 100755 --- a/qcsrc/tools/headerstyle.sh +++ b/qcsrc/tools/headerstyle.sh @@ -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 -- 2.39.2