From 4962f82f89d5f5ba7dfd3bb4ff9586c122b18bb3 Mon Sep 17 00:00:00 2001 From: Marco Hladik Date: Sat, 24 Oct 2020 13:11:02 +0200 Subject: [PATCH] Move entity-update/event definitions for game-specific cases out of root src/shared. --- src/client/cstrike/progs.src | 2 +- src/shared/cstrike/defs.h | 2 ++ src/shared/cstrike/entities.h | 20 ++++++++++++++++++++ src/shared/cstrike/events.h | 23 +++++++++++++++++++++++ src/shared/entities.h | 11 +++-------- src/shared/events.h | 11 ++--------- src/shared/gearbox/include.src | 1 + src/shared/hunger/include.src | 1 + src/shared/scihunt/include.src | 1 + src/shared/valve/entities.h | 20 ++++++++++++++++++++ src/shared/valve/include.src | 1 + 11 files changed, 75 insertions(+), 18 deletions(-) create mode 100644 src/shared/cstrike/entities.h create mode 100644 src/shared/cstrike/events.h create mode 100644 src/shared/valve/entities.h diff --git a/src/client/cstrike/progs.src b/src/client/cstrike/progs.src index 714c382e..7d36bfcb 100644 --- a/src/client/cstrike/progs.src +++ b/src/client/cstrike/progs.src @@ -10,8 +10,8 @@ #includelist ../../shared/fteextensions.qc -../../shared/cstrike/defs.h ../../shared/defs.h +../../shared/cstrike/defs.h ../cstrike/defs.h ../defs.h diff --git a/src/shared/cstrike/defs.h b/src/shared/cstrike/defs.h index 1433b89a..120ce2cf 100644 --- a/src/shared/cstrike/defs.h +++ b/src/shared/cstrike/defs.h @@ -18,6 +18,8 @@ #include "radio.h" #include "weapons.h" #include "items.h" +#include "entities.h" +#include "events.h" #define TEAM_T 1 #define TEAM_CT 2 diff --git a/src/shared/cstrike/entities.h b/src/shared/cstrike/entities.h new file mode 100644 index 00000000..49d7ee10 --- /dev/null +++ b/src/shared/cstrike/entities.h @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2016-2020 Marco Hladik + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER + * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING + * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +enum +{ + ENT_C4BOMB = ENT_SEPARATOR, +}; diff --git a/src/shared/cstrike/events.h b/src/shared/cstrike/events.h new file mode 100644 index 00000000..1204c4dc --- /dev/null +++ b/src/shared/cstrike/events.h @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2016-2020 Marco Hladik + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER + * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING + * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +enum +{ + EV_RADIOMSG = EV_SEPARATOR, + EV_RADIOMSG2, + EV_SMOKE, + EV_FLASH +}; diff --git a/src/shared/entities.h b/src/shared/entities.h index a0636858..57ebbed3 100644 --- a/src/shared/entities.h +++ b/src/shared/entities.h @@ -14,7 +14,7 @@ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* TODO: Split game-specific ones into one of the shared folders... */ +/* entity update identifiers */ enum { ENT_ENTITY = 1, @@ -24,13 +24,8 @@ enum ENT_ENVLASER, ENT_SPRITE, ENT_SPRAY, -#ifdef VALVE - ENT_TRIPMINE, -#endif -#ifdef CSTRIKE - ENT_C4BOMB, -#endif - ENT_DECAL + ENT_DECAL, + ENT_SEPARATOR }; /* entity update flags */ diff --git a/src/shared/events.h b/src/shared/events.h index 82d9adeb..de247835 100644 --- a/src/shared/events.h +++ b/src/shared/events.h @@ -14,7 +14,7 @@ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -// Network Events +/* one-time network events */ enum { EV_INTERMISSION, @@ -46,13 +46,6 @@ enum EV_CHAT, EV_CHAT_TEAM, EV_CHAT_VOX, -#ifdef VALVE EV_VIEWMODEL, -#endif -#ifdef CSTRIKE - EV_RADIOMSG, - EV_RADIOMSG2, - EV_SMOKE, - EV_FLASH, -#endif + EV_SEPARATOR }; diff --git a/src/shared/gearbox/include.src b/src/shared/gearbox/include.src index f1069b69..82f048e4 100644 --- a/src/shared/gearbox/include.src +++ b/src/shared/gearbox/include.src @@ -1,4 +1,5 @@ #includelist +../../shared/valve/entities.h ../../shared/valve/flags.h ../../shared/sound.c ../../shared/gearbox/player.cpp diff --git a/src/shared/hunger/include.src b/src/shared/hunger/include.src index 89dd752d..aee5fc42 100644 --- a/src/shared/hunger/include.src +++ b/src/shared/hunger/include.src @@ -1,4 +1,5 @@ #includelist +../../shared/valve/entities.h ../../shared/valve/flags.h ../../shared/sound.c ../../shared/hunger/player.cpp diff --git a/src/shared/scihunt/include.src b/src/shared/scihunt/include.src index c58b0577..ba6e9545 100644 --- a/src/shared/scihunt/include.src +++ b/src/shared/scihunt/include.src @@ -1,4 +1,5 @@ #includelist +../../shared/valve/entities.h ../../shared/valve/flags.h ../../shared/sound.c ../../shared/scihunt/player.cpp diff --git a/src/shared/valve/entities.h b/src/shared/valve/entities.h new file mode 100644 index 00000000..9d2beb53 --- /dev/null +++ b/src/shared/valve/entities.h @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2016-2020 Marco Hladik + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER + * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING + * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +enum +{ + ENT_TRIPMINE = ENT_SEPARATOR +}; diff --git a/src/shared/valve/include.src b/src/shared/valve/include.src index 3c7f6248..65f3d2e4 100644 --- a/src/shared/valve/include.src +++ b/src/shared/valve/include.src @@ -1,4 +1,5 @@ #includelist +../../shared/valve/entities.h ../../shared/valve/flags.h ../../shared/sound.c ../../shared/valve/player.cpp