From 79f8e8d5cfdd67d25f574bebec19d0a6f31eb20a Mon Sep 17 00:00:00 2001 From: TimePath Date: Fri, 1 May 2015 23:46:42 +1000 Subject: [PATCH] Make client includes order insensitive --- qcsrc/client/announcer.qh | 6 ++++ qcsrc/client/casings.qc | 4 +++ qcsrc/client/casings.qh | 8 +++++ qcsrc/client/command/cl_cmd.qc | 11 ++++++ qcsrc/client/csqcmodel_hooks.qc | 4 +++ qcsrc/client/csqcmodel_hooks.qh | 6 ++++ qcsrc/client/damage.qc | 13 +++++-- qcsrc/client/damage.qh | 3 ++ qcsrc/client/defs.qh | 4 +-- qcsrc/client/effects.qh | 6 ++++ qcsrc/client/gibs.qc | 14 ++++++++ qcsrc/client/hook.qc | 9 +++++ qcsrc/client/hook.qh | 9 +++++ qcsrc/client/hud.qc | 33 +++++++----------- qcsrc/client/hud.qh | 32 ++++++++++++++++++ qcsrc/client/hud_config.qc | 1 + qcsrc/client/hud_config.qh | 14 ++++++++ qcsrc/client/laser.qc | 1 + qcsrc/client/laser.qh | 6 ++++ qcsrc/client/main.qc | 29 ++++++++++++++++ qcsrc/client/main.qh | 4 +++ qcsrc/client/mapvoting.qc | 9 +++++ qcsrc/client/mapvoting.qh | 2 ++ qcsrc/client/miscfunctions.qc | 10 +++++- qcsrc/client/modeleffects.qc | 7 ++++ qcsrc/client/particles.qc | 7 ++++ qcsrc/client/player_skeleton.qc | 1 + qcsrc/client/player_skeleton.qh | 2 ++ qcsrc/client/scoreboard.qc | 13 +++++++ qcsrc/client/scoreboard.qh | 1 + qcsrc/client/shownames.qc | 2 ++ qcsrc/client/shownames.qh | 3 ++ qcsrc/client/target_music.qc | 15 +++++++++ qcsrc/client/teamradar.qc | 7 ++++ qcsrc/client/tturrets.qc | 17 ++++++++++ qcsrc/client/tuba.qc | 6 ++++ qcsrc/client/vehicles/vehicles.qc | 41 +++++++++++------------ qcsrc/client/vehicles/vehicles.qh | 7 ++++ qcsrc/client/view.qc | 9 +++++ qcsrc/client/wall.qc | 10 ++++++ qcsrc/client/waypointsprites.qc | 15 +++++++++ qcsrc/client/weapons/projectile.qc | 13 +++++++ qcsrc/common/buffs.qh | 2 ++ qcsrc/common/command/generic.qh | 1 + qcsrc/common/counting.qh | 2 ++ qcsrc/common/mapinfo.qh | 2 ++ qcsrc/common/monsters/{all.qh => all.inc} | 6 ---- qcsrc/common/monsters/monsters.qc | 2 +- qcsrc/common/monsters/monsters.qh | 4 ++- qcsrc/common/nades.qh | 2 ++ qcsrc/common/notifications.qh | 2 ++ qcsrc/test/compilationunit.sh | 20 +++++++++++ 52 files changed, 401 insertions(+), 56 deletions(-) create mode 100644 qcsrc/client/announcer.qh create mode 100644 qcsrc/client/casings.qh create mode 100644 qcsrc/client/csqcmodel_hooks.qh create mode 100644 qcsrc/client/effects.qh create mode 100644 qcsrc/client/hook.qh create mode 100644 qcsrc/client/hud_config.qh create mode 100644 qcsrc/client/laser.qh rename qcsrc/common/monsters/{all.qh => all.inc} (63%) create mode 100755 qcsrc/test/compilationunit.sh diff --git a/qcsrc/client/announcer.qh b/qcsrc/client/announcer.qh new file mode 100644 index 000000000..620b84544 --- /dev/null +++ b/qcsrc/client/announcer.qh @@ -0,0 +1,6 @@ +#ifndef ANNOUNCER_H +#define ANNOUNCER_H + +void Announcer(); + +#endif diff --git a/qcsrc/client/casings.qc b/qcsrc/client/casings.qc index 8112afb53..97f627123 100644 --- a/qcsrc/client/casings.qc +++ b/qcsrc/client/casings.qc @@ -1,4 +1,8 @@ #if defined(CSQC) + #include "autocvars.qh" + #include "../common/util.qh" + #include "defs.qh" + #include "main.qh" #include "movetypes.qh" #include "prandom.qh" #include "rubble.qh" diff --git a/qcsrc/client/casings.qh b/qcsrc/client/casings.qh new file mode 100644 index 000000000..dafe66a55 --- /dev/null +++ b/qcsrc/client/casings.qh @@ -0,0 +1,8 @@ +#ifndef CASINGS_H +#define CASINGS_H + +void Casings_Precache(); + +void Ent_Casing(float isNew); + +#endif diff --git a/qcsrc/client/command/cl_cmd.qc b/qcsrc/client/command/cl_cmd.qc index 7b74d2dd7..8b5fc5153 100644 --- a/qcsrc/client/command/cl_cmd.qc +++ b/qcsrc/client/command/cl_cmd.qc @@ -3,8 +3,19 @@ // Last updated: December 28th, 2011 // ============================================== +#include "cl_cmd.qh" + +#include "../../common/mapinfo.qh" #include "../../common/command/generic.qh" #include "../../common/command/shared_defs.qh" +#include "../autocvars.qh" +#include "../defs.qh" +#include "../hud.qh" +#include "../hud_config.qh" +#include "../main.qh" +#include "../mapvoting.qh" +#include "../miscfunctions.qh" +#include "../scoreboard.qh" void DrawDebugModel() { diff --git a/qcsrc/client/csqcmodel_hooks.qc b/qcsrc/client/csqcmodel_hooks.qc index dde446182..987d166fe 100644 --- a/qcsrc/client/csqcmodel_hooks.qc +++ b/qcsrc/client/csqcmodel_hooks.qc @@ -1,13 +1,17 @@ #if defined(CSQC) + #include "defs.qh" #include "gibs.qh" #include "miscfunctions.qh" #include "player_skeleton.qh" #include "sortlist.qh" + #include "main.qh" + #include "../client/autocvars.qh" #include "../client/weapons/projectile.qh" #include "../common/animdecide.qh" #include "../common/csqcmodel_settings.qh" + #include "../common/teams.qh" #include "../csqcmodellib/cl_model.qh" #include "../csqcmodellib/cl_player.qh" diff --git a/qcsrc/client/csqcmodel_hooks.qh b/qcsrc/client/csqcmodel_hooks.qh new file mode 100644 index 000000000..899588059 --- /dev/null +++ b/qcsrc/client/csqcmodel_hooks.qh @@ -0,0 +1,6 @@ +#ifndef CSQCMODEL_HOOKS +#define CSQCMODEL_HOOKS + +void CSQCPlayer_Precache(); + +#endif diff --git a/qcsrc/client/damage.qc b/qcsrc/client/damage.qc index 000ef8bcc..112b1ad8d 100644 --- a/qcsrc/client/damage.qc +++ b/qcsrc/client/damage.qc @@ -1,19 +1,26 @@ #if defined(CSQC) #include "../dpdefs/csprogsdefs.qh" - #include "defs.qh" #include "../common/constants.qh" #include "../common/util.qh" + #include "../common/deathtypes.qh" #include "../common/weapons/weapons.qh" + #include "vehicles/vehicles.qh" #include "autocvars.qh" - #include "../common/deathtypes.qh" + #include "defs.qh" #include "damage.qh" + #include "gibs.qh" #include "movetypes.qh" #include "prandom.qh" - #include "vehicles/vehicles.qh" #elif defined(MENUQC) #elif defined(SVQC) #endif +.entity tag_entity; + +.float cnt; +.int state; +.bool isplayermodel; + void DamageEffect_Think() { // if particle distribution is enabled, slow ticrate by total number of damages diff --git a/qcsrc/client/damage.qh b/qcsrc/client/damage.qh index 7c5c74130..0de69a02d 100644 --- a/qcsrc/client/damage.qh +++ b/qcsrc/client/damage.qh @@ -2,4 +2,7 @@ #define DAMAGE_H .float total_damages; // number of effects which currently are attached to a player + +void Ent_DamageInfo(float isNew); + #endif diff --git a/qcsrc/client/defs.qh b/qcsrc/client/defs.qh index 82c43e2e2..6325a8ab3 100644 --- a/qcsrc/client/defs.qh +++ b/qcsrc/client/defs.qh @@ -1,5 +1,5 @@ -#ifndef DEFS_H -#define DEFS_H +#ifndef CLIENT_DEFS_H +#define CLIENT_DEFS_H // Additional OPTIONAL Fields and Globals //float intermission; diff --git a/qcsrc/client/effects.qh b/qcsrc/client/effects.qh new file mode 100644 index 000000000..0bebdb95d --- /dev/null +++ b/qcsrc/client/effects.qh @@ -0,0 +1,6 @@ +#ifndef EFFECTS_H +#define EFFECTS_H + +void Net_ReadArc(); + +#endif diff --git a/qcsrc/client/gibs.qc b/qcsrc/client/gibs.qc index eb7d47877..8247f6a28 100644 --- a/qcsrc/client/gibs.qc +++ b/qcsrc/client/gibs.qc @@ -1,5 +1,19 @@ #include "gibs.qh" +#include "autocvars.qh" +#include "defs.qh" +#include "main.qh" +#include "movetypes.qh" +#include "prandom.qh" +#include "rubble.qh" +#include "../common/constants.qh" +#include "../common/util.qh" + +.float scale; +.float alpha; +.float cnt; +.float gravity; + void Gib_Delete() { remove(self); diff --git a/qcsrc/client/hook.qc b/qcsrc/client/hook.qc index cfc192c84..226934edb 100644 --- a/qcsrc/client/hook.qc +++ b/qcsrc/client/hook.qc @@ -1,6 +1,15 @@ +#include "hook.qh" + +#include "autocvars.qh" +#include "defs.qh" #include "hud.qh" +#include "main.qh" +#include "miscfunctions.qh" #include "noise.qh" +#include "../common/teams.qh" #include "../warpzonelib/common.qh" +#include "../warpzonelib/mathlib.qh" +#include "../csqcmodellib/interpolate.qh" entityclass(Hook) class(Hook) .float HookType; // ENT_CLIENT_* diff --git a/qcsrc/client/hook.qh b/qcsrc/client/hook.qh new file mode 100644 index 000000000..8401dce04 --- /dev/null +++ b/qcsrc/client/hook.qh @@ -0,0 +1,9 @@ +#ifndef HOOK_H +#define HOOK_H + +void Draw_CylindricLine(vector from, vector to, float thickness, string texture, float aspect, float shift, vector rgb, float theAlpha, float drawflag, vector vieworg); +void Hook_Precache(); + +void Ent_ReadHook(float bIsNew, float type); + +#endif diff --git a/qcsrc/client/hud.qc b/qcsrc/client/hud.qc index 0da1b69d2..5a6a13737 100644 --- a/qcsrc/client/hud.qc +++ b/qcsrc/client/hud.qc @@ -1,10 +1,23 @@ +#include "hud.qh" + +#include "autocvars.qh" +#include "defs.qh" +#include "hud_config.qh" +#include "main.qh" +#include "miscfunctions.qh" #include "scoreboard.qh" +#include "sortlist.qh" #include "teamradar.qh" #include "../common/buffs.qh" +#include "../common/constants.qh" #include "../common/counting.qh" +#include "../common/deathtypes.qh" #include "../common/mapinfo.qh" #include "../common/nades.qh" +#include "../common/stats.qh" +#include "../csqcmodellib/cl_player.qh" #include "../server/t_items.qh" +#include "../warpzonelib/mathlib.qh" /* ================== @@ -1485,17 +1498,6 @@ void HUD_Powerups(void) // Health/armor (#3) // -// prev_* vars contain the health/armor at the previous FRAME -// set to -1 when player is dead or was not playing -int prev_health, prev_armor; -float health_damagetime, armor_damagetime; -int health_beforedamage, armor_beforedamage; -// old_p_* vars keep track of previous values when smoothing value changes of the progressbar -int old_p_health, old_p_armor; -float old_p_healthtime, old_p_armortime; -// prev_p_* vars contain the health/armor progressbar value at the previous FRAME -// set to -1 to forcedly stop effects when we switch spectated player (e.g. from playerX: 70h to playerY: 50h) -int prev_p_health, prev_p_armor; void HUD_HealthArmor(void) { @@ -2624,15 +2626,6 @@ void HUD_RaceTimer (void) // Vote window (#9) // -int vote_yescount; -int vote_nocount; -int vote_needed; -int vote_highlighted; // currently selected vote - -int vote_active; // is there an active vote? -int vote_prev; // previous state of vote_active to check for a change -float vote_alpha; -float vote_change; // "time" when vote_active changed void HUD_Vote(void) { diff --git a/qcsrc/client/hud.qh b/qcsrc/client/hud.qh index acff23a28..bebf60c77 100644 --- a/qcsrc/client/hud.qh +++ b/qcsrc/client/hud.qh @@ -12,6 +12,19 @@ int HUD_PANEL_LAST; int panel_order[HUD_PANEL_MAX]; string hud_panelorder_prev; +void HUD_Reset (void); +void HUD_Main (void); + +int vote_yescount; +int vote_nocount; +int vote_needed; +int vote_highlighted; // currently selected vote + +int vote_active; // is there an active vote? +int vote_prev; // previous state of vote_active to check for a change +float vote_alpha; +float vote_change; // "time" when vote_active changed + float hud_draw_maximized; float hud_panel_radar_maximized; float chat_panel_modified; @@ -104,6 +117,25 @@ float current_player; float GetPlayerColorForce(int i); +float stringwidth_colors(string s, vector theSize); +int GetPlayerColor(int i); +string GetPlayerName(int i); +float stringwidth_nocolors(string s, vector theSize); +void HUD_Panel_DrawProgressBar(vector theOrigin, vector theSize, string pic, float length_ratio, bool vertical, float baralign, vector theColor, float theAlpha, int drawflag); + + +// prev_* vars contain the health/armor at the previous FRAME +// set to -1 when player is dead or was not playing +int prev_health, prev_armor; +float health_damagetime, armor_damagetime; +int health_beforedamage, armor_beforedamage; +// old_p_* vars keep track of previous values when smoothing value changes of the progressbar +int old_p_health, old_p_armor; +float old_p_healthtime, old_p_armortime; +// prev_p_* vars contain the health/armor progressbar value at the previous FRAME +// set to -1 to forcedly stop effects when we switch spectated player (e.g. from playerX: 70h to playerY: 50h) +int prev_p_health, prev_p_armor; + #define HUD_PANELS(HUD_PANEL) \ HUD_PANEL(WEAPONS , HUD_Weapons , weapons) \ diff --git a/qcsrc/client/hud_config.qc b/qcsrc/client/hud_config.qc index 4ddc049ba..6a2101fc7 100644 --- a/qcsrc/client/hud_config.qc +++ b/qcsrc/client/hud_config.qc @@ -1,6 +1,7 @@ #if defined(CSQC) #include "../dpdefs/csprogsdefs.qh" #include "defs.qh" + #include "miscfunctions.qh" #include "../dpdefs/keycodes.qh" #include "../common/constants.qh" #include "autocvars.qh" diff --git a/qcsrc/client/hud_config.qh b/qcsrc/client/hud_config.qh new file mode 100644 index 000000000..cc1d4d563 --- /dev/null +++ b/qcsrc/client/hud_config.qh @@ -0,0 +1,14 @@ +#ifndef HUD_CONFIG_H +#define HUD_CONFIG_H + +void HUD_Panel_ExportCfg(string cfgname); + +void HUD_Panel_Mouse(); + +void HUD_Configure_Frame(); + +void HUD_Configure_PostDraw(); + +float HUD_Panel_InputEvent(float bInputType, float nPrimary, float nSecondary); + +#endif diff --git a/qcsrc/client/laser.qc b/qcsrc/client/laser.qc index 5796157ef..ae4f6c277 100644 --- a/qcsrc/client/laser.qc +++ b/qcsrc/client/laser.qc @@ -2,6 +2,7 @@ #include "../dpdefs/csprogsdefs.qh" #include "../common/buffs.qh" #include "../csqcmodellib/interpolate.qh" + #include "hook.qh" #include "main.qh" #include "../csqcmodellib/cl_model.qh" #elif defined(MENUQC) diff --git a/qcsrc/client/laser.qh b/qcsrc/client/laser.qh new file mode 100644 index 000000000..86210eee1 --- /dev/null +++ b/qcsrc/client/laser.qh @@ -0,0 +1,6 @@ +#ifndef LASER_H +#define LASER_H + +void Ent_Laser(); + +#endif diff --git a/qcsrc/client/main.qc b/qcsrc/client/main.qc index 36ec4f7b8..fc78f3a80 100644 --- a/qcsrc/client/main.qc +++ b/qcsrc/client/main.qc @@ -1,21 +1,50 @@ +#include "main.qh" + +#include "casings.qh" +#include "csqcmodel_hooks.qh" +#include "damage.qh" +#include "defs.qh" +#include "effects.qh" +#include "gibs.qh" +#include "hud.qh" +#include "hud_config.qh" +#include "hook.qh" +#include "laser.qh" #include "mapvoting.qh" #include "modeleffects.qh" #include "particles.qh" #include "scoreboard.qh" #include "shownames.qh" +#include "sortlist.qh" #include "target_music.qh" #include "tturrets.qh" #include "tuba.qh" #include "wall.qh" #include "waypointsprites.qh" +#include "miscfunctions.qh" +#include "prandom.qh" #include "vehicles/vehicles.qh" +#include "weapons/projectile.qh" + #include "../server/vehicles/bumblebee.qh" +#include "../server/t_items.qh" +#include "../common/buffs.qh" +#include "../common/deathtypes.qh" +#include "../common/mapinfo.qh" +#include "../common/notifications.qh" #include "../common/net_notice.qh" +#include "../common/stats.qh" +#include "../common/teams.qh" +#include "../common/weapons/weapons.qh" #include "../common/monsters/monsters.qh" +#include "../common/nades.qh" + +#include "../csqcmodellib/cl_model.qh" +#include "../csqcmodellib/interpolate.qh" #include "../warpzonelib/client.qh" diff --git a/qcsrc/client/main.qh b/qcsrc/client/main.qh index b8823e629..0bc85a441 100644 --- a/qcsrc/client/main.qh +++ b/qcsrc/client/main.qh @@ -1,6 +1,8 @@ #ifndef MAIN_H #define MAIN_H +#include "../common/constants.qh" + // -------------------------------------------------------------------------- // MENU Functionality @@ -106,6 +108,8 @@ float current_viewzoom; float zoomin_effect; float warmup_stage; +void Fog_Force(); + string getcommandkey(string text, string command); string vote_called_vote; diff --git a/qcsrc/client/mapvoting.qc b/qcsrc/client/mapvoting.qc index 28b81fc51..a4a4b687f 100644 --- a/qcsrc/client/mapvoting.qc +++ b/qcsrc/client/mapvoting.qc @@ -1,6 +1,15 @@ #include "mapvoting.qh" +#include "hud.qh" +#include "../dpdefs/keycodes.qh" +#include "autocvars.qh" +#include "defs.qh" +#include "main.qh" +#include "../common/mapinfo.qh" +#include "miscfunctions.qh" #include "scoreboard.qh" +#include "../common/util.qh" + string MapVote_FormatMapItem(int id, string map, float _count, float maxwidth, vector fontsize) { string pre, post; diff --git a/qcsrc/client/mapvoting.qh b/qcsrc/client/mapvoting.qh index 8a4133e50..cb7b4c645 100644 --- a/qcsrc/client/mapvoting.qh +++ b/qcsrc/client/mapvoting.qh @@ -1,6 +1,8 @@ #ifndef MAPVOTING_H #define MAPVOTING_H +#include "../common/constants.qh" + int mv_num_maps; float mv_active; diff --git a/qcsrc/client/miscfunctions.qc b/qcsrc/client/miscfunctions.qc index d74a24a32..70ec94db4 100644 --- a/qcsrc/client/miscfunctions.qc +++ b/qcsrc/client/miscfunctions.qc @@ -1,8 +1,16 @@ #include "miscfunctions.qh" +#include "../common/teams.qh" #include "../common/urllib.qh" - +#include "../common/util.qh" #include "../common/command/generic.qh" +#include "../csqcmodellib/cl_model.qh" +#include "../warpzonelib/mathlib.qh" +#include "autocvars.qh" +#include "defs.qh" +#include "hud.qh" +#include "main.qh" +#include "sortlist.qh" void AuditLists() { diff --git a/qcsrc/client/modeleffects.qc b/qcsrc/client/modeleffects.qc index c376085e0..1eea25d8f 100644 --- a/qcsrc/client/modeleffects.qc +++ b/qcsrc/client/modeleffects.qc @@ -1,5 +1,12 @@ #include "modeleffects.qh" +#include "defs.qh" +#include "main.qh" + +.float cnt; +.float scale; +.float alpha; + void ModelEffect_Draw() { self.angles = self.angles + frametime * self.avelocity; diff --git a/qcsrc/client/particles.qc b/qcsrc/client/particles.qc index 6d2ddf87d..25fc5da29 100644 --- a/qcsrc/client/particles.qc +++ b/qcsrc/client/particles.qc @@ -1,5 +1,12 @@ #include "particles.qh" +#include "../common/util.qh" +#include "autocvars.qh" +#include "bgmscript.qh" +#include "main.qh" +#include "../common/stats.qh" +#include "../warpzonelib/common.qh" + void Draw_PointParticles() { float n, i, fail; diff --git a/qcsrc/client/player_skeleton.qc b/qcsrc/client/player_skeleton.qc index e1d85b3dd..74064c7ec 100644 --- a/qcsrc/client/player_skeleton.qc +++ b/qcsrc/client/player_skeleton.qc @@ -1,5 +1,6 @@ #include "player_skeleton.qh" +#include "../common/csqcmodel_settings.qh" #include "../warpzonelib/anglestransform.qh" class(Skeleton) .float skeleton_info_modelindex; diff --git a/qcsrc/client/player_skeleton.qh b/qcsrc/client/player_skeleton.qh index 4f80c71d8..de177a533 100644 --- a/qcsrc/client/player_skeleton.qh +++ b/qcsrc/client/player_skeleton.qh @@ -1,6 +1,8 @@ #ifndef PLAYER_SKELETON #define PLAYER_SKELETON +#include "../common/util.qh" + void free_skeleton_from_frames(entity e); void skeleton_from_frames(entity e, float is_dead); void skeleton_loadinfo(entity e); diff --git a/qcsrc/client/scoreboard.qc b/qcsrc/client/scoreboard.qc index c6d871807..9f0db018d 100644 --- a/qcsrc/client/scoreboard.qc +++ b/qcsrc/client/scoreboard.qc @@ -1,5 +1,18 @@ #include "scoreboard.qh" +#include "autocvars.qh" +#include "miscfunctions.qh" +#include "../common/constants.qh" +#include "../common/counting.qh" +#include "../common/mapinfo.qh" +#include "../common/stats.qh" +#include "../common/teams.qh" +#include "../common/util.qh" +#include "defs.qh" +#include "hud.qh" +#include "main.qh" +#include "sortlist.qh" + float scoreboard_alpha_bg; float scoreboard_alpha_fg; float scoreboard_highlight; diff --git a/qcsrc/client/scoreboard.qh b/qcsrc/client/scoreboard.qh index c0326eb78..e1c5addb4 100644 --- a/qcsrc/client/scoreboard.qh +++ b/qcsrc/client/scoreboard.qh @@ -7,6 +7,7 @@ float scoreboard_active; float scoreboard_fade_alpha; void Cmd_HUD_SetFields(float argc); +void HUD_DrawScoreboard(); void HUD_InitScores(); void HUD_UpdatePlayerPos(entity pl); void HUD_UpdateTeamPos(entity Team); diff --git a/qcsrc/client/shownames.qc b/qcsrc/client/shownames.qc index c6edf5040..7fe0e49a7 100644 --- a/qcsrc/client/shownames.qc +++ b/qcsrc/client/shownames.qc @@ -9,6 +9,8 @@ #include "main.qh" #include "../csqcmodellib/cl_model.qh" #include "shownames.qh" + #include "hud.qh" + #include "miscfunctions.qh" #elif defined(MENUQC) #elif defined(SVQC) #endif diff --git a/qcsrc/client/shownames.qh b/qcsrc/client/shownames.qh index 4d4478ca1..0d7df029a 100644 --- a/qcsrc/client/shownames.qh +++ b/qcsrc/client/shownames.qh @@ -7,4 +7,7 @@ class(ShowNames) .float armorvalue; class(ShowNames) .float sameteam; class(ShowNames) .float fadedelay; class(ShowNames) .float pointtime; + +void Draw_ShowNames_All(); + #endif diff --git a/qcsrc/client/target_music.qc b/qcsrc/client/target_music.qc index 662a673d7..989bca3ae 100644 --- a/qcsrc/client/target_music.qc +++ b/qcsrc/client/target_music.qc @@ -1,5 +1,20 @@ #include "target_music.qh" +#include "autocvars.qh" +#include "defs.qh" +#include "main.qh" +#include "../common/util.qh" +#include "../common/constants.qh" +#include "../warpzonelib/common.qh" + +.string noise; +.float cnt; +.float count; +.float fade_time; +.float fade_rate; +.float lifetime; +.float volume; + void TargetMusic_Advance() { // run AFTER all the thinks! diff --git a/qcsrc/client/teamradar.qc b/qcsrc/client/teamradar.qc index 1822acb5e..88b4339fb 100644 --- a/qcsrc/client/teamradar.qc +++ b/qcsrc/client/teamradar.qc @@ -1,5 +1,12 @@ #if defined(CSQC) + #include "autocvars.qh" + #include "defs.qh" + #include "hud.qh" + #include "main.qh" + #include "miscfunctions.qh" #include "teamradar.qh" + #include "../common/util.qh" + #include "../csqcmodellib/interpolate.qh" #elif defined(MENUQC) #elif defined(SVQC) #endif diff --git a/qcsrc/client/tturrets.qc b/qcsrc/client/tturrets.qc index 42366687e..9fb1b38bf 100644 --- a/qcsrc/client/tturrets.qc +++ b/qcsrc/client/tturrets.qc @@ -1,7 +1,24 @@ #include "tturrets.qh" + +#include "autocvars.qh" +#include "defs.qh" +#include "main.qh" +#include "hud.qh" +#include "miscfunctions.qh" #include "waypointsprites.qh" +#include "movetypes.qh" +#include "prandom.qh" +#include "teamradar.qh" +#include "../common/teams.qh" #include "../server/movelib.qh" +#include "../warpzonelib/anglestransform.qh" +#include "../warpzonelib/mathlib.qh" + +.vector colormod; +.float cnt; +.float alpha; +.float gravity; string tid2info_base; string tid2info_head; diff --git a/qcsrc/client/tuba.qc b/qcsrc/client/tuba.qc index 95692e87c..93a7a8954 100644 --- a/qcsrc/client/tuba.qc +++ b/qcsrc/client/tuba.qc @@ -1,5 +1,11 @@ #include "tuba.qh" +#include "autocvars.qh" +#include "main.qh" +#include "../common/constants.qh" +#include "../common/util.qh" +#include "../warpzonelib/mathlib.qh" + #define TUBA_STARTNOTE(i, n) strcat("weapons/tuba", (i ? ftos(i) : ""), "_loopnote", ftos(n), ".wav") const int TUBA_MIN = -18; diff --git a/qcsrc/client/vehicles/vehicles.qc b/qcsrc/client/vehicles/vehicles.qc index 0f19c9066..012f05ead 100644 --- a/qcsrc/client/vehicles/vehicles.qc +++ b/qcsrc/client/vehicles/vehicles.qc @@ -1,20 +1,21 @@ -#if defined(CSQC) - #include "../../dpdefs/csprogsdefs.qh" - #include "../defs.qh" - #include "../../common/constants.qh" - #include "../../common/stats.qh" - #include "../../common/util.qh" - #include "../../common/buffs.qh" - #include "../autocvars.qh" - #include "../movetypes.qh" - #include "../prandom.qh" - #include "../main.qh" - #include "vehicles.qh" - #include "../../csqcmodellib/cl_model.qh" - #include "../../server/t_items.qh" -#elif defined(MENUQC) -#elif defined(SVQC) -#endif +#include "../../dpdefs/csprogsdefs.qh" +#include "../../common/constants.qh" +#include "../../common/stats.qh" +#include "../../common/util.qh" +#include "../../common/buffs.qh" +#include "../../csqcmodellib/cl_model.qh" +#include "../../server/t_items.qh" +#include "../defs.qh" +#include "../miscfunctions.qh" +#include "../movetypes.qh" +#include "../scoreboard.qh" +#include "../autocvars.qh" +#include "../movetypes.qh" +#include "../prandom.qh" +#include "../main.qh" +#include "vehicles.qh" + +.float cnt; const string hud_bg = "gfx/vehicles/frame.tga"; const string hud_sh = "gfx/vehicles/vh-shield.tga"; @@ -51,11 +52,7 @@ const string raptor_bomb = "gfx/vehicles/raptor_bombs.tga"; const string raptor_drop = "gfx/vehicles/axh-dropcross.tga"; string raptor_xhair; -void CSQC_WAKIZASHI_HUD(); -void CSQC_SPIDER_HUD(); -void CSQC_RAPTOR_HUD(); -void CSQC_BUMBLE_HUD(); -void CSQC_BUMBLE_GUN_HUD(); + const int MAX_AXH = 4; entity AuxiliaryXhair[MAX_AXH]; diff --git a/qcsrc/client/vehicles/vehicles.qh b/qcsrc/client/vehicles/vehicles.qh index 7e509e91e..e8d3ddb4f 100644 --- a/qcsrc/client/vehicles/vehicles.qh +++ b/qcsrc/client/vehicles/vehicles.qh @@ -6,4 +6,11 @@ void RaptorCBShellfragToss(vector _org, vector _vel, vector _ang); void Vehicles_Precache(); void Net_AuXair2(bool bIsNew); void Net_VehicleSetup(); + +void CSQC_WAKIZASHI_HUD(); +void CSQC_SPIDER_HUD(); +void CSQC_RAPTOR_HUD(); +void CSQC_BUMBLE_HUD(); +void CSQC_BUMBLE_GUN_HUD(); + #endif diff --git a/qcsrc/client/view.qc b/qcsrc/client/view.qc index 26e709320..0188dd7c8 100644 --- a/qcsrc/client/view.qc +++ b/qcsrc/client/view.qc @@ -12,10 +12,19 @@ #include "../common/weapons/weapons.qh" #include "../common/mapinfo.qh" #include "autocvars.qh" + #include "announcer.qh" #include "hud.qh" + #include "hud_config.qh" + #include "hook.qh" + #include "mapvoting.qh" + #include "miscfunctions.qh" #include "scoreboard.qh" + #include "shownames.qh" + #include "target_music.qh" #include "noise.qh" #include "main.qh" + #include "waypointsprites.qh" + #include "vehicles/vehicles.qh" #include "../csqcmodellib/cl_player.qh" #elif defined(MENUQC) #elif defined(SVQC) diff --git a/qcsrc/client/wall.qc b/qcsrc/client/wall.qc index 113b14b37..11b851f8a 100644 --- a/qcsrc/client/wall.qc +++ b/qcsrc/client/wall.qc @@ -1,5 +1,15 @@ #include "wall.qh" +#include "autocvars.qh" +#include "bgmscript.qh" +#include "main.qh" +#include "../common/util.qh" +#include "../csqcmodellib/interpolate.qh" + +.float alpha; +.float scale; +.vector movedir; + void Ent_Wall_Draw() { float f; diff --git a/qcsrc/client/waypointsprites.qc b/qcsrc/client/waypointsprites.qc index 788dd871e..c26f42af4 100644 --- a/qcsrc/client/waypointsprites.qc +++ b/qcsrc/client/waypointsprites.qc @@ -1,5 +1,20 @@ #include "waypointsprites.qh" +#include "autocvars.qh" +#include "defs.qh" +#include "hud.qh" +#include "main.qh" +#include "miscfunctions.qh" +#include "teamradar.qh" +#include "../common/buffs.qh" +#include "../common/constants.qh" +#include "../common/teams.qh" +#include "../common/weapons/weapons.qh" +#include "../csqcmodellib/interpolate.qh" +#include "../warpzonelib/mathlib.qh" + +.float alpha; + void drawrotpic(vector org, float rot, string pic, vector sz, vector hotspot, vector rgb, float a, float f) { vector v1, v2, v3, v4; diff --git a/qcsrc/client/weapons/projectile.qc b/qcsrc/client/weapons/projectile.qc index 1d306fede..e8a2311cd 100644 --- a/qcsrc/client/weapons/projectile.qc +++ b/qcsrc/client/weapons/projectile.qc @@ -1,5 +1,18 @@ +#include "../../common/constants.qh" +#include "../../common/nades.qh" +#include "../../common/util.qh" +#include "../../csqcmodellib/interpolate.qh" +#include "../../warpzonelib/anglestransform.qh" +#include "../autocvars.qh" +#include "../defs.qh" +#include "../main.qh" +#include "../movetypes.qh" #include "projectile.qh" +.float alpha; +.float scale; +.vector colormod; + void SUB_Stop() { self.move_velocity = self.move_avelocity = '0 0 0'; diff --git a/qcsrc/common/buffs.qh b/qcsrc/common/buffs.qh index a629de607..8003fd8b9 100644 --- a/qcsrc/common/buffs.qh +++ b/qcsrc/common/buffs.qh @@ -1,6 +1,8 @@ #ifndef BUFFS_H #define BUFFS_H +#include "util.qh" + entity Buff_Type_first; entity Buff_Type_last; .entity enemy; // internal next pointer diff --git a/qcsrc/common/command/generic.qh b/qcsrc/common/command/generic.qh index 0bb09b4e7..02875f6ea 100644 --- a/qcsrc/common/command/generic.qh +++ b/qcsrc/common/command/generic.qh @@ -1,6 +1,7 @@ #ifndef GENERIC_H #define GENERIC_H +#include "../constants.qh" #include "markup.qh" #include "rpn.qh" diff --git a/qcsrc/common/counting.qh b/qcsrc/common/counting.qh index 17c5f89bc..f464cdc32 100644 --- a/qcsrc/common/counting.qh +++ b/qcsrc/common/counting.qh @@ -1,6 +1,8 @@ #ifndef COUNTING_H #define COUNTING_H +#include "util.qh" + // =============================================== // Time processing and counting functions/macros // =============================================== diff --git a/qcsrc/common/mapinfo.qh b/qcsrc/common/mapinfo.qh index fc7fdbb78..134103b89 100644 --- a/qcsrc/common/mapinfo.qh +++ b/qcsrc/common/mapinfo.qh @@ -1,6 +1,8 @@ #ifndef MAPINFO_H #define MAPINFO_H +#include "util.qh" + int MAPINFO_TYPE_ALL; entity MapInfo_Type_first; entity MapInfo_Type_last; diff --git a/qcsrc/common/monsters/all.qh b/qcsrc/common/monsters/all.inc similarity index 63% rename from qcsrc/common/monsters/all.qh rename to qcsrc/common/monsters/all.inc index c79a4e656..d30f29894 100644 --- a/qcsrc/common/monsters/all.qh +++ b/qcsrc/common/monsters/all.inc @@ -1,11 +1,5 @@ -// TODO: include once -//#ifndef MONSTERS_ALL_H -//#define MONSTERS_ALL_H - #include "monster/zombie.qc" #include "monster/spider.qc" #include "monster/mage.qc" #include "monster/wyvern.qc" #include "monster/shambler.qc" - -//#endif diff --git a/qcsrc/common/monsters/monsters.qc b/qcsrc/common/monsters/monsters.qc index 096c2e5ea..72c5ea870 100644 --- a/qcsrc/common/monsters/monsters.qc +++ b/qcsrc/common/monsters/monsters.qc @@ -1,6 +1,6 @@ #include "monsters.qh" -#include "all.qh" +#include "all.inc" // MONSTER PLUGIN SYSTEM entity monster_info[MON_MAXCOUNT]; diff --git a/qcsrc/common/monsters/monsters.qh b/qcsrc/common/monsters/monsters.qh index 6fa9dfaf7..4aa1f7ef4 100644 --- a/qcsrc/common/monsters/monsters.qh +++ b/qcsrc/common/monsters/monsters.qh @@ -1,6 +1,8 @@ #ifndef MONSTERS_H #define MONSTERS_H +#include "../util.qh" + // monster requests const int MR_SETUP = 1; // (SERVER) setup monster data const int MR_THINK = 2; // (SERVER) logic to run every frame @@ -64,7 +66,7 @@ int MON_LAST; REGISTER_MONSTER_2(MON_##id,func,monsterflags,min_s,max_s,modelname,shortname,mname) #endif -#include "all.qh" +#include "all.inc" #undef REGISTER_MONSTER ACCUMULATE_FUNCTION(RegisterMonsters, register_monsters_done); diff --git a/qcsrc/common/nades.qh b/qcsrc/common/nades.qh index 505e2e2d5..2b2aa857b 100644 --- a/qcsrc/common/nades.qh +++ b/qcsrc/common/nades.qh @@ -1,6 +1,8 @@ #ifndef NADES_H #define NADES_H +#include "teams.qh" + .float healer_lifetime; .float healer_radius; diff --git a/qcsrc/common/notifications.qh b/qcsrc/common/notifications.qh index 1cb1adf51..dda68d791 100644 --- a/qcsrc/common/notifications.qh +++ b/qcsrc/common/notifications.qh @@ -1,8 +1,10 @@ #ifndef NOTIFICATIONS_H #define NOTIFICATIONS_H +#include "autocvars.qh" #include "constants.qh" #include "teams.qh" +#include "util.qh" // ================================================ // Unified notification system, written by Samual diff --git a/qcsrc/test/compilationunit.sh b/qcsrc/test/compilationunit.sh new file mode 100755 index 000000000..b976a4df4 --- /dev/null +++ b/qcsrc/test/compilationunit.sh @@ -0,0 +1,20 @@ +#!/bin/bash +set -eu +cd "$(dirname "$0")" +cd .. + +export QCC=../../../gmqcc/gmqcc + +function check() { + declare -l base="$1" + declare -la predefs=("${!2}") + find "$base" -type f -name '*.qc' -print0 | while IFS= read -r -d '' file; do + echo "$file" + ${QCC} -std=gmqcc -fftepp ${predefs[@]} "$file" >/dev/null + done +} + +# TODO: `sort -V` all the includes + +clientdefs=("-DCSQC" "common/util-pre.qh" "dpdefs/csprogsdefs.qh") +check client clientdefs[@] -- 2.39.2