]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
#includes: cleanup client
authorTimePath <andrew.hardaker1995@gmail.com>
Sat, 10 Oct 2015 02:06:58 +0000 (13:06 +1100)
committerTimePath <andrew.hardaker1995@gmail.com>
Sat, 10 Oct 2015 02:28:19 +0000 (13:28 +1100)
93 files changed:
qcsrc/client/_all.qh
qcsrc/client/announcer.qc
qcsrc/client/announcer.qh
qcsrc/client/bgmscript.qc
qcsrc/client/bgmscript.qh
qcsrc/client/command/all.qc [deleted file]
qcsrc/client/command/all.qh [deleted file]
qcsrc/client/command/cl_cmd.qc [deleted file]
qcsrc/client/command/cl_cmd.qh [deleted file]
qcsrc/client/commands/all.qc [new file with mode: 0644]
qcsrc/client/commands/all.qh [new file with mode: 0644]
qcsrc/client/commands/cl_cmd.qc [new file with mode: 0644]
qcsrc/client/commands/cl_cmd.qh [new file with mode: 0644]
qcsrc/client/controlpoint.qc
qcsrc/client/controlpoint.qh
qcsrc/client/csqc_constants.qh
qcsrc/client/csqcmodel_hooks.qc
qcsrc/client/damage.qc
qcsrc/client/damage.qh
qcsrc/client/effects.qc
qcsrc/client/effects.qh
qcsrc/client/generator.qc
qcsrc/client/generator.qh
qcsrc/client/gibs.qc
qcsrc/client/gibs.qh
qcsrc/client/hook.qc
qcsrc/client/hook.qh
qcsrc/client/hud.qc
qcsrc/client/hud.qh
qcsrc/client/hud_config.qc
qcsrc/client/hud_config.qh
qcsrc/client/laser.qc
qcsrc/client/laser.qh
qcsrc/client/main.qc
qcsrc/client/main.qh
qcsrc/client/mapvoting.qc
qcsrc/client/mapvoting.qh
qcsrc/client/miscfunctions.qc
qcsrc/client/miscfunctions.qh
qcsrc/client/modeleffects.qc
qcsrc/client/modeleffects.qh
qcsrc/client/particles.qc
qcsrc/client/particles.qh
qcsrc/client/player_skeleton.qc
qcsrc/client/player_skeleton.qh
qcsrc/client/progs.inc
qcsrc/client/quickmenu.qc
qcsrc/client/quickmenu.qh [new file with mode: 0644]
qcsrc/client/rubble.qh
qcsrc/client/scoreboard.qc
qcsrc/client/scoreboard.qh
qcsrc/client/shownames.qc
qcsrc/client/shownames.qh
qcsrc/client/t_items.qc
qcsrc/client/teamradar.qc
qcsrc/client/teamradar.qh
qcsrc/client/tuba.qc
qcsrc/client/tuba.qh
qcsrc/client/view.qc
qcsrc/client/wall.qc
qcsrc/client/wall.qh
qcsrc/client/weapons/projectile.qc
qcsrc/client/weapons/projectile.qh
qcsrc/common/animdecide.qc
qcsrc/common/command/generic.qc
qcsrc/common/effects/all.inc [new file with mode: 0644]
qcsrc/common/effects/all.qc [new file with mode: 0644]
qcsrc/common/effects/all.qh [new file with mode: 0644]
qcsrc/common/effects/effect.qh [new file with mode: 0644]
qcsrc/common/effects/effects.inc [deleted file]
qcsrc/common/effects/effects.qc [deleted file]
qcsrc/common/effects/effects.qh [deleted file]
qcsrc/common/minigames/cl_minigames_hud.qc
qcsrc/common/minigames/cl_minigames_hud.qh [new file with mode: 0644]
qcsrc/common/minigames/minigame/pp.qc
qcsrc/common/models/all.qh
qcsrc/common/models/model.qh [new file with mode: 0644]
qcsrc/common/notifications.qh
qcsrc/common/sounds/all.inc
qcsrc/common/sounds/all.qh
qcsrc/common/sounds/sound.qh [new file with mode: 0644]
qcsrc/common/triggers/subs.qh
qcsrc/common/util.qc
qcsrc/common/util.qh
qcsrc/common/vehicles/sv_vehicles.qc
qcsrc/common/vehicles/vehicle/racer.qc
qcsrc/lib/_all.inc
qcsrc/lib/color.qh [new file with mode: 0644]
qcsrc/server/_all.qh
qcsrc/server/cheats.qc
qcsrc/server/g_world.qc
qcsrc/server/progs.inc
qcsrc/test/compilationunit.sh

index 7ae1430d4108b4362ea761adec59162d5f319984..adff5ccff49eef81586f341d4ea2f94f66223ae1 100644 (file)
@@ -1,12 +1,15 @@
 #ifndef CLIENT_ALL_H
 #define CLIENT_ALL_H
 
+#include "../common/util.qh"
+
+#include "../common/effects/all.qh"
+#include "../common/models/all.qh"
+#include "../common/sounds/all.qh"
+
 #include "autocvars.qh"
 #include "defs.qh"
 #include "main.qh"
 #include "miscfunctions.qh"
 
-#include "../common/models/all.qh"
-#include "../common/sounds/all.qh"
-
 #endif
index b7b7bb5c6e5d992c2a8c20ea1e9f8c8bce7332f2..e20557fa741300f05bb7dfd5027a7832f5b70638 100644 (file)
@@ -1,9 +1,7 @@
 #include "announcer.qh"
-#include "_all.qh"
 
 #include "../common/notifications.qh"
 #include "../common/stats.qh"
-#include "../common/util.qh"
 
 bool announcer_1min;
 bool announcer_5min;
index 620b84544e9589facd78018cede17afa85ce884b..64be1433af70bd80d6c0450a8b497c98a0a34205 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef ANNOUNCER_H
-#define ANNOUNCER_H
+#ifndef CLIENT_ANNOUNCER_H
+#define CLIENT_ANNOUNCER_H
 
 void Announcer();
 
index 894bf6955af35a3b376199c29e12fe351ca1f5e2..a984a19a32a283dfc7a12f2aacee211761f9e87e 100644 (file)
@@ -1,7 +1,4 @@
 #include "bgmscript.qh"
-#include "_all.qh"
-
-#include "../common/util.qh"
 
 #define CONSTANT_SPEED_DECAY
 
index 5921bb4bc7325126c5227353192a1aa1fe18c250..d979e79d0731042f9d26579e6917bf50a0d34bd4 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef BGMSCRIPT_H
-#define BGMSCRIPT_H
+#ifndef CLIENT_BGMSCRIPT_H
+#define CLIENT_BGMSCRIPT_H
 
 entityclass(BGMScript);
 class(BGMScript) .string bgmscript;
diff --git a/qcsrc/client/command/all.qc b/qcsrc/client/command/all.qc
deleted file mode 100644 (file)
index dcace65..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-#include "../_all.qh"
-
-#include "../../common/command/all.qc"
-
-#include "cl_cmd.qc"
diff --git a/qcsrc/client/command/all.qh b/qcsrc/client/command/all.qh
deleted file mode 100644 (file)
index 34fc423..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef CLIENT_COMMANDS_ALL_H
-#define CLIENT_COMMANDS_ALL_H
-
-#include "../../common/command/all.qh"
-
-#include "cl_cmd.qh"
-
-#endif
diff --git a/qcsrc/client/command/cl_cmd.qc b/qcsrc/client/command/cl_cmd.qc
deleted file mode 100644 (file)
index 88cd246..0000000
+++ /dev/null
@@ -1,675 +0,0 @@
-// ==============================================
-//  CSQC client commands code, written by Samual
-//  Last updated: December 28th, 2011
-// ==============================================
-
-#include "../../common/command/command.qh"
-#include "cl_cmd.qh"
-
-#include "../autocvars.qh"
-#include "../defs.qh"
-#include "../hud.qh"
-#include "../hud_config.qh"
-#include "../main.qh"
-#include "../mapvoting.qh"
-#include "../miscfunctions.qh"
-
-#include "../mutators/events.qh"
-
-#include "../../common/mapinfo.qh"
-
-#include "../../common/command/generic.qh"
-
-void DrawDebugModel(entity this)
-{
-       if(time - floor(time) > 0.5)
-       {
-               PolyDrawModel(self);
-               self.drawmask = 0;
-       }
-       else
-       {
-               self.renderflags = 0;
-               self.drawmask = MASK_NORMAL;
-       }
-}
-
-
-// =======================
-//  Command Sub-Functions
-// =======================
-
-void LocalCommand_blurtest(int request)
-{
-       // Simple command to work with postprocessing temporarily... possibly completely pointless, the glsl shader is used for a real feature now...
-       // Anyway, to enable it, just compile the client with -DBLURTEST and then you can use the command.
-
-       #ifdef BLURTEST
-       switch(request)
-       {
-               case CMD_REQUEST_COMMAND:
-               {
-                       blurtest_time0 = time;
-                       blurtest_time1 = time + stof(argv(1));
-                       blurtest_radius = stof(argv(2));
-                       blurtest_power = stof(argv(3));
-                       LOG_INFO("Enabled blurtest\n");
-                       return;
-               }
-
-               default:
-               case CMD_REQUEST_USAGE:
-               {
-                       LOG_INFO("\nUsage:^3 cl_cmd blurtest\n");
-                       LOG_INFO("  No arguments required.\n");
-                       return;
-               }
-       }
-       #else
-       if(request)
-       {
-               LOG_INFO("Blurtest is not enabled on this client.\n");
-               return;
-       }
-       #endif
-}
-
-void LocalCommand_boxparticles(int request, int argc)
-{
-       switch(request)
-       {
-               case CMD_REQUEST_COMMAND:
-               {
-                       if (argc == 9)
-                       {
-                               int effect = _particleeffectnum(argv(1));
-                               if (effect >= 0)
-                               {
-                                       int index = stoi(argv(2));
-                                       entity own;
-                                       if(index <= 0)
-                                               own = entitybyindex(-index);
-                                       else
-                                               own = findfloat(world, entnum, index);
-                                       vector org_from = stov(argv(3));
-                                       vector org_to = stov(argv(4));
-                                       vector dir_from = stov(argv(5));
-                                       vector dir_to = stov(argv(6));
-                                       int countmultiplier = stoi(argv(7));
-                                       int flags = stoi(argv(8));
-                                       boxparticles(effect, own, org_from, org_to, dir_from, dir_to, countmultiplier, flags);
-                                       return;
-                               }
-                       }
-               }
-
-               default:
-                       LOG_INFO("Incorrect parameters for ^2boxparticles^7\n");
-               case CMD_REQUEST_USAGE:
-               {
-                       LOG_INFO("\nUsage:^3 lv_cmd boxparticles effectname own org_from org_to, dir_from, dir_to, countmultiplier, flags\n");
-                       LOG_INFO("  'effectname' is the name of a particle effect in effectinfo.txt\n");
-                       LOG_INFO("  'own' is the entity number of the owner (negative for csqc ent, positive for svqc ent)\n");
-                       LOG_INFO("  'org_from' is the starting origin of the box\n");
-                       LOG_INFO("  'org_to' is the ending origin of the box\n");
-                       LOG_INFO("  'dir_from' is the minimum velocity\n");
-                       LOG_INFO("  'dir_to' is the maximum velocity\n");
-                       LOG_INFO("  'countmultiplier' defines a multiplier for the particle count (affects count only, not countabsolute or trailspacing)\n");
-                       LOG_INFO("  'flags' can contain:\n");
-                       LOG_INFO("    1 to respect globals particles_alphamin, particles_alphamax (set right before via prvm_globalset client)\n");
-                       LOG_INFO("    2 to respect globals particles_colormin, particles_colormax (set right before via prvm_globalset client)\n");
-                       LOG_INFO("    4 to respect globals particles_fade (set right before via prvm_globalset client)\n");
-                       LOG_INFO("    128 to draw a trail, not a box\n");
-                       return;
-               }
-       }
-}
-
-void LocalCommand_create_scrshot_ent(int request)
-{
-       switch(request)
-       {
-               case CMD_REQUEST_COMMAND:
-               {
-                       string filename = strcat(MapInfo_Map_bspname, "_scrshot_ent.txt");
-                       int fh = fopen(filename, FILE_WRITE);
-
-                       if(fh >= 0)
-                       {
-                               fputs(fh, "{\n");
-                               fputs(fh, strcat("\"classname\" \"info_autoscreenshot\"\n"));
-                               fputs(fh, strcat("\"origin\" \"", strcat(ftos(view_origin.x), " ", ftos(view_origin.y), " ", ftos(view_origin.z)), "\"\n"));
-                               fputs(fh, strcat("\"angles\" \"", strcat(ftos(view_angles.x), " ", ftos(view_angles.y), " ", ftos(view_angles.z)), "\"\n"));
-                               fputs(fh, "}\n");
-
-                               LOG_INFO("Completed screenshot entity dump in ^2data/data/", MapInfo_Map_bspname, "_scrshot_ent.txt^7.\n");
-
-                               fclose(fh);
-                       }
-                       else
-                       {
-                               LOG_INFO("^1Error: ^7Could not dump to file!\n");
-                       }
-                       return;
-               }
-
-               default:
-               case CMD_REQUEST_USAGE:
-               {
-                       LOG_INFO("\nUsage:^3 cl_cmd create_scrshot_ent\n");
-                       LOG_INFO("  No arguments required.\n");
-                       return;
-               }
-       }
-}
-
-void LocalCommand_debugmodel(int request, int argc)
-{
-       switch(request)
-       {
-               case CMD_REQUEST_COMMAND:
-               {
-                       string modelname = argv(1);
-                       entity debugmodel_entity;
-
-                       debugmodel_entity = spawn();
-                       precache_model(modelname);
-                       _setmodel(debugmodel_entity, modelname);
-                       setorigin(debugmodel_entity, view_origin);
-                       debugmodel_entity.angles = view_angles;
-                       debugmodel_entity.draw = DrawDebugModel;
-                       debugmodel_entity.classname = "debugmodel";
-
-                       return;
-               }
-
-               default:
-               case CMD_REQUEST_USAGE:
-               {
-                       LOG_INFO("\nUsage:^3 cl_cmd debugmodel model\n");
-                       LOG_INFO("  Where 'model' is a string of the model name to use for the debug model.\n");
-                       return;
-               }
-       }
-}
-
-void LocalCommand_handlevote(int request, int argc)
-{
-       switch(request)
-       {
-               case CMD_REQUEST_COMMAND:
-               {
-                       int vote_selection;
-                       string vote_string;
-
-                       if(InterpretBoolean(argv(1)))
-                       {
-                               vote_selection = 2;
-                               vote_string = "yes";
-                       }
-                       else
-                       {
-                               vote_selection = 1;
-                               vote_string = "no";
-                       }
-
-                       if(vote_selection)
-                       {
-                               if(uid2name_dialog) // handled by "uid2name" option
-                               {
-                                       vote_active = 0;
-                                       vote_prev = 0;
-                                       vote_change = -9999;
-                                       localcmd(strcat("setreport cl_allow_uid2name ", ftos(vote_selection - 1), "\n"));
-                                       uid2name_dialog = 0;
-                               }
-                               else { localcmd(strcat("cmd vote ", vote_string, "\n")); }
-
-                               return;
-                       }
-               }
-
-               default:
-                       LOG_INFO("Incorrect parameters for ^2handlevote^7\n");
-               case CMD_REQUEST_USAGE:
-               {
-                       LOG_INFO("\nUsage:^3 cl_cmd handlevote vote\n");
-                       LOG_INFO("  Where 'vote' is the selection for either the current poll or uid2name.\n");
-                       return;
-               }
-       }
-}
-
-void LocalCommand_hud(int request, int argc)
-{
-       switch(request)
-       {
-               case CMD_REQUEST_COMMAND:
-               {
-                       switch(argv(1))
-                       {
-                               case "configure":
-                               {
-                                       cvar_set("_hud_configure", ftos(!autocvar__hud_configure));
-                                       return;
-                               }
-
-                               case "quickmenu":
-                               {
-                                       if(QuickMenu_IsOpened())
-                                               QuickMenu_Close();
-                                       else
-                                               QuickMenu_Open(argv(2), argv(3)); // mode, submenu
-                                       return;
-                               }
-
-                               case "minigame":
-                               {
-                                       if(HUD_MinigameMenu_IsOpened())
-                                               HUD_MinigameMenu_Close();
-                                       else
-                                               HUD_MinigameMenu_Open();
-                                       return;
-                               }
-
-                               case "save":
-                               {
-                                       if(argv(2))
-                                       {
-                                               HUD_Panel_ExportCfg(argv(2));
-                                               return;
-                                       }
-                                       else
-                                       {
-                                               break; // go to usage, we're missing the paramater needed here.
-                                       }
-                               }
-
-                               case "scoreboard_columns_set":
-                               {
-                                       Cmd_HUD_SetFields(argc);
-                                       return;
-                               }
-
-                               case "scoreboard_columns_help":
-                               {
-                                       Cmd_HUD_Help();
-                                       return;
-                               }
-
-                               case "radar":
-                               {
-                                       if(argv(2))
-                                               HUD_Radar_Show_Maximized(InterpretBoolean(argv(2)),0);
-                                       else
-                                               HUD_Radar_Show_Maximized(!hud_panel_radar_maximized,0);
-                                       return;
-                               }
-
-                               case "clickradar":
-                               {
-                                       HUD_Radar_Show_Maximized(!hud_panel_radar_mouse,1);
-                                       return;
-                               }
-                       }
-               }
-
-               default:
-                       LOG_INFO("Incorrect parameters for ^2hud^7\n");
-               case CMD_REQUEST_USAGE:
-               {
-                       LOG_INFO("\nUsage:^3 cl_cmd hud action [configname | radartoggle | layout]\n");
-                       LOG_INFO("  Where 'action' is the command to complete,\n");
-                       LOG_INFO("  'configname' is the name to save to for \"save\" action,\n");
-                       LOG_INFO("  'radartoggle' is to control hud_panel_radar_maximized for \"radar\" action,\n");
-                       LOG_INFO("  and 'layout' is how to organize the scoreboard columns for the set action.\n");
-                       LOG_INFO("  quickmenu [[default | file | \"\"] submenu]\n");
-                       LOG_INFO("    Called without options (or with "") loads either the default quickmenu or a quickmenu file if hud_panel_quickmenu_file is set to a valid filename.\n");
-                       LOG_INFO("    Submenu option allows to open quickmenu directly in a submenu, it requires to specify 'default', 'file' or '\"\"' option.\n");
-                       LOG_INFO("  Full list of commands here: \"configure, minigame, save, scoreboard_columns_help, scoreboard_columns_set, radar.\"\n");
-                       return;
-               }
-       }
-}
-
-void LocalCommand_localprint(int request, int argc)
-{
-       switch(request)
-       {
-               case CMD_REQUEST_COMMAND:
-               {
-                       if(argv(1))
-                       {
-                               centerprint_hud(argv(1));
-                               return;
-                       }
-               }
-
-               default:
-                       LOG_INFO("Incorrect parameters for ^2localprint^7\n");
-               case CMD_REQUEST_USAGE:
-               {
-                       LOG_INFO("\nUsage:^3 cl_cmd localprint \"message\"\n");
-                       LOG_INFO("  'message' is the centerprint message to send to yourself.\n");
-                       return;
-               }
-       }
-}
-
-void LocalCommand_mv_download(int request, int argc)
-{
-       switch(request)
-       {
-               case CMD_REQUEST_COMMAND:
-               {
-                       if(argv(1))
-                       {
-                               Cmd_MapVote_MapDownload(argc);
-                               return;
-                       }
-               }
-
-               default:
-                       LOG_INFO("Incorrect parameters for ^2mv_download^7\n");
-               case CMD_REQUEST_USAGE:
-               {
-                       LOG_INFO("\nUsage:^3 cl_cmd mv_download mapid\n");
-                       LOG_INFO("  Where 'mapid' is the id number of the map to request an image of on the map vote selection menu.\n");
-                       return;
-               }
-       }
-}
-
-void LocalCommand_find(int request, int argc)
-{
-       switch(request)
-       {
-               case CMD_REQUEST_COMMAND:
-               {
-                       entity client;
-
-                       for(client = world; (client = find(client, classname, argv(1))); )
-                               LOG_INFO(etos(client), "\n");
-
-                       return;
-               }
-
-               default:
-                       LOG_INFO("Incorrect parameters for ^2find^7\n");
-               case CMD_REQUEST_USAGE:
-               {
-                       LOG_INFO("\nUsage:^3 cl_cmd find classname\n");
-                       LOG_INFO("  Where 'classname' is the classname to search for.\n");
-                       return;
-               }
-       }
-}
-
-void LocalCommand_sendcvar(int request, int argc)
-{
-       switch(request)
-       {
-               case CMD_REQUEST_COMMAND:
-               {
-                       if(argv(1))
-                       {
-                               // W_FixWeaponOrder will trash argv, so save what we need.
-                               string thiscvar = strzone(argv(1));
-                               string s = cvar_string(thiscvar);
-
-                               if(thiscvar == "cl_weaponpriority")
-                                       s = W_FixWeaponOrder(W_NumberWeaponOrder(s), 1);
-                               else if(substring(thiscvar, 0, 17) == "cl_weaponpriority" && strlen(thiscvar) == 18)
-                                       s = W_FixWeaponOrder(W_NumberWeaponOrder(s), 0);
-
-                               localcmd("cmd sentcvar ", thiscvar, " \"", s, "\"\n");
-                               strunzone(thiscvar);
-                               return;
-                       }
-               }
-
-               default:
-                       LOG_INFO("Incorrect parameters for ^2sendcvar^7\n");
-               case CMD_REQUEST_USAGE:
-               {
-                       LOG_INFO("\nUsage:^3 cl_cmd sendcvar <cvar>\n");
-                       LOG_INFO("  Where 'cvar' is the cvar plus arguments to send to the server.\n");
-                       return;
-               }
-       }
-}
-
-/* use this when creating a new command, making sure to place it in alphabetical order... also,
-** ADD ALL NEW COMMANDS TO commands.cfg WITH PROPER ALIASES IN THE SAME FASHION!
-void LocalCommand_(int request)
-{
-       switch(request)
-       {
-               case CMD_REQUEST_COMMAND:
-               {
-
-                       return;
-               }
-
-               default:
-               case CMD_REQUEST_USAGE:
-               {
-                       print("\nUsage:^3 cl_cmd \n");
-                       print("  No arguments required.\n");
-                       return;
-               }
-       }
-}
-*/
-
-
-// ==================================
-//  Macro system for client commands
-// ==================================
-
-// Normally do not hard code aliases for these, instead create them in commands.cfg... also: keep in alphabetical order, please ;)
-#define CLIENT_COMMANDS(request,arguments) \
-       CLIENT_COMMAND("blurtest", LocalCommand_blurtest(request), "Feature for testing blur postprocessing") \
-       CLIENT_COMMAND("boxparticles", LocalCommand_boxparticles(request, arguments), "Spawn particles manually") \
-       CLIENT_COMMAND("create_scrshot_ent", LocalCommand_create_scrshot_ent(request), "Create an entity at this location for automatic screenshots") \
-       CLIENT_COMMAND("debugmodel", LocalCommand_debugmodel(request, arguments), "Spawn a debug model manually") \
-       CLIENT_COMMAND("handlevote", LocalCommand_handlevote(request, arguments), "System to handle selecting a vote or option") \
-       CLIENT_COMMAND("hud", LocalCommand_hud(request, arguments), "Commands regarding/controlling the HUD system") \
-       CLIENT_COMMAND("localprint", LocalCommand_localprint(request, arguments), "Create your own centerprint sent to yourself") \
-       CLIENT_COMMAND("find", LocalCommand_find(request, arguments), "Search through entities for matching classname") \
-       CLIENT_COMMAND("mv_download", LocalCommand_mv_download(request, arguments), "Retrieve mapshot picture from the server") \
-       CLIENT_COMMAND("sendcvar", LocalCommand_sendcvar(request, arguments), "Send a cvar to the server (like weaponpriority)") \
-       /* nothing */
-
-void LocalCommand_macro_help()
-{
-       #define CLIENT_COMMAND(name,function,description) \
-               { if(strtolower(description) != "") { LOG_INFO("  ^2", name, "^7: ", description, "\n"); } }
-
-       CLIENT_COMMANDS(0, 0);
-       #undef CLIENT_COMMAND
-
-       return;
-}
-
-bool LocalCommand_macro_command(int argc)
-{
-       #define CLIENT_COMMAND(name,function,description) \
-               { if(name == strtolower(argv(0))) { function; return true; } }
-
-       CLIENT_COMMANDS(CMD_REQUEST_COMMAND, argc);
-       #undef CLIENT_COMMAND
-
-       return false;
-}
-
-bool LocalCommand_macro_usage(int argc)
-{
-       #define CLIENT_COMMAND(name,function,description) \
-               { if(name == strtolower(argv(1))) { function; return true; } }
-
-       CLIENT_COMMANDS(CMD_REQUEST_USAGE, argc);
-       #undef CLIENT_COMMAND
-
-       return false;
-}
-
-void LocalCommand_macro_write_aliases(int fh)
-{
-       #define CLIENT_COMMAND(name,function,description) \
-               { if(strtolower(description) != "") { CMD_Write_Alias("qc_cmd_cl", name, description); } }
-
-       CLIENT_COMMANDS(0, 0);
-       #undef CLIENT_COMMAND
-
-       return;
-}
-
-
-// =========================================
-//  Main Function Called By Engine (cl_cmd)
-// =========================================
-// If this function exists, client code handles gamecommand instead of the engine code.
-
-void GameCommand(string command)
-{
-       int argc = tokenize_console(command);
-
-       // Guide for working with argc arguments by example:
-       // argc:   1    - 2      - 3     - 4
-       // argv:   0    - 1      - 2     - 3
-       // cmd     vote - master - login - password
-       string s = strtolower(argv(0));
-       if (s == "help")
-       {
-               if(argc == 1)
-               {
-                       LOG_INFO("\nClient console commands:\n");
-                       LocalCommand_macro_help();
-
-                       LOG_INFO("\nGeneric commands shared by all programs:\n");
-                       GenericCommand_macro_help();
-
-                       LOG_INFO("\nUsage:^3 cl_cmd COMMAND...^7, where possible commands are listed above.\n");
-                       LOG_INFO("For help about a specific command, type cl_cmd help COMMAND\n");
-
-                       return;
-               }
-               else if(GenericCommand_macro_usage(argc)) // Instead of trying to call a command, we're going to see detailed information about it
-               {
-                       return;
-               }
-               else if(LocalCommand_macro_usage(argc)) // now try for normal commands too
-               {
-                       return;
-               }
-       }
-       // continue as usual and scan for normal commands
-       if (GenericCommand(command)// handled by common/command/generic.qc
-       || LocalCommand_macro_command(argc) // handled by one of the above LocalCommand_* functions
-       || MUTATOR_CALLHOOK(CSQC_ConsoleCommand, s, argc, command) // handled by a mutator
-       ) return;
-
-       // nothing above caught the command, must be invalid
-       LOG_INFO(((command != "") ? strcat("Unknown client command \"", command, "\"") : "No command provided"), ". For a list of supported commands, try cl_cmd help.\n");
-
-       return;
-}
-
-
-// ===================================
-//  Macro system for console commands
-// ===================================
-
-// These functions are here specifically to add special + - commands to the game, and are not really normal commands.
-// Please add client commands to the function above this, as this is only for special reasons.
-#define CONSOLE_COMMANDS_NORMAL() \
-       CONSOLE_COMMAND("+showscores", { scoreboard_showscores = true; }) \
-       CONSOLE_COMMAND("-showscores", { scoreboard_showscores = false; }) \
-       CONSOLE_COMMAND("+showaccuracy", { scoreboard_showaccuracy = true; }) \
-       CONSOLE_COMMAND("-showaccuracy", { scoreboard_showaccuracy = false; }) \
-       /* nothing */
-
-#define CONSOLE_COMMANDS_MOVEMENT() \
-       CONSOLE_COMMAND("+forward", { ++camera_direction.x; }) \
-       CONSOLE_COMMAND("-forward", { --camera_direction.x; }) \
-       CONSOLE_COMMAND("+back", { --camera_direction.x; }) \
-       CONSOLE_COMMAND("-back", { ++camera_direction.x; }) \
-       CONSOLE_COMMAND("+moveup", { ++camera_direction.z; }) \
-       CONSOLE_COMMAND("-moveup", { --camera_direction.z; }) \
-       CONSOLE_COMMAND("+movedown", { --camera_direction.z; }) \
-       CONSOLE_COMMAND("-movedown", { ++camera_direction.z; }) \
-       CONSOLE_COMMAND("+moveright", { --camera_direction.y; }) \
-       CONSOLE_COMMAND("-moveright", { ++camera_direction.y; }) \
-       CONSOLE_COMMAND("+moveleft", { ++camera_direction.y; }) \
-       CONSOLE_COMMAND("-moveleft", { --camera_direction.y; }) \
-       CONSOLE_COMMAND("+roll_right", { ++camera_roll; }) \
-       CONSOLE_COMMAND("-roll_right", { --camera_roll; }) \
-       CONSOLE_COMMAND("+roll_left", { --camera_roll; }) \
-       CONSOLE_COMMAND("-roll_left", { ++camera_roll; }) \
-       /* nothing */
-
-void ConsoleCommand_macro_init()
-{
-       // first init normal commands
-       #define CONSOLE_COMMAND(name,execution) \
-               { registercommand(name); }
-
-       CONSOLE_COMMANDS_NORMAL();
-       #undef CONSOLE_COMMAND
-
-       // then init movement commands
-       #ifndef CAMERATEST
-       if(isdemo())
-       {
-       #endif
-               #define CONSOLE_COMMAND(name,execution) \
-                       { registercommand(name); }
-
-               CONSOLE_COMMANDS_MOVEMENT();
-               #undef CONSOLE_COMMAND
-       #ifndef CAMERATEST
-       }
-       #endif
-}
-
-bool ConsoleCommand_macro_normal(string s, int argc)
-{
-       #define CONSOLE_COMMAND(name,execution) \
-               { if (name == s) { { execution } return true; } }
-
-       CONSOLE_COMMANDS_NORMAL();
-       #undef CONSOLE_COMMAND
-
-       return false;
-}
-
-bool ConsoleCommand_macro_movement(string s, int argc)
-{
-       if(camera_active)
-       {
-               #define CONSOLE_COMMAND(name,execution) \
-                       { if (name == s) { { execution } return true; } }
-
-               CONSOLE_COMMANDS_MOVEMENT();
-               #undef CONSOLE_COMMAND
-       }
-
-       return false;
-}
-
-
-// ======================================================
-//  Main Function Called By Engine (registered commands)
-// ======================================================
-// Used to parse commands in the console that have been registered with the "registercommand" function
-
-bool CSQC_ConsoleCommand(string command)
-{
-       int argc = tokenize_console(command);
-       string s = strtolower(argv(0));
-       // Return value should be true if CSQC handled the command, otherwise return false to have the engine handle it.
-       return (ConsoleCommand_macro_normal(s, argc)
-       || ConsoleCommand_macro_movement(s, argc)
-       );
-}
diff --git a/qcsrc/client/command/cl_cmd.qh b/qcsrc/client/command/cl_cmd.qh
deleted file mode 100644 (file)
index da34310..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-#ifndef CL_CMD_H
-#define CL_CMD_H
-// ==============================================
-//  CSQC client commands code, written by Samual
-//  Last updated: December 17th, 2011
-// ==============================================
-
-void Cmd_HUD_SetFields(int);
-void Cmd_HUD_Help();
-
-// used by common/command/generic.qc:GenericCommand_dumpcommands to list all commands into a .txt file
-void LocalCommand_macro_write_aliases(int fh);
-#endif
diff --git a/qcsrc/client/commands/all.qc b/qcsrc/client/commands/all.qc
new file mode 100644 (file)
index 0000000..dcace65
--- /dev/null
@@ -0,0 +1,5 @@
+#include "../_all.qh"
+
+#include "../../common/command/all.qc"
+
+#include "cl_cmd.qc"
diff --git a/qcsrc/client/commands/all.qh b/qcsrc/client/commands/all.qh
new file mode 100644 (file)
index 0000000..eb092c1
--- /dev/null
@@ -0,0 +1,8 @@
+#ifndef CLIENT_COMMANDS_ALL_H
+#define CLIENT_COMMANDS_ALL_H
+
+#include "../../common/commands/all.qh"
+
+#include "cl_cmd.qh"
+
+#endif
diff --git a/qcsrc/client/commands/cl_cmd.qc b/qcsrc/client/commands/cl_cmd.qc
new file mode 100644 (file)
index 0000000..bed70f5
--- /dev/null
@@ -0,0 +1,685 @@
+// ==============================================
+//  CSQC client commands code, written by Samual
+//  Last updated: December 28th, 2011
+// ==============================================
+
+#include "../../common/command/command.qh"
+#include "cl_cmd.qh"
+
+#include "../autocvars.qh"
+#include "../defs.qh"
+#include "../hud.qh"
+#include "../hud_config.qh"
+#include "../main.qh"
+#include "../mapvoting.qh"
+#include "../miscfunctions.qh"
+
+#include "../mutators/events.qh"
+
+#include "../../common/mapinfo.qh"
+
+#include "../../common/command/generic.qh"
+
+void DrawDebugModel(entity this)
+{
+       if(time - floor(time) > 0.5)
+       {
+               PolyDrawModel(self);
+               self.drawmask = 0;
+       }
+       else
+       {
+               self.renderflags = 0;
+               self.drawmask = MASK_NORMAL;
+       }
+}
+
+
+// =======================
+//  Command Sub-Functions
+// =======================
+
+void LocalCommand_blurtest(int request)
+{
+       // Simple command to work with postprocessing temporarily... possibly completely pointless, the glsl shader is used for a real feature now...
+       // Anyway, to enable it, just compile the client with -DBLURTEST and then you can use the command.
+
+       #ifdef BLURTEST
+       switch(request)
+       {
+               case CMD_REQUEST_COMMAND:
+               {
+                       blurtest_time0 = time;
+                       blurtest_time1 = time + stof(argv(1));
+                       blurtest_radius = stof(argv(2));
+                       blurtest_power = stof(argv(3));
+                       LOG_INFO("Enabled blurtest\n");
+                       return;
+               }
+
+               default:
+               case CMD_REQUEST_USAGE:
+               {
+                       LOG_INFO("\nUsage:^3 cl_cmd blurtest\n");
+                       LOG_INFO("  No arguments required.\n");
+                       return;
+               }
+       }
+       #else
+       if(request)
+       {
+               LOG_INFO("Blurtest is not enabled on this client.\n");
+               return;
+       }
+       #endif
+}
+
+void LocalCommand_boxparticles(int request, int argc)
+{
+       switch(request)
+       {
+               case CMD_REQUEST_COMMAND:
+               {
+                       if (argc == 9)
+                       {
+                               int effect = _particleeffectnum(argv(1));
+                               if (effect >= 0)
+                               {
+                                       int index = stoi(argv(2));
+                                       entity own;
+                                       if(index <= 0)
+                                               own = entitybyindex(-index);
+                                       else
+                                               own = findfloat(world, entnum, index);
+                                       vector org_from = stov(argv(3));
+                                       vector org_to = stov(argv(4));
+                                       vector dir_from = stov(argv(5));
+                                       vector dir_to = stov(argv(6));
+                                       int countmultiplier = stoi(argv(7));
+                                       int flags = stoi(argv(8));
+                                       boxparticles(effect, own, org_from, org_to, dir_from, dir_to, countmultiplier, flags);
+                                       return;
+                               }
+                       }
+               }
+
+               default:
+                       LOG_INFO("Incorrect parameters for ^2boxparticles^7\n");
+               case CMD_REQUEST_USAGE:
+               {
+                       LOG_INFO("\nUsage:^3 lv_cmd boxparticles effectname own org_from org_to, dir_from, dir_to, countmultiplier, flags\n");
+                       LOG_INFO("  'effectname' is the name of a particle effect in effectinfo.txt\n");
+                       LOG_INFO("  'own' is the entity number of the owner (negative for csqc ent, positive for svqc ent)\n");
+                       LOG_INFO("  'org_from' is the starting origin of the box\n");
+                       LOG_INFO("  'org_to' is the ending origin of the box\n");
+                       LOG_INFO("  'dir_from' is the minimum velocity\n");
+                       LOG_INFO("  'dir_to' is the maximum velocity\n");
+                       LOG_INFO("  'countmultiplier' defines a multiplier for the particle count (affects count only, not countabsolute or trailspacing)\n");
+                       LOG_INFO("  'flags' can contain:\n");
+                       LOG_INFO("    1 to respect globals particles_alphamin, particles_alphamax (set right before via prvm_globalset client)\n");
+                       LOG_INFO("    2 to respect globals particles_colormin, particles_colormax (set right before via prvm_globalset client)\n");
+                       LOG_INFO("    4 to respect globals particles_fade (set right before via prvm_globalset client)\n");
+                       LOG_INFO("    128 to draw a trail, not a box\n");
+                       return;
+               }
+       }
+}
+
+void LocalCommand_create_scrshot_ent(int request)
+{
+       switch(request)
+       {
+               case CMD_REQUEST_COMMAND:
+               {
+                       string filename = strcat(MapInfo_Map_bspname, "_scrshot_ent.txt");
+                       int fh = fopen(filename, FILE_WRITE);
+
+                       if(fh >= 0)
+                       {
+                               fputs(fh, "{\n");
+                               fputs(fh, strcat("\"classname\" \"info_autoscreenshot\"\n"));
+                               fputs(fh, strcat("\"origin\" \"", strcat(ftos(view_origin.x), " ", ftos(view_origin.y), " ", ftos(view_origin.z)), "\"\n"));
+                               fputs(fh, strcat("\"angles\" \"", strcat(ftos(view_angles.x), " ", ftos(view_angles.y), " ", ftos(view_angles.z)), "\"\n"));
+                               fputs(fh, "}\n");
+
+                               LOG_INFO("Completed screenshot entity dump in ^2data/data/", MapInfo_Map_bspname, "_scrshot_ent.txt^7.\n");
+
+                               fclose(fh);
+                       }
+                       else
+                       {
+                               LOG_INFO("^1Error: ^7Could not dump to file!\n");
+                       }
+                       return;
+               }
+
+               default:
+               case CMD_REQUEST_USAGE:
+               {
+                       LOG_INFO("\nUsage:^3 cl_cmd create_scrshot_ent\n");
+                       LOG_INFO("  No arguments required.\n");
+                       return;
+               }
+       }
+}
+
+void LocalCommand_debugmodel(int request, int argc)
+{
+       switch(request)
+       {
+               case CMD_REQUEST_COMMAND:
+               {
+                       string modelname = argv(1);
+                       entity debugmodel_entity;
+
+                       debugmodel_entity = spawn();
+                       precache_model(modelname);
+                       _setmodel(debugmodel_entity, modelname);
+                       setorigin(debugmodel_entity, view_origin);
+                       debugmodel_entity.angles = view_angles;
+                       debugmodel_entity.draw = DrawDebugModel;
+                       debugmodel_entity.classname = "debugmodel";
+
+                       return;
+               }
+
+               default:
+               case CMD_REQUEST_USAGE:
+               {
+                       LOG_INFO("\nUsage:^3 cl_cmd debugmodel model\n");
+                       LOG_INFO("  Where 'model' is a string of the model name to use for the debug model.\n");
+                       return;
+               }
+       }
+}
+
+void LocalCommand_handlevote(int request, int argc)
+{
+       switch(request)
+       {
+               case CMD_REQUEST_COMMAND:
+               {
+                       int vote_selection;
+                       string vote_string;
+
+                       if(InterpretBoolean(argv(1)))
+                       {
+                               vote_selection = 2;
+                               vote_string = "yes";
+                       }
+                       else
+                       {
+                               vote_selection = 1;
+                               vote_string = "no";
+                       }
+
+                       if(vote_selection)
+                       {
+                               if(uid2name_dialog) // handled by "uid2name" option
+                               {
+                                       vote_active = 0;
+                                       vote_prev = 0;
+                                       vote_change = -9999;
+                                       localcmd(strcat("setreport cl_allow_uid2name ", ftos(vote_selection - 1), "\n"));
+                                       uid2name_dialog = 0;
+                               }
+                               else { localcmd(strcat("cmd vote ", vote_string, "\n")); }
+
+                               return;
+                       }
+               }
+
+               default:
+                       LOG_INFO("Incorrect parameters for ^2handlevote^7\n");
+               case CMD_REQUEST_USAGE:
+               {
+                       LOG_INFO("\nUsage:^3 cl_cmd handlevote vote\n");
+                       LOG_INFO("  Where 'vote' is the selection for either the current poll or uid2name.\n");
+                       return;
+               }
+       }
+}
+
+bool QuickMenu_IsOpened();
+void QuickMenu_Close();
+bool QuickMenu_Open(string mode, string submenu);
+
+bool HUD_MinigameMenu_IsOpened();
+void HUD_MinigameMenu_Close();
+void HUD_MinigameMenu_Open();
+
+void HUD_Radar_Show_Maximized(bool doshow, bool clickable);
+
+void LocalCommand_hud(int request, int argc)
+{
+       switch(request)
+       {
+               case CMD_REQUEST_COMMAND:
+               {
+                       switch(argv(1))
+                       {
+                               case "configure":
+                               {
+                                       cvar_set("_hud_configure", ftos(!autocvar__hud_configure));
+                                       return;
+                               }
+
+                               case "quickmenu":
+                               {
+                                       if(QuickMenu_IsOpened())
+                                               QuickMenu_Close();
+                                       else
+                                               QuickMenu_Open(argv(2), argv(3)); // mode, submenu
+                                       return;
+                               }
+
+                               case "minigame":
+                               {
+                                       if(HUD_MinigameMenu_IsOpened())
+                                               HUD_MinigameMenu_Close();
+                                       else
+                                               HUD_MinigameMenu_Open();
+                                       return;
+                               }
+
+                               case "save":
+                               {
+                                       if(argv(2))
+                                       {
+                                               HUD_Panel_ExportCfg(argv(2));
+                                               return;
+                                       }
+                                       else
+                                       {
+                                               break; // go to usage, we're missing the paramater needed here.
+                                       }
+                               }
+
+                               case "scoreboard_columns_set":
+                               {
+                                       Cmd_HUD_SetFields(argc);
+                                       return;
+                               }
+
+                               case "scoreboard_columns_help":
+                               {
+                                       Cmd_HUD_Help();
+                                       return;
+                               }
+
+                               case "radar":
+                               {
+                                       if(argv(2))
+                                               HUD_Radar_Show_Maximized(InterpretBoolean(argv(2)),0);
+                                       else
+                                               HUD_Radar_Show_Maximized(!hud_panel_radar_maximized,0);
+                                       return;
+                               }
+
+                               case "clickradar":
+                               {
+                                       HUD_Radar_Show_Maximized(!hud_panel_radar_mouse,1);
+                                       return;
+                               }
+                       }
+               }
+
+               default:
+                       LOG_INFO("Incorrect parameters for ^2hud^7\n");
+               case CMD_REQUEST_USAGE:
+               {
+                       LOG_INFO("\nUsage:^3 cl_cmd hud action [configname | radartoggle | layout]\n");
+                       LOG_INFO("  Where 'action' is the command to complete,\n");
+                       LOG_INFO("  'configname' is the name to save to for \"save\" action,\n");
+                       LOG_INFO("  'radartoggle' is to control hud_panel_radar_maximized for \"radar\" action,\n");
+                       LOG_INFO("  and 'layout' is how to organize the scoreboard columns for the set action.\n");
+                       LOG_INFO("  quickmenu [[default | file | \"\"] submenu]\n");
+                       LOG_INFO("    Called without options (or with "") loads either the default quickmenu or a quickmenu file if hud_panel_quickmenu_file is set to a valid filename.\n");
+                       LOG_INFO("    Submenu option allows to open quickmenu directly in a submenu, it requires to specify 'default', 'file' or '\"\"' option.\n");
+                       LOG_INFO("  Full list of commands here: \"configure, minigame, save, scoreboard_columns_help, scoreboard_columns_set, radar.\"\n");
+                       return;
+               }
+       }
+}
+
+void LocalCommand_localprint(int request, int argc)
+{
+       switch(request)
+       {
+               case CMD_REQUEST_COMMAND:
+               {
+                       if(argv(1))
+                       {
+                               centerprint_hud(argv(1));
+                               return;
+                       }
+               }
+
+               default:
+                       LOG_INFO("Incorrect parameters for ^2localprint^7\n");
+               case CMD_REQUEST_USAGE:
+               {
+                       LOG_INFO("\nUsage:^3 cl_cmd localprint \"message\"\n");
+                       LOG_INFO("  'message' is the centerprint message to send to yourself.\n");
+                       return;
+               }
+       }
+}
+
+void LocalCommand_mv_download(int request, int argc)
+{
+       switch(request)
+       {
+               case CMD_REQUEST_COMMAND:
+               {
+                       if(argv(1))
+                       {
+                               Cmd_MapVote_MapDownload(argc);
+                               return;
+                       }
+               }
+
+               default:
+                       LOG_INFO("Incorrect parameters for ^2mv_download^7\n");
+               case CMD_REQUEST_USAGE:
+               {
+                       LOG_INFO("\nUsage:^3 cl_cmd mv_download mapid\n");
+                       LOG_INFO("  Where 'mapid' is the id number of the map to request an image of on the map vote selection menu.\n");
+                       return;
+               }
+       }
+}
+
+void LocalCommand_find(int request, int argc)
+{
+       switch(request)
+       {
+               case CMD_REQUEST_COMMAND:
+               {
+                       entity client;
+
+                       for(client = world; (client = find(client, classname, argv(1))); )
+                               LOG_INFO(etos(client), "\n");
+
+                       return;
+               }
+
+               default:
+                       LOG_INFO("Incorrect parameters for ^2find^7\n");
+               case CMD_REQUEST_USAGE:
+               {
+                       LOG_INFO("\nUsage:^3 cl_cmd find classname\n");
+                       LOG_INFO("  Where 'classname' is the classname to search for.\n");
+                       return;
+               }
+       }
+}
+
+void LocalCommand_sendcvar(int request, int argc)
+{
+       switch(request)
+       {
+               case CMD_REQUEST_COMMAND:
+               {
+                       if(argv(1))
+                       {
+                               // W_FixWeaponOrder will trash argv, so save what we need.
+                               string thiscvar = strzone(argv(1));
+                               string s = cvar_string(thiscvar);
+
+                               if(thiscvar == "cl_weaponpriority")
+                                       s = W_FixWeaponOrder(W_NumberWeaponOrder(s), 1);
+                               else if(substring(thiscvar, 0, 17) == "cl_weaponpriority" && strlen(thiscvar) == 18)
+                                       s = W_FixWeaponOrder(W_NumberWeaponOrder(s), 0);
+
+                               localcmd("cmd sentcvar ", thiscvar, " \"", s, "\"\n");
+                               strunzone(thiscvar);
+                               return;
+                       }
+               }
+
+               default:
+                       LOG_INFO("Incorrect parameters for ^2sendcvar^7\n");
+               case CMD_REQUEST_USAGE:
+               {
+                       LOG_INFO("\nUsage:^3 cl_cmd sendcvar <cvar>\n");
+                       LOG_INFO("  Where 'cvar' is the cvar plus arguments to send to the server.\n");
+                       return;
+               }
+       }
+}
+
+/* use this when creating a new command, making sure to place it in alphabetical order... also,
+** ADD ALL NEW COMMANDS TO commands.cfg WITH PROPER ALIASES IN THE SAME FASHION!
+void LocalCommand_(int request)
+{
+       switch(request)
+       {
+               case CMD_REQUEST_COMMAND:
+               {
+
+                       return;
+               }
+
+               default:
+               case CMD_REQUEST_USAGE:
+               {
+                       print("\nUsage:^3 cl_cmd \n");
+                       print("  No arguments required.\n");
+                       return;
+               }
+       }
+}
+*/
+
+
+// ==================================
+//  Macro system for client commands
+// ==================================
+
+// Normally do not hard code aliases for these, instead create them in commands.cfg... also: keep in alphabetical order, please ;)
+#define CLIENT_COMMANDS(request,arguments) \
+       CLIENT_COMMAND("blurtest", LocalCommand_blurtest(request), "Feature for testing blur postprocessing") \
+       CLIENT_COMMAND("boxparticles", LocalCommand_boxparticles(request, arguments), "Spawn particles manually") \
+       CLIENT_COMMAND("create_scrshot_ent", LocalCommand_create_scrshot_ent(request), "Create an entity at this location for automatic screenshots") \
+       CLIENT_COMMAND("debugmodel", LocalCommand_debugmodel(request, arguments), "Spawn a debug model manually") \
+       CLIENT_COMMAND("handlevote", LocalCommand_handlevote(request, arguments), "System to handle selecting a vote or option") \
+       CLIENT_COMMAND("hud", LocalCommand_hud(request, arguments), "Commands regarding/controlling the HUD system") \
+       CLIENT_COMMAND("localprint", LocalCommand_localprint(request, arguments), "Create your own centerprint sent to yourself") \
+       CLIENT_COMMAND("find", LocalCommand_find(request, arguments), "Search through entities for matching classname") \
+       CLIENT_COMMAND("mv_download", LocalCommand_mv_download(request, arguments), "Retrieve mapshot picture from the server") \
+       CLIENT_COMMAND("sendcvar", LocalCommand_sendcvar(request, arguments), "Send a cvar to the server (like weaponpriority)") \
+       /* nothing */
+
+void LocalCommand_macro_help()
+{
+       #define CLIENT_COMMAND(name,function,description) \
+               { if(strtolower(description) != "") { LOG_INFO("  ^2", name, "^7: ", description, "\n"); } }
+
+       CLIENT_COMMANDS(0, 0);
+       #undef CLIENT_COMMAND
+
+       return;
+}
+
+bool LocalCommand_macro_command(int argc)
+{
+       #define CLIENT_COMMAND(name,function,description) \
+               { if(name == strtolower(argv(0))) { function; return true; } }
+
+       CLIENT_COMMANDS(CMD_REQUEST_COMMAND, argc);
+       #undef CLIENT_COMMAND
+
+       return false;
+}
+
+bool LocalCommand_macro_usage(int argc)
+{
+       #define CLIENT_COMMAND(name,function,description) \
+               { if(name == strtolower(argv(1))) { function; return true; } }
+
+       CLIENT_COMMANDS(CMD_REQUEST_USAGE, argc);
+       #undef CLIENT_COMMAND
+
+       return false;
+}
+
+void LocalCommand_macro_write_aliases(int fh)
+{
+       #define CLIENT_COMMAND(name,function,description) \
+               { if(strtolower(description) != "") { CMD_Write_Alias("qc_cmd_cl", name, description); } }
+
+       CLIENT_COMMANDS(0, 0);
+       #undef CLIENT_COMMAND
+
+       return;
+}
+
+
+// =========================================
+//  Main Function Called By Engine (cl_cmd)
+// =========================================
+// If this function exists, client code handles gamecommand instead of the engine code.
+
+void GameCommand(string command)
+{
+       int argc = tokenize_console(command);
+
+       // Guide for working with argc arguments by example:
+       // argc:   1    - 2      - 3     - 4
+       // argv:   0    - 1      - 2     - 3
+       // cmd     vote - master - login - password
+       string s = strtolower(argv(0));
+       if (s == "help")
+       {
+               if(argc == 1)
+               {
+                       LOG_INFO("\nClient console commands:\n");
+                       LocalCommand_macro_help();
+
+                       LOG_INFO("\nGeneric commands shared by all programs:\n");
+                       GenericCommand_macro_help();
+
+                       LOG_INFO("\nUsage:^3 cl_cmd COMMAND...^7, where possible commands are listed above.\n");
+                       LOG_INFO("For help about a specific command, type cl_cmd help COMMAND\n");
+
+                       return;
+               }
+               else if(GenericCommand_macro_usage(argc)) // Instead of trying to call a command, we're going to see detailed information about it
+               {
+                       return;
+               }
+               else if(LocalCommand_macro_usage(argc)) // now try for normal commands too
+               {
+                       return;
+               }
+       }
+       // continue as usual and scan for normal commands
+       if (GenericCommand(command)// handled by common/command/generic.qc
+       || LocalCommand_macro_command(argc) // handled by one of the above LocalCommand_* functions
+       || MUTATOR_CALLHOOK(CSQC_ConsoleCommand, s, argc, command) // handled by a mutator
+       ) return;
+
+       // nothing above caught the command, must be invalid
+       LOG_INFO(((command != "") ? strcat("Unknown client command \"", command, "\"") : "No command provided"), ". For a list of supported commands, try cl_cmd help.\n");
+
+       return;
+}
+
+
+// ===================================
+//  Macro system for console commands
+// ===================================
+
+// These functions are here specifically to add special + - commands to the game, and are not really normal commands.
+// Please add client commands to the function above this, as this is only for special reasons.
+#define CONSOLE_COMMANDS_NORMAL() \
+       CONSOLE_COMMAND("+showscores", { scoreboard_showscores = true; }) \
+       CONSOLE_COMMAND("-showscores", { scoreboard_showscores = false; }) \
+       CONSOLE_COMMAND("+showaccuracy", { scoreboard_showaccuracy = true; }) \
+       CONSOLE_COMMAND("-showaccuracy", { scoreboard_showaccuracy = false; }) \
+       /* nothing */
+
+#define CONSOLE_COMMANDS_MOVEMENT() \
+       CONSOLE_COMMAND("+forward", { ++camera_direction.x; }) \
+       CONSOLE_COMMAND("-forward", { --camera_direction.x; }) \
+       CONSOLE_COMMAND("+back", { --camera_direction.x; }) \
+       CONSOLE_COMMAND("-back", { ++camera_direction.x; }) \
+       CONSOLE_COMMAND("+moveup", { ++camera_direction.z; }) \
+       CONSOLE_COMMAND("-moveup", { --camera_direction.z; }) \
+       CONSOLE_COMMAND("+movedown", { --camera_direction.z; }) \
+       CONSOLE_COMMAND("-movedown", { ++camera_direction.z; }) \
+       CONSOLE_COMMAND("+moveright", { --camera_direction.y; }) \
+       CONSOLE_COMMAND("-moveright", { ++camera_direction.y; }) \
+       CONSOLE_COMMAND("+moveleft", { ++camera_direction.y; }) \
+       CONSOLE_COMMAND("-moveleft", { --camera_direction.y; }) \
+       CONSOLE_COMMAND("+roll_right", { ++camera_roll; }) \
+       CONSOLE_COMMAND("-roll_right", { --camera_roll; }) \
+       CONSOLE_COMMAND("+roll_left", { --camera_roll; }) \
+       CONSOLE_COMMAND("-roll_left", { ++camera_roll; }) \
+       /* nothing */
+
+void ConsoleCommand_macro_init()
+{
+       // first init normal commands
+       #define CONSOLE_COMMAND(name,execution) \
+               { registercommand(name); }
+
+       CONSOLE_COMMANDS_NORMAL();
+       #undef CONSOLE_COMMAND
+
+       // then init movement commands
+       #ifndef CAMERATEST
+       if(isdemo())
+       {
+       #endif
+               #define CONSOLE_COMMAND(name,execution) \
+                       { registercommand(name); }
+
+               CONSOLE_COMMANDS_MOVEMENT();
+               #undef CONSOLE_COMMAND
+       #ifndef CAMERATEST
+       }
+       #endif
+}
+
+bool ConsoleCommand_macro_normal(string s, int argc)
+{
+       #define CONSOLE_COMMAND(name,execution) \
+               { if (name == s) { { execution } return true; } }
+
+       CONSOLE_COMMANDS_NORMAL();
+       #undef CONSOLE_COMMAND
+
+       return false;
+}
+
+bool ConsoleCommand_macro_movement(string s, int argc)
+{
+       if(camera_active)
+       {
+               #define CONSOLE_COMMAND(name,execution) \
+                       { if (name == s) { { execution } return true; } }
+
+               CONSOLE_COMMANDS_MOVEMENT();
+               #undef CONSOLE_COMMAND
+       }
+
+       return false;
+}
+
+
+// ======================================================
+//  Main Function Called By Engine (registered commands)
+// ======================================================
+// Used to parse commands in the console that have been registered with the "registercommand" function
+
+bool CSQC_ConsoleCommand(string command)
+{
+       int argc = tokenize_console(command);
+       string s = strtolower(argv(0));
+       // Return value should be true if CSQC handled the command, otherwise return false to have the engine handle it.
+       return (ConsoleCommand_macro_normal(s, argc)
+       || ConsoleCommand_macro_movement(s, argc)
+       );
+}
diff --git a/qcsrc/client/commands/cl_cmd.qh b/qcsrc/client/commands/cl_cmd.qh
new file mode 100644 (file)
index 0000000..ba3151c
--- /dev/null
@@ -0,0 +1,13 @@
+#ifndef CLIENT_COMMANDS_CL_CMD_H
+#define CLIENT_COMMANDS_CL_CMD_H
+// ==============================================
+//  CSQC client commands code, written by Samual
+//  Last updated: December 17th, 2011
+// ==============================================
+
+void Cmd_HUD_SetFields(int);
+void Cmd_HUD_Help();
+
+// used by common/command/generic.qc:GenericCommand_dumpcommands to list all commands into a .txt file
+void LocalCommand_macro_write_aliases(int fh);
+#endif
index 34301d8063dc50501381721eaf01040ad7ebc51a..575bce513c763aec1b942a260539a8a522c7e27c 100644 (file)
@@ -1,8 +1,9 @@
 #include "controlpoint.qh"
-#include "gibs.qh"
+
 #include "teamradar.qh"
 #include "../common/movetypes/movetypes.qh"
 
+.vector colormod;
 .float alpha;
 .int count;
 .float pain_finished;
index 31485519d4eefee415115cd3098d03fc80d821cd..5f2e89b4d7a33e93b350a005c44b855a587f6ce3 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef CONTROLPOINT_H
-#define CONTROLPOINT_H
+#ifndef CLIENT_CONTROLPOINT_H
+#define CLIENT_CONTROLPOINT_H
 
 const vector CPICON_MIN = '-32 -32 -9';
 const vector CPICON_MAX = '32 32 25';
index 09d217bc2c0075fea962f918a59516f557390597..1df447283ce680b5639f85a5f9777b19a03163c3 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef CSQC_CONSTANTS
-#define CSQC_CONSTANTS
+#ifndef CLIENT_CSQC_CONSTANTS
+#define CLIENT_CSQC_CONSTANTS
 
 // MenuQC redefines world, change define it here to be safe
 #define world world
index 8d1f7e76fb3c77b90c74d7f4d5420cc8d2b4ffb5..708e305fabe316f9702b98c91aa04c6f4902a0c7 100644 (file)
@@ -1,24 +1,13 @@
-#include "_all.qh"
-
-#include "gibs.qh"
+#include "mutators/events.qh"
 #include "player_skeleton.qh"
-
 #include "weapons/projectile.qh"
-
 #include "../common/animdecide.qh"
-#include "../common/csqcmodel_settings.qh"
-#include "../common/effects/effects.qh"
-#include "../common/teams.qh"
-#include "../common/triggers/trigger/viewloc.qh"
+#include "../common/movetypes/movetypes.qh"
 #include "../common/viewloc.qh"
-
-#include "mutators/events.qh"
-
 #include "../csqcmodellib/cl_model.qh"
 #include "../csqcmodellib/cl_player.qh"
 #include "../csqcmodellib/interpolate.qh"
 
-
 .float death_time;
 .int modelflags;
 
index 7ef7f996bd1e22f93a7c0d07b1650952bbf05974..48612ba48cfad99914449c9101a3cd30712d6c59 100644 (file)
@@ -1,16 +1,9 @@
 #include "damage.qh"
-#include "_all.qh"
 
 #include "gibs.qh"
-
-#include "../common/vehicles/all.qh"
-
-#include "../common/constants.qh"
 #include "../common/deathtypes.qh"
-#include "../common/effects/effects.qh"
 #include "../common/movetypes/movetypes.qh"
-#include "../common/util.qh"
-
+#include "../common/vehicles/all.qh"
 #include "../common/weapons/all.qh"
 
 .entity tag_entity;
index 0de69a02d850a478906840ff353ed81902061059..3f11b9a49e71232f2920d6fa1f5685dd39e9aeb5 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef DAMAGE_H
-#define DAMAGE_H
+#ifndef CLIENT_DAMAGE_H
+#define CLIENT_DAMAGE_H
 
 .float total_damages; // number of effects which currently are attached to a player
 
index c0c378fd1a42c4cb5fb697902e8bdca4c743539c..21fa1ce037137e187a35bd29ed70e42b0eb757e2 100644 (file)
@@ -1,5 +1,4 @@
 #include "effects.qh"
-#include "_all.qh"
 
 /*
 .vector fx_start;
index 0bebdb95de40c14c98821fd57aab014b70e8ab2f..2d93f41d71b506c99362c5cf5fcd42e34d5d60ea 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef EFFECTS_H
-#define EFFECTS_H
+#ifndef CLIENT_EFFECTS_H
+#define CLIENT_EFFECTS_H
 
 void Net_ReadArc();
 
index eed682785e0ec2ee8877f4aa71546c6843c20be4..d7114d1bf4b904ae36d685fb6444507e50eb0151 100644 (file)
@@ -1,5 +1,10 @@
 #include "generator.qh"
 
+#include "teamradar.qh"
+#include "../common/movetypes/movetypes.qh"
+
+.float alpha;
+.float scale;
 .int count;
 .float max_health;
 
index 744bc5589f47a39edba81e1bf1fe78dbc215d617..c60aff4009ac5d113b0ff0039ed5baf04de030d4 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef GENERATOR_H
-#define GENERATOR_H
+#ifndef CLIENT_GENERATOR_H
+#define CLIENT_GENERATOR_H
 const vector GENERATOR_MIN = '-52 -52 -14';
 const vector GENERATOR_MAX = '52 52 75';
 
index 360f7b5c361bdb6b99435575f8dfb5553e6de855..4afa5eb88ac47a45155b614a69854d78b9060226 100644 (file)
@@ -1,11 +1,7 @@
 #include "gibs.qh"
-#include "_all.qh"
 
 #include "rubble.qh"
-
-#include "../common/constants.qh"
 #include "../common/movetypes/movetypes.qh"
-#include "../common/util.qh"
 
 .float scale;
 .float alpha;
index f4b60948af7cf0a103c19da8645e18317e7178cf..eb63aa1fe5ec29e8344c3089e1395c0622bcb175 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef GIBS_H
-#define GIBS_H
+#ifndef CLIENT_GIBS_H
+#define CLIENT_GIBS_H
 
 .vector colormod;
 
index 07123f06b5ec278b9bb1d609a7e9e8d195032836..6143874e664fdc7331f9fb087c7e134e33c4463e 100644 (file)
@@ -1,12 +1,6 @@
 #include "hook.qh"
-#include "_all.qh"
-
-#include "hud.qh"
-
-#include "../common/teams.qh"
 
 #include "../csqcmodellib/interpolate.qh"
-
 #include "../warpzonelib/common.qh"
 
 entityclass(Hook);
index e513ed6afa4451ee0271a1bc33d15716b869edfc..9e6ee548cfab5ae0a97a169b213c9596d497ff85 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef HOOK_H
-#define HOOK_H
+#ifndef CLIENT_HOOK_H
+#define CLIENT_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);
 
index 81fa5755271445be76c89fecb8e44e2eaadc4e3e..4e83ac31e7c064da59df904f16b1573b2ed1e09e 100644 (file)
@@ -1,25 +1,19 @@
 #include "hud.qh"
-#include "_all.qh"
 
 #include "hud_config.qh"
 #include "mapvoting.qh"
 #include "scoreboard.qh"
 #include "teamradar.qh"
 #include "t_items.qh"
-
 #include "../common/buffs/all.qh"
-#include "../common/constants.qh"
 #include "../common/deathtypes.qh"
 #include "../common/items/all.qc"
 #include "../common/mapinfo.qh"
-#include "../common/nades/all.qh"
-
 #include "../common/mutators/mutator/waypoints/all.qh"
-#include "../server/mutators/gamemode_ctf.qh"
-
+#include "../common/nades/all.qh"
 #include "../common/stats.qh"
-
 #include "../csqcmodellib/cl_player.qh"
+#include "../server/mutators/gamemode_ctf.qh"
 
 
 /*
@@ -204,12 +198,6 @@ HUD panels
 ==================
 */
 
-// draw the background/borders
-#define HUD_Panel_DrawBg(theAlpha) do {                                                                                                                                                                \
-       if(panel.current_panel_bg != "0" && panel.current_panel_bg != "")                                                                                               \
-               draw_BorderPicture(panel_pos - '1 1 0' * panel_bg_border, panel.current_panel_bg, panel_size + '1 1 0' * 2 * panel_bg_border, panel_bg_color, panel_bg_alpha * theAlpha, '1 1 0' * (panel_bg_border/BORDER_MULTIPLIER));\
-} while(0)
-
 //basically the same code of draw_ButtonPicture and draw_VertButtonPicture for the menu
 void HUD_Panel_DrawProgressBar(vector theOrigin, vector theSize, string pic, float length_ratio, bool vertical, float baralign, vector theColor, float theAlpha, int drawflag)
 {
index 224b3fbe09de952c31bca79898d525eca73db2f8..517fd8c07bcd521b7b86b73fe79e1dc110ecec26 100644 (file)
@@ -1,8 +1,11 @@
-#ifndef HUD_H
-#define HUD_H
+#ifndef CLIENT_HUD_H
+#define CLIENT_HUD_H
 
 #include "../common/weapons/all.qh"
 
+bool HUD_Radar_Clickable();
+void HUD_Radar_Mouse();
+
 REGISTRY(hud_panels, 24)
 REGISTER_REGISTRY(Registerhud_panels)
 
@@ -17,6 +20,12 @@ REGISTER_REGISTRY(Registerhud_panels)
 
 #define HUD_PANEL(NAME) HUD_PANEL_##NAME
 
+// draw the background/borders
+#define HUD_Panel_DrawBg(theAlpha) do {                                                                                                                                                                \
+       if(panel.current_panel_bg != "0" && panel.current_panel_bg != "")                                                                                               \
+               draw_BorderPicture(panel_pos - '1 1 0' * panel_bg_border, panel.current_panel_bg, panel_size + '1 1 0' * 2 * panel_bg_border, panel_bg_color, panel_bg_alpha * theAlpha, '1 1 0' * (panel_bg_border/BORDER_MULTIPLIER));\
+} while(0)
+
 int panel_order[hud_panels_MAX];
 string hud_panelorder_prev;
 
@@ -28,6 +37,7 @@ bool hud_panel_radar_temp_hidden;
 bool chat_panel_modified;
 bool radar_panel_modified;
 
+float HUD_Radar_InputEvent(float bInputType, float nPrimary, float nSecondary);
 void HUD_Radar_Hide_Maximized();
 
 void HUD_Reset (void);
index 55c6c061eaae81fe8b6c77cc8a8249fe77627034..148c0ec8e057ca0c523fb1d46a61d310438a8087 100644 (file)
@@ -1,11 +1,7 @@
 #include "hud_config.qh"
-#include "_all.qh"
 
 #include "hud.qh"
 
-#include "../common/constants.qh"
-
-
 #define HUD_Write(s) fputs(fh, s)
 // q: quoted, n: not quoted
 #define HUD_Write_Cvar_n(cvar) HUD_Write(strcat("seta ", cvar, " ", cvar_string(cvar), "\n"))
index bac199750e11a40c94fa81b5aa704cfb23804007..05792286da30ae888483227e59178f0065fb7c28 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef HUD_CONFIG_H
-#define HUD_CONFIG_H
+#ifndef CLIENT_HUD_CONFIG_H
+#define CLIENT_HUD_CONFIG_H
 
 const int S_MOUSE1 = 1;
 const int S_MOUSE2 = 2;
index 93c4103a9cd993ae2fdc7c45e050bd7e887ce2c3..4d52c8eee198e91db4b4cd667c610db450d8de7e 100644 (file)
@@ -1,11 +1,5 @@
 #include "laser.qh"
-#include "_all.qh"
 
-#include "hook.qh"
-
-#include "../common/buffs/all.qh"
-
-#include "../csqcmodellib/cl_model.qh"
 #include "../csqcmodellib/interpolate.qh"
 
 // a laser goes from origin in direction angles
index 86210eee1d4265db7ddbf722db510b6262c367ea..32c6cd81e400174ba00ff225f87a257e9d8cc072 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef LASER_H
-#define LASER_H
+#ifndef CLIENT_LASER_H
+#define CLIENT_LASER_H
 
 void Ent_Laser();
 
index ff9fe0f7f96c7e190319df7984794693867ef55b..8571d43a3b8a8a7f04f81c72f71ab22d34885b98 100644 (file)
@@ -1,5 +1,4 @@
 #include "main.qh"
-#include "_all.qh"
 
 #include "controlpoint.qh"
 #include "damage.qh"
 #include "laser.qh"
 #include "mapvoting.qh"
 #include "modeleffects.qh"
+#include "mutators/events.qh"
 #include "particles.qh"
+#include "quickmenu.qh"
 #include "scoreboard.qh"
 #include "shownames.qh"
 #include "tuba.qh"
 #include "t_items.qh"
 #include "wall.qh"
-
-#include "../common/vehicles/all.qh"
-
-#include "mutators/events.qh"
-
 #include "weapons/projectile.qh"
-
-#include "../common/buffs/all.qh"
 #include "../common/deathtypes.qh"
-#include "../common/effects/effects.qh"
+#include "../common/items/all.qh"
 #include "../common/mapinfo.qh"
-#include "../common/monsters/all.qh"
-#include "../common/nades/all.qh"
+#include "../common/minigames/cl_minigames.qh"
+#include "../common/minigames/cl_minigames_hud.qh"
 #include "../common/net_notice.qh"
-#include "../common/notifications.qh"
-#include "../common/stats.qh"
-#include "../common/teams.qh"
-
-#include "../common/items/all.qh"
-
-#include "../common/mutators/base.qh"
-
-#include "../common/weapons/all.qh"
-
-#include "../csqcmodellib/cl_model.qh"
-#include "../csqcmodellib/interpolate.qh"
-
 #include "../common/triggers/include.qh"
-
 #include "../common/turrets/cl_turrets.qh"
-
+#include "../common/vehicles/all.qh"
+#include "../csqcmodellib/cl_model.qh"
+#include "../csqcmodellib/interpolate.qh"
 #include "../warpzonelib/client.qh"
 
 // --------------------------------------------------------------------------
@@ -148,7 +130,6 @@ void CSQC_Init(void)
 
        // needs to be done so early because of the constants they create
        static_init();
-       CALL_ACCUMULATED_FUNCTION(RegisterNotifications);
        CALL_ACCUMULATED_FUNCTION(RegisterDeathtypes);
 
        // precaches
index d403984d38a08bcac4073496dee4e320310ac14e..acd0bcb1ef3651f2c0f7798ae756fcc6e36dd88a 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef MAIN_H
-#define MAIN_H
+#ifndef CLIENT_MAIN_H
+#define CLIENT_MAIN_H
 
 #include "../common/constants.qh"
 
index 010f424f1aa73b2330db0db12c79006559825a9f..21bb421a960d3a0a4b8738b32ad9bc6d1ba0df26 100644 (file)
@@ -1,11 +1,9 @@
 #include "mapvoting.qh"
-#include "_all.qh"
 
 #include "hud.qh"
 #include "scoreboard.qh"
 
 #include "../common/mapinfo.qh"
-#include "../common/util.qh"
 
 
 int mv_num_maps;
index 7a9a511a2be129fb6e292c85e2e24f468bcea786..c1c27ad5b13640cf39fa69e4be6e19c427bbe98b 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef MAPVOTING_H
-#define MAPVOTING_H
+#ifndef CLIENT_MAPVOTING_H
+#define CLIENT_MAPVOTING_H
 
 #include "../common/constants.qh"
 void MapVote_Draw();
index 9bf0a855fa5375e53db412db0f7cae6d89e3efa0..8a5b70704565d9d59ff75bf6fdb74cab724d75b0 100644 (file)
@@ -1,12 +1,10 @@
 #include "miscfunctions.qh"
-#include "_all.qh"
 
 #include "hud.qh"
 
 #include "../common/command/generic.qh"
 
 #include "../common/teams.qh"
-#include "../common/util.qh"
 
 #include "../csqcmodellib/cl_model.qh"
 
index 9ac46340dd45a40ec01982bd9961d25ac5baec6b..b223d88b9ee1408f755ad627acf9c6aeff6558a6 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef MISCFUNCTIONS_H
-#define MISCFUNCTIONS_H
+#ifndef CLIENT_MISCFUNCTIONS_H
+#define CLIENT_MISCFUNCTIONS_H
 
 entity players;
 entity teams;
index a10062a9f758c21c795824c464b9d2097102eab9..d870d81e98a32d487600821a91bc5bdac553c1ec 100644 (file)
@@ -1,5 +1,4 @@
 #include "modeleffects.qh"
-#include "_all.qh"
 
 .float cnt;
 .float scale;
index d4b98e0a5928c6a87f802bfc07aaa534a97f00cb..32641f394e495812740e3b296510ade106369e0b 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef MODELEFFECTS_H
-#define MODELEFFECTS_H
+#ifndef CLIENT_MODELEFFECTS_H
+#define CLIENT_MODELEFFECTS_H
 
 entityclass(ModelEffect);
 class(ModelEffect) .float frame1time;
index 6d73e24b0bb514f323706a1d75b45610d7fe0a52..75f293feb0ff1bc5d9f8f17f72bfd311c881879c 100644 (file)
@@ -1,8 +1,6 @@
 #include "particles.qh"
-#include "_all.qh"
 
 #include "../common/stats.qh"
-#include "../common/util.qh"
 
 #include "../warpzonelib/common.qh"
 
index 06cd72523dafe02c7da53b33db59e35837fc2b6c..3735641afa6d7ee03f66957e4b2769d131f57464 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef PARTICLES_H
-#define PARTICLES_H
+#ifndef CLIENT_PARTICLES_H
+#define CLIENT_PARTICLES_H
 .int dphitcontentsmask;
 
 entityclass(PointParticles);
index 584a1978015222c3e4604cec92bb2b2666706e29..cdb1fdf74d6e6c5455ba18dbf987fc8879187aa2 100644 (file)
@@ -1,9 +1,11 @@
 #include "player_skeleton.qh"
 
-#include "../common/csqcmodel_settings.qh"
-
+#include "mutators/events.qh"
+#include "../csqcmodellib/cl_player.qh"
 #include "../warpzonelib/anglestransform.qh"
 
+.vector v_angle;
+
 class(Skeleton) .float skeleton_info_modelindex;
 class(Skeleton) .float skeleton_info_skin;
 const int BONETYPE_LOWER = 0;
index 4a37df5e458b4923b3ca6fa298a3c34feb78aa89..48a3111d32210cd12b7d272b65f859137c719966 100644 (file)
@@ -1,7 +1,5 @@
-#ifndef PLAYER_SKELETON
-#define PLAYER_SKELETON
-
-#include "../common/util.qh"
+#ifndef CLIENT_PLAYER_SKELETON
+#define CLIENT_PLAYER_SKELETON
 
 void free_skeleton_from_frames(entity e);
 void skeleton_from_frames(entity e, float is_dead);
index e1e96ef135d75fba3241d75426f31b2700813798..367e5ffd5445648e1c0debe553124cf179e022de 100644 (file)
@@ -1,4 +1,5 @@
 #include "../lib/_all.inc"
+#include "_all.qh"
 
 #include "announcer.qc"
 #include "bgmscript.qc"
 #include "view.qc"
 #include "wall.qc"
 
-#include "command/all.qc"
+#include "commands/all.qc"
 
 #include "weapons/projectile.qc" // TODO
 
 #include "../common/animdecide.qc"
-#include "../common/effects/effects.qc"
 #include "../common/effects/effectinfo.qc"
 #include "../common/mapinfo.qc"
 #include "../common/movetypes/include.qc"
@@ -48,6 +48,7 @@
 #include "../common/minigames/cl_minigames.qc"
 
 #include "../common/buffs/all.qc"
+#include "../common/effects/all.qc"
 #include "../common/items/all.qc"
 #include "../common/monsters/all.qc"
 #include "../common/mutators/all.qc"
index dd2ba0315485d7ab08fe28f828de4fbe3211ed23..1f7be0c500ca33663a11463d1e96233982b048ed 100644 (file)
@@ -1,6 +1,8 @@
-#include "_all.qh"
+#include "quickmenu.qh"
 
+#include "hud.qh"
 #include "hud_config.qh"
+#include "mapvoting.qh"
 
 // QUICKMENU_MAXLINES must be <= 10
 const int QUICKMENU_MAXLINES = 10;
diff --git a/qcsrc/client/quickmenu.qh b/qcsrc/client/quickmenu.qh
new file mode 100644 (file)
index 0000000..cf5f666
--- /dev/null
@@ -0,0 +1,8 @@
+#ifndef CLIENT_QUICKMENU_H
+#define CLIENT_QUICKMENU_H
+
+bool QuickMenu_InputEvent(float bInputType, float nPrimary, float nSecondary);
+bool QuickMenu_IsOpened();
+void QuickMenu_Mouse();
+
+#endif
index b19406c77e3e0afc9ce1719aa49db9dd8db92295..944116802559089519025d01219e79a9f50cb5be 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef RUBBLE_H
-#define RUBBLE_H
+#ifndef CLIENT_RUBBLE_H
+#define CLIENT_RUBBLE_H
 entityclass(Rubble);
 class(Rubble) .float creationtime;
 void RubbleLimit(string cname, float limit, void() deleteproc);
index a1d9a50dcd5aeb1943a3fc896cd0d46e440e07bc..adbac93c8fed9fd56b28bf2ffb2e25d5baba951b 100644 (file)
@@ -1,6 +1,6 @@
 #include "scoreboard.qh"
-#include "_all.qh"
 
+#include "quickmenu.qh"
 #include "hud.qh"
 
 #include "../common/constants.qh"
@@ -8,7 +8,6 @@
 #include "../common/minigames/cl_minigames.qh"
 #include "../common/stats.qh"
 #include "../common/teams.qh"
-#include "../common/util.qh"
 
 float scoreboard_alpha_bg;
 float scoreboard_alpha_fg;
index e1c5addb49f0474861188f571b5f0520c7a2e181..5b5f812a0ab448e43d058313894e926b45eb4e02 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef SCOREBOARD_H
-#define SCOREBOARD_H
+#ifndef CLIENT_SCOREBOARD_H
+#define CLIENT_SCOREBOARD_H
 
 float xmin, xmax, ymin, ymax, sbwidth;
 
index fc4649537a4c689763d13e7452fe7ff0e4ecb1f4..994a1ae303ff283e4ef54e4a7df1b4e51ac12e54 100644 (file)
@@ -1,12 +1,10 @@
 #include "shownames.qh"
-#include "_all.qh"
 
 #include "hud.qh"
 
 #include "../common/constants.qh"
 #include "../common/mapinfo.qh"
 #include "../common/teams.qh"
-#include "../common/util.qh"
 
 #include "../csqcmodellib/cl_model.qh"
 
index 63fd92e041da6e2505d0d015e2cac576904f2f86..1304c537059f232cc8f82e60018b1f2d469eff3c 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef SHOWNAMES_H
-#define SHOWNAMES_H
+#ifndef CLIENT_SHOWNAMES_H
+#define CLIENT_SHOWNAMES_H
 
 entityclass(ShowNames);
 class(ShowNames) .float healthvalue;
index 4e43a9662469377c2f2c383c47bddb5cf5b6b5ae..9bb99f41dec1896ee36fdfdd6e005f7a6710190c 100644 (file)
@@ -1,8 +1,6 @@
-#include "_all.qh"
 
 #include "../common/buffs/all.qh"
 #include "../common/movetypes/movetypes.qh"
-#include "../common/util.qh"
 #include "../common/weapons/all.qh"
 #include "../csqcmodellib/cl_model.qh"
 #include "../csqcmodellib/common.qh"
index 7623e9df86dd8d3ad637e0a9768321a7392c17e1..d429d200529df11dd6ed0b555ff7d34634fb0f89 100644 (file)
@@ -1,9 +1,8 @@
 #include "teamradar.qh"
-#include "_all.qh"
 
 #include "hud.qh"
 
-#include "../common/util.qh"
+#include "../common/mutators/mutator/waypoints/all.qh"
 
 #include "../csqcmodellib/interpolate.qh"
 
index 78ef5ee714e93f17c41841e8716368c1bc370179..b882f39fbdafa7e14e4a5c5c4de18cb57a2f0c23 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef TEAMRADAR_H
-#define TEAMRADAR_H
+#ifndef CLIENT_TEAMRADAR_H
+#define CLIENT_TEAMRADAR_H
 
 const int MAX_TEAMRADAR_TIMES = 32;
 
index 91ccbba5c853e7d1d7367e1da60c0f404cefefca..ed2964936a3bd3942ba90cf1af2921c5d5197fcd 100644 (file)
@@ -1,8 +1,6 @@
 #include "tuba.qh"
-#include "_all.qh"
 
 #include "../common/constants.qh"
-#include "../common/util.qh"
 
 
 #define TUBA_STARTNOTE(i, n) W_Sound(strcat("tuba", (i ? ftos(i) : ""), "_loopnote", ftos(n)))
index 6fe103f70676c62ff4f156e30aadea7a8f4a075f..e936dcd6ec61885fa2ad2748f23048375cfa5d1b 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef TUBA_H
-#define TUBA_H
+#ifndef CLIENT_TUBA_H
+#define CLIENT_TUBA_H
 void Ent_TubaNote(bool isNew);
 void Tuba_Precache();
 
index 3bb5585f35931ce09cd01f96c4be1741f725fd82..6fcc79b2410c51f87cf5fd929c18309390119efb 100644 (file)
@@ -1,4 +1,3 @@
-#include "_all.qh"
 
 #include "announcer.qh"
 #include "hook.qh"
@@ -7,6 +6,7 @@
 #include "mapvoting.qh"
 #include "scoreboard.qh"
 #include "shownames.qh"
+#include "quickmenu.qh"
 
 #include "mutators/events.qh"
 
 #include "../common/stats.qh"
 #include "../common/triggers/target/music.qh"
 #include "../common/teams.qh"
-#include "../common/util.qh"
 
+#include "../common/vehicles/all.qh"
 #include "../common/weapons/all.qh"
+#include "../common/viewloc.qh"
+#include "../common/minigames/cl_minigames.qh"
+#include "../common/minigames/cl_minigames_hud.qh"
 
 #include "../csqcmodellib/cl_player.qh"
 
index f17b54a5caa7bf0f877593c1cd1a811d148fcb46..b97f757a77be22dec4975d6fba27243d36cc6b7d 100644 (file)
@@ -1,9 +1,7 @@
 #include "wall.qh"
-#include "_all.qh"
 
 #include "bgmscript.qh"
 
-#include "../common/util.qh"
 
 #include "../csqcmodellib/interpolate.qh"
 
index f44355fc284092de6498b94cbccc2eef03e5deb9..e05bb615edcf8713700d674e46f34be6326578ac 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef WALL_H
-#define WALL_H
+#ifndef CLIENT_WALL_H
+#define CLIENT_WALL_H
 
 entityclass(Wall);
 class(Wall) .float lip;
index 22443043d2ae4b699e0360a466c8c7518dd8c6a8..b52a3fac16007ec892ac5bb27bce551fb47247f2 100644 (file)
@@ -3,11 +3,11 @@
 #include "../autocvars.qh"
 #include "../defs.qh"
 #include "../main.qh"
+#include "../mutators/events.qh"
 
 #include "../../common/constants.qh"
 #include "../../common/nades/all.qh"
 #include "../../common/movetypes/movetypes.qh"
-#include "../../common/util.qh"
 
 #include "../../csqcmodellib/interpolate.qh"
 
index dd289817ec15b034e01d1a3b89ec13cc51227dac..5a0deb4990d20af00bf47f54f265e7f4c562976d 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef PROJECTILE_H
-#define PROJECTILE_H
+#ifndef CLIENT_WEAPONS_PROJECTILE_H
+#define CLIENT_WEAPONS_PROJECTILE_H
 
 entityclass(Projectile);
 class(Projectile) .int traileffect;
index e2bda23a0239b7adeb5667c0308f20443da5f308..23f43b9e94a74535614eb5919480d1a2db41236c 100644 (file)
@@ -1,4 +1,7 @@
 #include "animdecide.qh"
+
+#include "monsters/all.qh"
+
 #if defined(SVQC)
     #include "util.qh"
     #include "../server/defs.qh"
index 6649950ddedf8d46dab5578cc37badc12422d25d..5412c22b4b8436bc07b36ac2c974a98ab29903b4 100644 (file)
@@ -10,7 +10,7 @@
 #endif
 
 #ifdef CSQC
-       #include "../../client/command/cl_cmd.qh"
+       #include "../../client/commands/cl_cmd.qh"
 #endif
 
 #ifdef SVQC
diff --git a/qcsrc/common/effects/all.inc b/qcsrc/common/effects/all.inc
new file mode 100644 (file)
index 0000000..d53ded9
--- /dev/null
@@ -0,0 +1,295 @@
+// Global list of effects, networked to CSQC by ID to save bandwidth and to use client particle numbers (allows mismatching effectinfos to some degree)
+// Not too concerned about the order of this list, just keep the weapon effects together!
+
+#include "../teams.qh"
+
+// EFFECT(istrail, EFFECT_NAME,     "effectinfo_string")
+EFFECT(0, EXPLOSION_SMALL,          "explosion_small")
+EFFECT(0, EXPLOSION_MEDIUM,         "explosion_medium")
+EFFECT(0, EXPLOSION_BIG,            "explosion_big")
+
+EFFECT(0, SMOKE_SMALL,              "smoke_small")
+EFFECT(0, SMOKE_LARGE,              "smoke_large")
+
+
+
+EFFECT(0, BLASTER_IMPACT,           "laser_impact")
+EFFECT(0, BLASTER_MUZZLEFLASH,      "laser_muzzleflash")
+
+EFFECT(0, SHOTGUN_IMPACT,           "shotgun_impact")
+EFFECT(0, SHOTGUN_MUZZLEFLASH,      "shotgun_muzzleflash")
+
+EFFECT(0, ARC_BEAM,                 "arc_beam")
+EFFECT(0, ARC_BEAM_HEAL,            "arc_beam_heal")
+EFFECT(0, ARC_BEAM_HEAL_IMPACT,     "arc_beam_healimpact")
+EFFECT(0, ARC_BEAM_HEAL_IMPACT2,    "healray_impact")
+EFFECT(0, ARC_LIGHTNING,            "arc_lightning")
+EFFECT(0, ARC_LIGHTNING2,           "electro_lightning")
+
+EFFECT(0, MACHINEGUN_IMPACT,        "machinegun_impact")
+EFFECT(0, MACHINEGUN_MUZZLEFLASH,   "uzi_muzzleflash")
+
+EFFECT(0, GRENADE_EXPLODE,          "grenade_explode")
+EFFECT(0, GRENADE_MUZZLEFLASH,      "grenadelauncher_muzzleflash")
+
+EFFECT(0, ELECTRO_BALLEXPLODE,      "electro_ballexplode")
+EFFECT(0, ELECTRO_COMBO,            "electro_combo")
+EFFECT(0, ELECTRO_IMPACT,           "electro_impact")
+EFFECT(0, ELECTRO_MUZZLEFLASH,      "electro_muzzleflash")
+
+EFFECT(0, CRYLINK_IMPACT,           "crylink_impactbig")
+EFFECT(0, CRYLINK_IMPACT2,          "crylink_impact")
+EFFECT(0, CRYLINK_JOINEXPLODE,      "crylink_joinexplode")
+EFFECT(0, CRYLINK_MUZZLEFLASH,      "crylink_muzzleflash")
+
+EFFECT(0, VORTEX_BEAM,              "nex_beam")
+EFFECT(0, VORTEX_BEAM_OLD,          "TE_TEI_G3")
+EFFECT(0, VORTEX_IMPACT,            "nex_impact")
+EFFECT(0, VORTEX_MUZZLEFLASH,       "nex_muzzleflash")
+
+EFFECT(1, VAPORIZER_RED,            "TE_TEI_G3RED")
+EFFECT(1, VAPORIZER_HIT_RED,        "TE_TEI_G3RED_HIT")
+EFFECT(1, VAPORIZER_BLUE,           "TE_TEI_G3BLUE")
+EFFECT(1, VAPORIZER_HIT_BLUE,       "TE_TEI_G3BLUE_HIT")
+EFFECT(1, VAPORIZER_YELLOW,         "TE_TEI_G3YELLOW")
+EFFECT(1, VAPORIZER_HIT_YELLOW,     "TE_TEI_G3YELLOW_HIT")
+EFFECT(1, VAPORIZER_PINK,           "TE_TEI_G3PINK")
+EFFECT(1, VAPORIZER_HIT_PINK,       "TE_TEI_G3PINK_HIT")
+EFFECT(1, VAPORIZER_NEUTRAL,        "TE_TEI_G3")
+EFFECT(1, VAPORIZER_HIT_NEUTRAL,    "TE_TEI_G3_HIT")
+entity EFFECT_VAPORIZER(int teamid)
+{
+    switch (teamid) {
+        case NUM_TEAM_1:    return EFFECT_VAPORIZER_RED;
+        case NUM_TEAM_2:    return EFFECT_VAPORIZER_BLUE;
+        case NUM_TEAM_3:    return EFFECT_VAPORIZER_YELLOW;
+        case NUM_TEAM_4:    return EFFECT_VAPORIZER_PINK;
+        default:            return EFFECT_VAPORIZER_NEUTRAL;
+    }
+}
+entity EFFECT_VAPORIZER_HIT(int teamid)
+{
+    switch (teamid) {
+        case NUM_TEAM_1:    return EFFECT_VAPORIZER_HIT_RED;
+        case NUM_TEAM_2:    return EFFECT_VAPORIZER_HIT_BLUE;
+        case NUM_TEAM_3:    return EFFECT_VAPORIZER_HIT_YELLOW;
+        case NUM_TEAM_4:    return EFFECT_VAPORIZER_HIT_PINK;
+        default:            return EFFECT_VAPORIZER_HIT_NEUTRAL;
+    }
+}
+
+EFFECT(0, RIFLE_IMPACT,             "machinegun_impact")
+EFFECT(0, RIFLE_MUZZLEFLASH,        "rifle_muzzleflash")
+EFFECT(1, RIFLE,                    "tr_rifle")
+EFFECT(1, RIFLE_WEAK,               "tr_rifle_weak")
+
+EFFECT(0, HAGAR_BOUNCE,             "hagar_bounce")
+EFFECT(0, HAGAR_EXPLODE,            "hagar_explode")
+EFFECT(0, HAGAR_MUZZLEFLASH,        "hagar_muzzleflash")
+EFFECT(1, HAGAR_ROCKET,             "tr_hagar")
+
+EFFECT(0, ROCKET_EXPLODE,           "rocket_explode")
+EFFECT(0, ROCKET_GUIDE,             "rocket_guide")
+EFFECT(0, ROCKET_MUZZLEFLASH,       "rocketlauncher_muzzleflash")
+
+EFFECT(0, HOOK_EXPLODE,             "hookbomb_explode")
+EFFECT(0, HOOK_IMPACT,              "grapple_impact")
+EFFECT(0, HOOK_MUZZLEFLASH,         "grapple_muzzleflash")
+
+EFFECT(0, SEEKER_MUZZLEFLASH,       "seeker_muzzleflash")
+
+EFFECT(0, FLAK_BOUNCE,              "flak_bounce")
+
+EFFECT(1, FIREBALL,                 "fireball")
+EFFECT(0, FIREBALL_BFGDAMAGE,       "fireball_bfgdamage")
+EFFECT(0, FIREBALL_EXPLODE,         "fireball_explode")
+EFFECT(0, FIREBALL_LASER,           "fireball_laser")
+EFFECT(0, FIREBALL_MUZZLEFLASH,     "fireball_muzzleflash")
+EFFECT(0, FIREBALL_PRE_MUZZLEFLASH, "fireball_preattack_muzzleflash")
+
+
+
+EFFECT(0, RAPTOR_CANNON_IMPACT,     "raptor_cannon_impact")
+EFFECT(0, RAPTOR_BOMB_IMPACT,       "raptor_bomb_impact")
+EFFECT(0, RAPTOR_BOMB_SPREAD,       "raptor_bomb_spread")
+EFFECT(0, RAPTOR_MUZZLEFLASH,       "raptor_cannon_muzzleflash")
+
+EFFECT(0, RACER_BOOSTER,            "wakizashi_booster_smoke")
+EFFECT(0, RACER_IMPACT,             "wakizashi_gun_impact")
+EFFECT(0, RACER_MUZZLEFLASH,        "wakizashi_gun_muzzleflash")
+EFFECT(0, RACER_ROCKETLAUNCH,       "wakizashi_rocket_launch")
+EFFECT(0, RACER_ROCKET_EXPLODE,     "wakizashi_rocket_launch")
+EFFECT(1, RACER_ROCKET_TRAIL,       "wakizashi_rocket_thrust")
+
+EFFECT(0, SPIDERBOT_ROCKETLAUNCH,           "spiderbot_rocket_launch")
+EFFECT(1, SPIDERBOT_ROCKET_TRAIL,           "spiderbot_rocket_thrust")
+EFFECT(0, SPIDERBOT_ROCKET_EXPLODE,         "spiderbot_rocket_explode")
+EFFECT(0, SPIDERBOT_MINIGUN_IMPACT,         "spiderbot_minigun_impact")
+EFFECT(0, SPIDERBOT_MINIGUN_MUZZLEFLASH,    "spiderbot_minigun_muzzleflash")
+
+EFFECT(0, BUMBLEBEE_HEAL_MUZZLEFLASH,   "healray_muzzleflash")
+EFFECT(0, BUMBLEBEE_HEAL_IMPACT,        "healray_impact")
+
+EFFECT(0, BIGPLASMA_IMPACT,         "bigplasma_impact")
+EFFECT(0, BIGPLASMA_MUZZLEFLASH,    "bigplasma_muzzleflash")
+
+EFFECT(0, TELEPORT,                 "teleport")
+
+EFFECT(0, SPAWNPOINT_RED,           "spawn_point_red")
+EFFECT(0, SPAWN_RED,                "spawn_event_red")
+EFFECT(0, SPAWNPOINT_BLUE,          "spawn_point_blue")
+EFFECT(0, SPAWN_BLUE,               "spawn_event_blue")
+EFFECT(0, SPAWNPOINT_YELLOW,        "spawn_point_yellow")
+EFFECT(0, SPAWN_YELLOW,             "spawn_event_yellow")
+EFFECT(0, SPAWNPOINT_PINK,          "spawn_point_pink")
+EFFECT(0, SPAWN_PINK,               "spawn_event_pink")
+EFFECT(0, SPAWNPOINT_NEUTRAL,       "spawn_point_neutral")
+EFFECT(0, SPAWN_NEUTRAL,            "spawn_event_neutral")
+
+EFFECT(0, NADE_EXPLODE_RED,         "nade_red_explode")
+EFFECT(0, NADE_EXPLODE_BLUE,        "nade_blue_explode")
+EFFECT(0, NADE_EXPLODE_YELLOW,      "nade_yellow_explode")
+EFFECT(0, NADE_EXPLODE_PINK,        "nade_pink_explode")
+EFFECT(0, NADE_EXPLODE_NEUTRAL,     "nade_neutral_explode")
+entity EFFECT_NADE_EXPLODE(int teamid)
+{
+    switch (teamid) {
+        case NUM_TEAM_1:    return EFFECT_NADE_EXPLODE_RED;
+        case NUM_TEAM_2:    return EFFECT_NADE_EXPLODE_BLUE;
+        case NUM_TEAM_3:    return EFFECT_NADE_EXPLODE_YELLOW;
+        case NUM_TEAM_4:    return EFFECT_NADE_EXPLODE_PINK;
+        default:                   return EFFECT_NADE_EXPLODE_NEUTRAL;
+    }
+}
+
+EFFECT(1, NADE_TRAIL_RED,           "nade_red")
+EFFECT(1, NADE_TRAIL_BLUE,          "nade_blue")
+EFFECT(1, NADE_TRAIL_YELLOW,        "nade_yellow")
+EFFECT(1, NADE_TRAIL_PINK,          "nade_pink")
+EFFECT(1, NADE_TRAIL_NEUTRAL,       "nade_neutral")
+entity EFFECT_NADE_TRAIL(int teamid)
+{
+    switch (teamid) {
+        case NUM_TEAM_1:    return EFFECT_NADE_TRAIL_RED;
+        case NUM_TEAM_2:    return EFFECT_NADE_TRAIL_BLUE;
+        case NUM_TEAM_3:    return EFFECT_NADE_TRAIL_YELLOW;
+        case NUM_TEAM_4:    return EFFECT_NADE_TRAIL_PINK;
+        default:            return EFFECT_NADE_TRAIL_NEUTRAL;
+    }
+}
+
+EFFECT(1, NADE_TRAIL_BURN_RED,      "nade_red_burn")
+EFFECT(1, NADE_TRAIL_BURN_BLUE,     "nade_blue_burn")
+EFFECT(1, NADE_TRAIL_BURN_YELLOW,   "nade_yellow_burn")
+EFFECT(1, NADE_TRAIL_BURN_PINK,     "nade_pink_burn")
+EFFECT(1, NADE_TRAIL_BURN_NEUTRAL,  "nade_neutral_burn")
+entity EFFECT_NADE_TRAIL_BURN(int teamid)
+{
+    switch (teamid) {
+        case NUM_TEAM_1:    return EFFECT_NADE_TRAIL_BURN_RED;
+        case NUM_TEAM_2:    return EFFECT_NADE_TRAIL_BURN_BLUE;
+        case NUM_TEAM_3:    return EFFECT_NADE_TRAIL_BURN_YELLOW;
+        case NUM_TEAM_4:    return EFFECT_NADE_TRAIL_BURN_PINK;
+        default:            return EFFECT_NADE_TRAIL_BURN_NEUTRAL;
+    }
+}
+
+EFFECT(0, ICEORGLASS,               "iceorglass")
+EFFECT(0, ICEFIELD,                 "icefield")
+EFFECT(0, FIREFIELD,                "firefield")
+EFFECT(0, HEALING,                  "healing_fx")
+EFFECT(1, LASER_BEAM_FAST,          "nex242_misc_laser_beam_fast")
+EFFECT(0, RESPAWN_GHOST,            "respawn_ghost")
+
+EFFECT(0, FLAG_TOUCH_RED,           "redflag_touch")
+EFFECT(0, FLAG_TOUCH_BLUE,          "blueflag_touch")
+EFFECT(0, FLAG_TOUCH_YELLOW,        "yellowflag_touch")
+EFFECT(0, FLAG_TOUCH_PINK,          "pinkflag_touch")
+EFFECT(0, FLAG_TOUCH_NEUTRAL,       "neutralflag_touch")
+entity EFFECT_FLAG_TOUCH(int teamid)
+{
+    switch (teamid) {
+        case NUM_TEAM_1:    return EFFECT_FLAG_TOUCH_RED;
+        case NUM_TEAM_2:    return EFFECT_FLAG_TOUCH_BLUE;
+        case NUM_TEAM_3:    return EFFECT_FLAG_TOUCH_YELLOW;
+        case NUM_TEAM_4:    return EFFECT_FLAG_TOUCH_PINK;
+        default:            return EFFECT_FLAG_TOUCH_NEUTRAL;
+    }
+}
+
+EFFECT(1, PASS_RED,                 "red_pass")
+EFFECT(1, PASS_BLUE,                "blue_pass")
+EFFECT(1, PASS_YELLOW,              "yellow_pass")
+EFFECT(1, PASS_PINK,                "pink_pass")
+EFFECT(1, PASS_NEUTRAL,             "neutral_pass")
+
+EFFECT(0, CAP_RED,                  "red_cap")
+EFFECT(0, CAP_BLUE,                 "blue_cap")
+EFFECT(0, CAP_YELLOW,               "yellow_cap")
+EFFECT(0, CAP_PINK,                 "pink_cap")
+EFFECT(0, CAP_NEUTRAL,              "neutral_cap")
+entity EFFECT_CAP(int teamid)
+{
+    switch (teamid) {
+        case NUM_TEAM_1:    return EFFECT_CAP_RED;
+        case NUM_TEAM_2:    return EFFECT_CAP_BLUE;
+        case NUM_TEAM_3:    return EFFECT_CAP_YELLOW;
+        case NUM_TEAM_4:    return EFFECT_CAP_PINK;
+        default:            return EFFECT_CAP_NEUTRAL;
+    }
+}
+
+EFFECT(0, ITEM_PICKUP,              "item_pickup")
+EFFECT(0, ITEM_RESPAWN,             "item_respawn")
+
+EFFECT(0, ONS_GENERATOR_DAMAGED,    "torch_small")
+EFFECT(0, ONS_GENERATOR_GIB,        "onslaught_generator_gib_explode")
+EFFECT(0, ONS_GENERATOR_EXPLODE,    "onslaught_generator_smallexplosion")
+EFFECT(0, ONS_GENERATOR_EXPLODE2,   "onslaught_generator_finalexplosion")
+
+
+
+EFFECT(0, LASER_DEADLY,             "laser_deadly")
+EFFECT(1, FLAC_TRAIL,               "TR_SEEKER")
+EFFECT(1, SEEKER_TRAIL,             "TR_SEEKER")
+EFFECT(1, FIREMINE,                 "firemine")
+EFFECT(0, BALL_SPARKS,              "kaball_sparks")
+EFFECT(0, ELECTRIC_SPARKS,          "electricity_sparks")
+EFFECT(0, SPARKS,                   "sparks")
+EFFECT(0, RAGE,                     "rage")
+EFFECT(0, SMOKING,                  "smoking")
+EFFECT(0, SMOKE_RING,               "smoke_ring")
+EFFECT(0, JUMPPAD,                  "jumppad_activate")
+EFFECT(1, BULLET,                   "tr_bullet")
+EFFECT(0, EF_FLAME,                 "EF_FLAME")
+EFFECT(0, EF_STARDUST,              "EF_STARDUST")
+EFFECT(0, TE_EXPLOSION,             "TE_EXPLOSION")
+EFFECT(1, TR_NEXUIZPLASMA,          "TR_NEXUIZPLASMA")
+EFFECT(1, TR_CRYLINKPLASMA,         "TR_CRYLINKPLASMA")
+EFFECT(1, TR_ROCKET,                "TR_ROCKET")
+EFFECT(1, TR_GRENADE,               "TR_GRENADE")
+EFFECT(1, TR_BLOOD,                 "TR_BLOOD")
+EFFECT(1, TR_WIZSPIKE,              "TR_WIZSPIKE")
+EFFECT(1, TR_SLIGHTBLOOD,           "TR_SLIGHTBLOOD")
+EFFECT(1, TR_KNIGHTSPIKE,           "TR_KNIGHTSPIKE")
+EFFECT(1, TR_VORESPIKE,             "TR_VORESPIKE")
+EFFECT(0, TE_SPARK,                 "TE_SPARK")
+
+EFFECT(1, ROCKETMINSTA_LASER_RED,       "rocketminsta_laser_red")
+EFFECT(1, ROCKETMINSTA_LASER_BLUE,      "rocketminsta_laser_blue")
+EFFECT(1, ROCKETMINSTA_LASER_YELLOW,    "rocketminsta_laser_yellow")
+EFFECT(1, ROCKETMINSTA_LASER_PINK,      "rocketminsta_laser_pink")
+EFFECT(1, ROCKETMINSTA_LASER_NEUTRAL,   "rocketminsta_laser_neutral")
+entity EFFECT_ROCKETMINSTA_LASER(int teamid)
+{
+    entity e;
+    switch (teamid) {
+        case NUM_TEAM_1:    e = EFFECT_ROCKETMINSTA_LASER_RED; break;
+        case NUM_TEAM_2:    e = EFFECT_ROCKETMINSTA_LASER_BLUE; break;
+        case NUM_TEAM_3:    e = EFFECT_ROCKETMINSTA_LASER_YELLOW; break;
+        case NUM_TEAM_4:    e = EFFECT_ROCKETMINSTA_LASER_PINK; break;
+        default:            e = EFFECT_ROCKETMINSTA_LASER_NEUTRAL; break;
+    }
+    if (particleeffectnum(e) < 0 || Team_TeamToNumber(teamid) == -1) { e = EFFECT_TR_NEXUIZPLASMA; }
+    return e;
+}
diff --git a/qcsrc/common/effects/all.qc b/qcsrc/common/effects/all.qc
new file mode 100644 (file)
index 0000000..e90f3c6
--- /dev/null
@@ -0,0 +1,93 @@
+#include "all.qh"
+
+#ifdef CSQC
+void Read_Effect(bool is_new)
+{
+       int net_name = (Effects_COUNT >= 255) ? ReadShort() : ReadByte();
+
+       entity eff = Effects[net_name];
+
+       vector v, vel = '0 0 0';
+       int eff_cnt = 1;
+       bool eff_trail = eff.eent_eff_trail;
+       v_x = ReadCoord();
+       v_y = ReadCoord();
+       v_z = ReadCoord();
+
+       bool use_vel = ReadByte();
+       if(use_vel)
+       {
+               vel_x = ReadCoord();
+               vel_y = ReadCoord();
+               vel_z = ReadCoord();
+       }
+
+       if(!eff_trail)
+               eff_cnt = ReadByte();
+
+       if(is_new)
+       {
+               if(eff_trail)
+                       WarpZone_TrailParticles(world, particleeffectnum(eff), v, vel);
+               else
+                       pointparticles(particleeffectnum(eff), v, vel, eff_cnt);
+       }
+}
+#endif
+
+#ifdef SVQC
+bool Net_Write_Effect(entity this, entity client, int sf)
+{
+       WriteByte(MSG_ENTITY, ENT_CLIENT_EFFECT);
+       (Effects_COUNT >= 255)
+       ? WriteShort(MSG_ENTITY, self.m_id)
+       : WriteByte(MSG_ENTITY, self.m_id);
+       WriteCoord(MSG_ENTITY, self.eent_net_location_x);
+       WriteCoord(MSG_ENTITY, self.eent_net_location_y);
+       WriteCoord(MSG_ENTITY, self.eent_net_location_z);
+
+       // attempt to save a tiny bit more bandwidth by not sending velocity if it isn't set
+       if(self.eent_net_velocity)
+       {
+               WriteByte(MSG_ENTITY, true);
+               WriteCoord(MSG_ENTITY, self.eent_net_velocity_x);
+               WriteCoord(MSG_ENTITY, self.eent_net_velocity_y);
+               WriteCoord(MSG_ENTITY, self.eent_net_velocity_z);
+       }
+       else { WriteByte(MSG_ENTITY, false); }
+
+       if(!self.eent_eff_trail) { WriteByte(MSG_ENTITY, self.eent_net_count); }
+       return true;
+}
+
+void Send_Effect(entity eff, vector eff_loc, vector eff_vel, int eff_cnt)
+{
+       if(!eff) { return; }
+       if(!eff.eent_eff_trail && !eff_cnt) { return; } // effect has no count!
+       entity net_eff = spawn();
+       net_eff.owner = eff;
+       net_eff.classname = "net_effect";
+       //net_eff.eent_broadcast = broadcast;
+       net_eff.m_id = eff.m_id;
+       net_eff.eent_net_velocity = eff_vel;
+       net_eff.eent_net_location = eff_loc;
+       net_eff.eent_net_count = eff_cnt;
+       net_eff.eent_eff_trail = eff.eent_eff_trail;
+
+       net_eff.think = SUB_Remove;
+       net_eff.nextthink = time + 0.2; // don't need to keep this long
+
+       Net_LinkEntity(net_eff, false, 0, Net_Write_Effect);
+}
+
+void Send_Effect_(string eff_name, vector eff_loc, vector eff_vel, int eff_cnt)
+{
+       // problem with this is, we might not have all the available effects for it
+       FOREACH(Effects, it.eent_eff_name == eff_name, LAMBDA(
+               Send_Effect(it, eff_loc, eff_vel, eff_cnt);
+               return;
+       ));
+       // revert to engine handling
+       pointparticles(_particleeffectnum(eff_name), eff_loc, eff_vel, eff_cnt);
+}
+#endif
diff --git a/qcsrc/common/effects/all.qh b/qcsrc/common/effects/all.qh
new file mode 100644 (file)
index 0000000..7046af1
--- /dev/null
@@ -0,0 +1,41 @@
+#ifndef EFFECTS_ALL_H
+#define EFFECTS_ALL_H
+
+#include "effect.qh"
+
+#ifdef CSQC
+void Read_Effect(bool is_new);
+#elif defined(SVQC)
+void Send_Effect(entity eff, vector eff_loc, vector eff_vel, int eff_cnt);
+void Send_Effect_(string eff_name, vector eff_loc, vector eff_vel, int eff_cnt);
+#endif
+
+REGISTRY(Effects, BIT(8))
+REGISTER_REGISTRY(RegisterEffects)
+#define EFFECT(istrail, name, realname) \
+    REGISTER(RegisterEffects, EFFECT, Effects, name, m_id, Create_Effect_Entity(realname, istrail));
+
+void RegisterEffects_First()
+{
+    #ifdef SVQC
+    #define dedi (server_is_dedicated ? "a dedicated " : "")
+    #else
+    #define dedi ""
+    #endif
+
+    LOG_TRACEF("Beginning effect initialization on %s%s program...\n", dedi, PROGNAME);
+    #undef dedi
+}
+
+void RegisterEffects_Done()
+{
+    LOG_TRACE("Effects initialization successful!\n");
+}
+
+// NOW we actually activate the declarations
+ACCUMULATE_FUNCTION(RegisterEffects, RegisterEffects_First)
+EFFECT(0, Null, string_null)
+#include "all.inc"
+ACCUMULATE_FUNCTION(RegisterEffects, RegisterEffects_Done)
+
+#endif
diff --git a/qcsrc/common/effects/effect.qh b/qcsrc/common/effects/effect.qh
new file mode 100644 (file)
index 0000000..bd9cd99
--- /dev/null
@@ -0,0 +1,22 @@
+#ifndef EFFECT_H
+#define EFFECT_H
+
+#define particleeffectnum(e) _particleeffectnum(e.eent_eff_name)
+
+.int m_id;
+.string eent_eff_name;
+.int eent_eff_trail;
+
+.vector eent_net_location;
+.vector eent_net_velocity;
+.int eent_net_count;
+
+entity Create_Effect_Entity(string eff_name, bool eff_trail)
+{
+       entity this = new(effect_entity);
+       this.eent_eff_name = eff_name;
+       this.eent_eff_trail = eff_trail;
+       return this;
+}
+
+#endif
diff --git a/qcsrc/common/effects/effects.inc b/qcsrc/common/effects/effects.inc
deleted file mode 100644 (file)
index 4d82087..0000000
+++ /dev/null
@@ -1,293 +0,0 @@
-// Global list of effects, networked to CSQC by ID to save bandwidth and to use client particle numbers (allows mismatching effectinfos to some degree)
-// Not too concerned about the order of this list, just keep the weapon effects together!
-
-// EFFECT(istrail, EFFECT_NAME,     "effectinfo_string")
-EFFECT(0, EXPLOSION_SMALL,          "explosion_small")
-EFFECT(0, EXPLOSION_MEDIUM,         "explosion_medium")
-EFFECT(0, EXPLOSION_BIG,            "explosion_big")
-
-EFFECT(0, SMOKE_SMALL,              "smoke_small")
-EFFECT(0, SMOKE_LARGE,              "smoke_large")
-
-
-
-EFFECT(0, BLASTER_IMPACT,           "laser_impact")
-EFFECT(0, BLASTER_MUZZLEFLASH,      "laser_muzzleflash")
-
-EFFECT(0, SHOTGUN_IMPACT,           "shotgun_impact")
-EFFECT(0, SHOTGUN_MUZZLEFLASH,      "shotgun_muzzleflash")
-
-EFFECT(0, ARC_BEAM,                 "arc_beam")
-EFFECT(0, ARC_BEAM_HEAL,            "arc_beam_heal")
-EFFECT(0, ARC_BEAM_HEAL_IMPACT,     "arc_beam_healimpact")
-EFFECT(0, ARC_BEAM_HEAL_IMPACT2,    "healray_impact")
-EFFECT(0, ARC_LIGHTNING,            "arc_lightning")
-EFFECT(0, ARC_LIGHTNING2,           "electro_lightning")
-
-EFFECT(0, MACHINEGUN_IMPACT,        "machinegun_impact")
-EFFECT(0, MACHINEGUN_MUZZLEFLASH,   "uzi_muzzleflash")
-
-EFFECT(0, GRENADE_EXPLODE,          "grenade_explode")
-EFFECT(0, GRENADE_MUZZLEFLASH,      "grenadelauncher_muzzleflash")
-
-EFFECT(0, ELECTRO_BALLEXPLODE,      "electro_ballexplode")
-EFFECT(0, ELECTRO_COMBO,            "electro_combo")
-EFFECT(0, ELECTRO_IMPACT,           "electro_impact")
-EFFECT(0, ELECTRO_MUZZLEFLASH,      "electro_muzzleflash")
-
-EFFECT(0, CRYLINK_IMPACT,           "crylink_impactbig")
-EFFECT(0, CRYLINK_IMPACT2,          "crylink_impact")
-EFFECT(0, CRYLINK_JOINEXPLODE,      "crylink_joinexplode")
-EFFECT(0, CRYLINK_MUZZLEFLASH,      "crylink_muzzleflash")
-
-EFFECT(0, VORTEX_BEAM,              "nex_beam")
-EFFECT(0, VORTEX_BEAM_OLD,          "TE_TEI_G3")
-EFFECT(0, VORTEX_IMPACT,            "nex_impact")
-EFFECT(0, VORTEX_MUZZLEFLASH,       "nex_muzzleflash")
-
-EFFECT(1, VAPORIZER_RED,            "TE_TEI_G3RED")
-EFFECT(1, VAPORIZER_HIT_RED,        "TE_TEI_G3RED_HIT")
-EFFECT(1, VAPORIZER_BLUE,           "TE_TEI_G3BLUE")
-EFFECT(1, VAPORIZER_HIT_BLUE,       "TE_TEI_G3BLUE_HIT")
-EFFECT(1, VAPORIZER_YELLOW,         "TE_TEI_G3YELLOW")
-EFFECT(1, VAPORIZER_HIT_YELLOW,     "TE_TEI_G3YELLOW_HIT")
-EFFECT(1, VAPORIZER_PINK,           "TE_TEI_G3PINK")
-EFFECT(1, VAPORIZER_HIT_PINK,       "TE_TEI_G3PINK_HIT")
-EFFECT(1, VAPORIZER_NEUTRAL,        "TE_TEI_G3")
-EFFECT(1, VAPORIZER_HIT_NEUTRAL,    "TE_TEI_G3_HIT")
-entity EFFECT_VAPORIZER(int teamid)
-{
-    switch (teamid) {
-        case NUM_TEAM_1:    return EFFECT_VAPORIZER_RED;
-        case NUM_TEAM_2:    return EFFECT_VAPORIZER_BLUE;
-        case NUM_TEAM_3:    return EFFECT_VAPORIZER_YELLOW;
-        case NUM_TEAM_4:    return EFFECT_VAPORIZER_PINK;
-        default:            return EFFECT_VAPORIZER_NEUTRAL;
-    }
-}
-entity EFFECT_VAPORIZER_HIT(int teamid)
-{
-    switch (teamid) {
-        case NUM_TEAM_1:    return EFFECT_VAPORIZER_HIT_RED;
-        case NUM_TEAM_2:    return EFFECT_VAPORIZER_HIT_BLUE;
-        case NUM_TEAM_3:    return EFFECT_VAPORIZER_HIT_YELLOW;
-        case NUM_TEAM_4:    return EFFECT_VAPORIZER_HIT_PINK;
-        default:            return EFFECT_VAPORIZER_HIT_NEUTRAL;
-    }
-}
-
-EFFECT(0, RIFLE_IMPACT,             "machinegun_impact")
-EFFECT(0, RIFLE_MUZZLEFLASH,        "rifle_muzzleflash")
-EFFECT(1, RIFLE,                    "tr_rifle")
-EFFECT(1, RIFLE_WEAK,               "tr_rifle_weak")
-
-EFFECT(0, HAGAR_BOUNCE,             "hagar_bounce")
-EFFECT(0, HAGAR_EXPLODE,            "hagar_explode")
-EFFECT(0, HAGAR_MUZZLEFLASH,        "hagar_muzzleflash")
-EFFECT(1, HAGAR_ROCKET,             "tr_hagar")
-
-EFFECT(0, ROCKET_EXPLODE,           "rocket_explode")
-EFFECT(0, ROCKET_GUIDE,             "rocket_guide")
-EFFECT(0, ROCKET_MUZZLEFLASH,       "rocketlauncher_muzzleflash")
-
-EFFECT(0, HOOK_EXPLODE,             "hookbomb_explode")
-EFFECT(0, HOOK_IMPACT,              "grapple_impact")
-EFFECT(0, HOOK_MUZZLEFLASH,         "grapple_muzzleflash")
-
-EFFECT(0, SEEKER_MUZZLEFLASH,       "seeker_muzzleflash")
-
-EFFECT(0, FLAK_BOUNCE,              "flak_bounce")
-
-EFFECT(1, FIREBALL,                 "fireball")
-EFFECT(0, FIREBALL_BFGDAMAGE,       "fireball_bfgdamage")
-EFFECT(0, FIREBALL_EXPLODE,         "fireball_explode")
-EFFECT(0, FIREBALL_LASER,           "fireball_laser")
-EFFECT(0, FIREBALL_MUZZLEFLASH,     "fireball_muzzleflash")
-EFFECT(0, FIREBALL_PRE_MUZZLEFLASH, "fireball_preattack_muzzleflash")
-
-
-
-EFFECT(0, RAPTOR_CANNON_IMPACT,     "raptor_cannon_impact")
-EFFECT(0, RAPTOR_BOMB_IMPACT,       "raptor_bomb_impact")
-EFFECT(0, RAPTOR_BOMB_SPREAD,       "raptor_bomb_spread")
-EFFECT(0, RAPTOR_MUZZLEFLASH,       "raptor_cannon_muzzleflash")
-
-EFFECT(0, RACER_BOOSTER,            "wakizashi_booster_smoke")
-EFFECT(0, RACER_IMPACT,             "wakizashi_gun_impact")
-EFFECT(0, RACER_MUZZLEFLASH,        "wakizashi_gun_muzzleflash")
-EFFECT(0, RACER_ROCKETLAUNCH,       "wakizashi_rocket_launch")
-EFFECT(0, RACER_ROCKET_EXPLODE,     "wakizashi_rocket_launch")
-EFFECT(1, RACER_ROCKET_TRAIL,       "wakizashi_rocket_thrust")
-
-EFFECT(0, SPIDERBOT_ROCKETLAUNCH,           "spiderbot_rocket_launch")
-EFFECT(1, SPIDERBOT_ROCKET_TRAIL,           "spiderbot_rocket_thrust")
-EFFECT(0, SPIDERBOT_ROCKET_EXPLODE,         "spiderbot_rocket_explode")
-EFFECT(0, SPIDERBOT_MINIGUN_IMPACT,         "spiderbot_minigun_impact")
-EFFECT(0, SPIDERBOT_MINIGUN_MUZZLEFLASH,    "spiderbot_minigun_muzzleflash")
-
-EFFECT(0, BUMBLEBEE_HEAL_MUZZLEFLASH,   "healray_muzzleflash")
-EFFECT(0, BUMBLEBEE_HEAL_IMPACT,        "healray_impact")
-
-EFFECT(0, BIGPLASMA_IMPACT,         "bigplasma_impact")
-EFFECT(0, BIGPLASMA_MUZZLEFLASH,    "bigplasma_muzzleflash")
-
-EFFECT(0, TELEPORT,                 "teleport")
-
-EFFECT(0, SPAWNPOINT_RED,           "spawn_point_red")
-EFFECT(0, SPAWN_RED,                "spawn_event_red")
-EFFECT(0, SPAWNPOINT_BLUE,          "spawn_point_blue")
-EFFECT(0, SPAWN_BLUE,               "spawn_event_blue")
-EFFECT(0, SPAWNPOINT_YELLOW,        "spawn_point_yellow")
-EFFECT(0, SPAWN_YELLOW,             "spawn_event_yellow")
-EFFECT(0, SPAWNPOINT_PINK,          "spawn_point_pink")
-EFFECT(0, SPAWN_PINK,               "spawn_event_pink")
-EFFECT(0, SPAWNPOINT_NEUTRAL,       "spawn_point_neutral")
-EFFECT(0, SPAWN_NEUTRAL,            "spawn_event_neutral")
-
-EFFECT(0, NADE_EXPLODE_RED,         "nade_red_explode")
-EFFECT(0, NADE_EXPLODE_BLUE,        "nade_blue_explode")
-EFFECT(0, NADE_EXPLODE_YELLOW,      "nade_yellow_explode")
-EFFECT(0, NADE_EXPLODE_PINK,        "nade_pink_explode")
-EFFECT(0, NADE_EXPLODE_NEUTRAL,     "nade_neutral_explode")
-entity EFFECT_NADE_EXPLODE(int teamid)
-{
-    switch (teamid) {
-        case NUM_TEAM_1:    return EFFECT_NADE_EXPLODE_RED;
-        case NUM_TEAM_2:    return EFFECT_NADE_EXPLODE_BLUE;
-        case NUM_TEAM_3:    return EFFECT_NADE_EXPLODE_YELLOW;
-        case NUM_TEAM_4:    return EFFECT_NADE_EXPLODE_PINK;
-        default:                   return EFFECT_NADE_EXPLODE_NEUTRAL;
-    }
-}
-
-EFFECT(1, NADE_TRAIL_RED,           "nade_red")
-EFFECT(1, NADE_TRAIL_BLUE,          "nade_blue")
-EFFECT(1, NADE_TRAIL_YELLOW,        "nade_yellow")
-EFFECT(1, NADE_TRAIL_PINK,          "nade_pink")
-EFFECT(1, NADE_TRAIL_NEUTRAL,       "nade_neutral")
-entity EFFECT_NADE_TRAIL(int teamid)
-{
-    switch (teamid) {
-        case NUM_TEAM_1:    return EFFECT_NADE_TRAIL_RED;
-        case NUM_TEAM_2:    return EFFECT_NADE_TRAIL_BLUE;
-        case NUM_TEAM_3:    return EFFECT_NADE_TRAIL_YELLOW;
-        case NUM_TEAM_4:    return EFFECT_NADE_TRAIL_PINK;
-        default:            return EFFECT_NADE_TRAIL_NEUTRAL;
-    }
-}
-
-EFFECT(1, NADE_TRAIL_BURN_RED,      "nade_red_burn")
-EFFECT(1, NADE_TRAIL_BURN_BLUE,     "nade_blue_burn")
-EFFECT(1, NADE_TRAIL_BURN_YELLOW,   "nade_yellow_burn")
-EFFECT(1, NADE_TRAIL_BURN_PINK,     "nade_pink_burn")
-EFFECT(1, NADE_TRAIL_BURN_NEUTRAL,  "nade_neutral_burn")
-entity EFFECT_NADE_TRAIL_BURN(int teamid)
-{
-    switch (teamid) {
-        case NUM_TEAM_1:    return EFFECT_NADE_TRAIL_BURN_RED;
-        case NUM_TEAM_2:    return EFFECT_NADE_TRAIL_BURN_BLUE;
-        case NUM_TEAM_3:    return EFFECT_NADE_TRAIL_BURN_YELLOW;
-        case NUM_TEAM_4:    return EFFECT_NADE_TRAIL_BURN_PINK;
-        default:            return EFFECT_NADE_TRAIL_BURN_NEUTRAL;
-    }
-}
-
-EFFECT(0, ICEORGLASS,               "iceorglass")
-EFFECT(0, ICEFIELD,                 "icefield")
-EFFECT(0, FIREFIELD,                "firefield")
-EFFECT(0, HEALING,                  "healing_fx")
-EFFECT(1, LASER_BEAM_FAST,          "nex242_misc_laser_beam_fast")
-EFFECT(0, RESPAWN_GHOST,            "respawn_ghost")
-
-EFFECT(0, FLAG_TOUCH_RED,           "redflag_touch")
-EFFECT(0, FLAG_TOUCH_BLUE,          "blueflag_touch")
-EFFECT(0, FLAG_TOUCH_YELLOW,        "yellowflag_touch")
-EFFECT(0, FLAG_TOUCH_PINK,          "pinkflag_touch")
-EFFECT(0, FLAG_TOUCH_NEUTRAL,       "neutralflag_touch")
-entity EFFECT_FLAG_TOUCH(int teamid)
-{
-    switch (teamid) {
-        case NUM_TEAM_1:    return EFFECT_FLAG_TOUCH_RED;
-        case NUM_TEAM_2:    return EFFECT_FLAG_TOUCH_BLUE;
-        case NUM_TEAM_3:    return EFFECT_FLAG_TOUCH_YELLOW;
-        case NUM_TEAM_4:    return EFFECT_FLAG_TOUCH_PINK;
-        default:            return EFFECT_FLAG_TOUCH_NEUTRAL;
-    }
-}
-
-EFFECT(1, PASS_RED,                 "red_pass")
-EFFECT(1, PASS_BLUE,                "blue_pass")
-EFFECT(1, PASS_YELLOW,              "yellow_pass")
-EFFECT(1, PASS_PINK,                "pink_pass")
-EFFECT(1, PASS_NEUTRAL,             "neutral_pass")
-
-EFFECT(0, CAP_RED,                  "red_cap")
-EFFECT(0, CAP_BLUE,                 "blue_cap")
-EFFECT(0, CAP_YELLOW,               "yellow_cap")
-EFFECT(0, CAP_PINK,                 "pink_cap")
-EFFECT(0, CAP_NEUTRAL,              "neutral_cap")
-entity EFFECT_CAP(int teamid)
-{
-    switch (teamid) {
-        case NUM_TEAM_1:    return EFFECT_CAP_RED;
-        case NUM_TEAM_2:    return EFFECT_CAP_BLUE;
-        case NUM_TEAM_3:    return EFFECT_CAP_YELLOW;
-        case NUM_TEAM_4:    return EFFECT_CAP_PINK;
-        default:            return EFFECT_CAP_NEUTRAL;
-    }
-}
-
-EFFECT(0, ITEM_PICKUP,              "item_pickup")
-EFFECT(0, ITEM_RESPAWN,             "item_respawn")
-
-EFFECT(0, ONS_GENERATOR_DAMAGED,    "torch_small")
-EFFECT(0, ONS_GENERATOR_GIB,        "onslaught_generator_gib_explode")
-EFFECT(0, ONS_GENERATOR_EXPLODE,    "onslaught_generator_smallexplosion")
-EFFECT(0, ONS_GENERATOR_EXPLODE2,   "onslaught_generator_finalexplosion")
-
-
-
-EFFECT(0, LASER_DEADLY,             "laser_deadly")
-EFFECT(1, FLAC_TRAIL,               "TR_SEEKER")
-EFFECT(1, SEEKER_TRAIL,             "TR_SEEKER")
-EFFECT(1, FIREMINE,                 "firemine")
-EFFECT(0, BALL_SPARKS,              "kaball_sparks")
-EFFECT(0, ELECTRIC_SPARKS,          "electricity_sparks")
-EFFECT(0, SPARKS,                   "sparks")
-EFFECT(0, RAGE,                     "rage")
-EFFECT(0, SMOKING,                  "smoking")
-EFFECT(0, SMOKE_RING,               "smoke_ring")
-EFFECT(0, JUMPPAD,                  "jumppad_activate")
-EFFECT(1, BULLET,                   "tr_bullet")
-EFFECT(0, EF_FLAME,                 "EF_FLAME")
-EFFECT(0, EF_STARDUST,              "EF_STARDUST")
-EFFECT(0, TE_EXPLOSION,             "TE_EXPLOSION")
-EFFECT(1, TR_NEXUIZPLASMA,          "TR_NEXUIZPLASMA")
-EFFECT(1, TR_CRYLINKPLASMA,         "TR_CRYLINKPLASMA")
-EFFECT(1, TR_ROCKET,                "TR_ROCKET")
-EFFECT(1, TR_GRENADE,               "TR_GRENADE")
-EFFECT(1, TR_BLOOD,                 "TR_BLOOD")
-EFFECT(1, TR_WIZSPIKE,              "TR_WIZSPIKE")
-EFFECT(1, TR_SLIGHTBLOOD,           "TR_SLIGHTBLOOD")
-EFFECT(1, TR_KNIGHTSPIKE,           "TR_KNIGHTSPIKE")
-EFFECT(1, TR_VORESPIKE,             "TR_VORESPIKE")
-EFFECT(0, TE_SPARK,                 "TE_SPARK")
-
-EFFECT(1, ROCKETMINSTA_LASER_RED,       "rocketminsta_laser_red")
-EFFECT(1, ROCKETMINSTA_LASER_BLUE,      "rocketminsta_laser_blue")
-EFFECT(1, ROCKETMINSTA_LASER_YELLOW,    "rocketminsta_laser_yellow")
-EFFECT(1, ROCKETMINSTA_LASER_PINK,      "rocketminsta_laser_pink")
-EFFECT(1, ROCKETMINSTA_LASER_NEUTRAL,   "rocketminsta_laser_neutral")
-entity EFFECT_ROCKETMINSTA_LASER(int teamid)
-{
-    entity e;
-    switch (teamid) {
-        case NUM_TEAM_1:    e = EFFECT_ROCKETMINSTA_LASER_RED; break;
-        case NUM_TEAM_2:    e = EFFECT_ROCKETMINSTA_LASER_BLUE; break;
-        case NUM_TEAM_3:    e = EFFECT_ROCKETMINSTA_LASER_YELLOW; break;
-        case NUM_TEAM_4:    e = EFFECT_ROCKETMINSTA_LASER_PINK; break;
-        default:            e = EFFECT_ROCKETMINSTA_LASER_NEUTRAL; break;
-    }
-    if (particleeffectnum(e) < 0 || Team_TeamToNumber(teamid) == -1) { e = EFFECT_TR_NEXUIZPLASMA; }
-    return e;
-}
diff --git a/qcsrc/common/effects/effects.qc b/qcsrc/common/effects/effects.qc
deleted file mode 100644 (file)
index 78bb675..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-#ifdef CSQC
-void Read_Effect(bool is_new)
-{
-       int net_name = (Effects_COUNT >= 255) ? ReadShort() : ReadByte();
-
-       entity eff = Effects[net_name];
-
-       vector v, vel = '0 0 0';
-       int eff_cnt = 1;
-       bool eff_trail = eff.eent_eff_trail;
-       v_x = ReadCoord();
-       v_y = ReadCoord();
-       v_z = ReadCoord();
-
-       bool use_vel = ReadByte();
-       if(use_vel)
-       {
-               vel_x = ReadCoord();
-               vel_y = ReadCoord();
-               vel_z = ReadCoord();
-       }
-
-       if(!eff_trail)
-               eff_cnt = ReadByte();
-
-       if(is_new)
-       {
-               if(eff_trail)
-                       WarpZone_TrailParticles(world, particleeffectnum(eff), v, vel);
-               else
-                       pointparticles(particleeffectnum(eff), v, vel, eff_cnt);
-       }
-}
-#endif
-
-#ifdef SVQC
-bool Net_Write_Effect(entity this, entity client, int sf)
-{
-       WriteByte(MSG_ENTITY, ENT_CLIENT_EFFECT);
-       (Effects_COUNT >= 255)
-       ? WriteShort(MSG_ENTITY, self.m_id)
-       : WriteByte(MSG_ENTITY, self.m_id);
-       WriteCoord(MSG_ENTITY, self.eent_net_location_x);
-       WriteCoord(MSG_ENTITY, self.eent_net_location_y);
-       WriteCoord(MSG_ENTITY, self.eent_net_location_z);
-
-       // attempt to save a tiny bit more bandwidth by not sending velocity if it isn't set
-       if(self.eent_net_velocity)
-       {
-               WriteByte(MSG_ENTITY, true);
-               WriteCoord(MSG_ENTITY, self.eent_net_velocity_x);
-               WriteCoord(MSG_ENTITY, self.eent_net_velocity_y);
-               WriteCoord(MSG_ENTITY, self.eent_net_velocity_z);
-       }
-       else { WriteByte(MSG_ENTITY, false); }
-
-       if(!self.eent_eff_trail) { WriteByte(MSG_ENTITY, self.eent_net_count); }
-       return true;
-}
-
-void Send_Effect(entity eff, vector eff_loc, vector eff_vel, int eff_cnt)
-{
-       if(!eff) { return; }
-       if(!eff.eent_eff_trail && !eff_cnt) { return; } // effect has no count!
-       entity net_eff = spawn();
-       net_eff.owner = eff;
-       net_eff.classname = "net_effect";
-       //net_eff.eent_broadcast = broadcast;
-       net_eff.m_id = eff.m_id;
-       net_eff.eent_net_velocity = eff_vel;
-       net_eff.eent_net_location = eff_loc;
-       net_eff.eent_net_count = eff_cnt;
-       net_eff.eent_eff_trail = eff.eent_eff_trail;
-
-       net_eff.think = SUB_Remove;
-       net_eff.nextthink = time + 0.2; // don't need to keep this long
-
-       Net_LinkEntity(net_eff, false, 0, Net_Write_Effect);
-}
-
-void Send_Effect_(string eff_name, vector eff_loc, vector eff_vel, int eff_cnt)
-{
-       // problem with this is, we might not have all the available effects for it
-       FOREACH(Effects, it.eent_eff_name == eff_name, LAMBDA(
-               Send_Effect(it, eff_loc, eff_vel, eff_cnt);
-               return;
-       ));
-       // revert to engine handling
-       pointparticles(_particleeffectnum(eff_name), eff_loc, eff_vel, eff_cnt);
-}
-#endif
diff --git a/qcsrc/common/effects/effects.qh b/qcsrc/common/effects/effects.qh
deleted file mode 100644 (file)
index 2182175..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-#ifndef P_EFFECTS_H
-#define P_EFFECTS_H
-
-#ifdef CSQC
-void Read_Effect(bool is_new);
-#elif defined(SVQC)
-void Send_Effect(entity eff, vector eff_loc, vector eff_vel, int eff_cnt);
-void Send_Effect_(string eff_name, vector eff_loc, vector eff_vel, int eff_cnt);
-#endif
-
-#define particleeffectnum(e) _particleeffectnum(e.eent_eff_name)
-
-REGISTRY(Effects, BIT(8))
-REGISTER_REGISTRY(RegisterEffects)
-#define EFFECT(istrail, name, realname) \
-    REGISTER(RegisterEffects, EFFECT, Effects, name, m_id, Create_Effect_Entity(realname, istrail));
-
-.int m_id;
-.string eent_eff_name;
-.int eent_eff_trail;
-
-.vector eent_net_location;
-.vector eent_net_velocity;
-.int eent_net_count;
-
-entity Create_Effect_Entity(string eff_name, bool eff_trail)
-{
-       entity this = new(effect_entity);
-       this.eent_eff_name = eff_name;
-       this.eent_eff_trail = eff_trail;
-       return this;
-}
-
-void RegisterEffects_First()
-{
-    #ifdef SVQC
-    #define dedi (server_is_dedicated ? "a dedicated " : "")
-    #else
-    #define dedi ""
-    #endif
-
-    LOG_TRACEF("Beginning effect initialization on %s%s program...\n", dedi, PROGNAME);
-    #undef dedi
-}
-
-void RegisterEffects_Done()
-{
-    LOG_TRACE("Effects initialization successful!\n");
-}
-
-// NOW we actually activate the declarations
-ACCUMULATE_FUNCTION(RegisterEffects, RegisterEffects_First)
-EFFECT(0, Null, string_null)
-#include "effects.inc"
-ACCUMULATE_FUNCTION(RegisterEffects, RegisterEffects_Done)
-
-#endif
index 2a0b0362051f95426b7c2afd9d2dcc006278b9b1..f1ee4f675caf8341e9521cf0ebf8380a442e4081 100644 (file)
@@ -1,5 +1,5 @@
+#include "cl_minigames_hud.qh"
 #include "minigames.qh"
-#include "../../client/mapvoting.qh"
 
 // whether the mouse is over the given panel
 bool HUD_mouse_over(entity somepanel)
diff --git a/qcsrc/common/minigames/cl_minigames_hud.qh b/qcsrc/common/minigames/cl_minigames_hud.qh
new file mode 100644 (file)
index 0000000..f170c59
--- /dev/null
@@ -0,0 +1,7 @@
+#ifndef CL_MINIGAMES_HUD_H
+#define CL_MINIGAMES_HUD_H
+
+float HUD_Minigame_InputEvent(float bInputType, float nPrimary, float nSecondary);
+void HUD_Minigame_Mouse();
+
+#endif
index efce0e66b6be5030a96beb0446cdd2c3378a4b66..3ef2124dcac1b72aa7a27a84e6a21bcea136c115 100644 (file)
@@ -17,6 +17,8 @@ const int PP_NUM_CNT = 7;
 
 const int PP_TILE_SIZE = 7;
 
+.int cnt;
+
 .int pp_team1_score;
 .int pp_team2_score;
 
index 38c533449847ec6105d3d6fc9277f12e7564c062..a7ab9088079f8914e35f12d8bddb7be67a9b6d0b 100644 (file)
@@ -1,30 +1,11 @@
 #ifndef MODELS_ALL_H
 #define MODELS_ALL_H
 
-#define setmodel(e, m) _setmodel((e), (m).model_str())
+#include "model.qh"
 
 REGISTRY(Models, BIT(9))
 REGISTER_REGISTRY(RegisterModels)
 
-CLASS(Model, Object)
-    ATTRIB(Model, m_id, int, 0)
-    ATTRIB(Model, model_str, string(), func_null)
-    CONSTRUCTOR(Model, string() path)
-    {
-        CONSTRUCT(Model);
-        this.model_str = path;
-    }
-    METHOD(Model, model_precache, void(entity this)) {
-        string s = this.model_str();
-        if (s != "" && s != "null" && !fexists(s)) {
-            LOG_WARNINGF("Missing model: \"%s\"\n", s);
-            return;
-        }
-        LOG_TRACEF("precache_model(\"%s\")\n", s);
-        precache_model(s);
-    }
-ENDCLASS(Model)
-
 #define MODEL(name, path) \
     string MDL_##name##_get() { return path; } \
     REGISTER(RegisterModels, MDL, Models, name, m_id, NEW(Model, MDL_##name##_get))
diff --git a/qcsrc/common/models/model.qh b/qcsrc/common/models/model.qh
new file mode 100644 (file)
index 0000000..b4005b7
--- /dev/null
@@ -0,0 +1,25 @@
+#ifndef MODEL_H
+#define MODEL_H
+
+#define setmodel(e, m) _setmodel((e), (m).model_str())
+
+CLASS(Model, Object)
+    ATTRIB(Model, m_id, int, 0)
+    ATTRIB(Model, model_str, string(), func_null)
+    CONSTRUCTOR(Model, string() path)
+    {
+        CONSTRUCT(Model);
+        this.model_str = path;
+    }
+    METHOD(Model, model_precache, void(entity this)) {
+        string s = this.model_str();
+        if (s != "" && s != "null" && !fexists(s)) {
+            LOG_WARNINGF("Missing model: \"%s\"\n", s);
+            return;
+        }
+        LOG_TRACEF("precache_model(\"%s\")\n", s);
+        precache_model(s);
+    }
+ENDCLASS(Model)
+
+#endif
index 043ec38b92acdd04e0b95819e7d5acfc8aa47421..6c6aa0f8248ea959c06bd97e970e69e574dfee4a 100644 (file)
@@ -939,4 +939,6 @@ ACCUMULATE_FUNCTION(RegisterNotifications, RegisterNotifications_First)
 #include "notifications.inc"
 ACCUMULATE_FUNCTION(RegisterNotifications, RegisterNotifications_Done)
 
+STATIC_INIT(RegisterNotifications) { CALL_ACCUMULATED_FUNCTION(RegisterNotifications); }
+
 #endif
index 0e5bd7ffb3ca717bee4ea9ac26881bd1b3f71535..8a7dbbca37fafc2c155ba5b0fb2d40a3bc7b7456 100644 (file)
@@ -1,6 +1,7 @@
 // Global list of sounds
 // TODO: remove uses of _sound
 
+#include "../teams.qh"
 string W_Sound(string w_snd);
 
 SOUND(ARC_FIRE, W_Sound("arc_fire"));
index 90858f39d7841cf5f2c2f73d0c59fc37a637546f..d39c701d7f0a2887295f557a01747bbb4c8bf18a 100644 (file)
@@ -1,49 +1,18 @@
 #ifndef SOUNDS_ALL_H
 #define SOUNDS_ALL_H
 
-#include "../teams.qh"
+#include "sound.qh"
 
-// Play all sounds via sound7, for access to the extra channels.
-// Otherwise, channels 8 to 15 would be blocked for a weird QW feature.
-#ifdef SVQC
-    #define _sound(e, c, s, v, a) do { \
-        entity __e = e; \
-        if (!sound_allowed(MSG_BROADCAST, __e)) break; \
-        sound7(__e, c, s, v, a, 0, 0); \
-    } while (0)
-#else
-    #define _sound(e, c, s, v, a) sound7(e, c, s, v, a, 0, 0)
-#endif
-#define sound(e, c, s, v, a) _sound(e, c, s.sound_str(), v, a)
-// Used in places where a string is required
-#define SND(id) (SND_##id.sound_str())
-
-REGISTRY(Sounds, BIT(8))
+REGISTRY(Sounds, BITS(8))
 REGISTER_REGISTRY(RegisterSounds)
 
-CLASS(Sound, Object)
-    ATTRIB(Sound, m_id, int, 0)
-    ATTRIB(Sound, sound_str, string(), func_null)
-    CONSTRUCTOR(Sound, string() path)
-    {
-        CONSTRUCT(Sound);
-        this.sound_str = path;
-    }
-    METHOD(Sound, sound_precache, void(entity this)) {
-        string s = this.sound_str();
-        if (s && s != "" && !fexists(strcat("sound/", s))) {
-            LOG_WARNINGF("Missing sound: \"%s\"\n", s);
-            return;
-        }
-        LOG_TRACEF("precache_sound(\"%s\")\n", s);
-        precache_sound(s);
-    }
-ENDCLASS(Sound)
-
 #define SOUND(name, path) \
     string SND_##name##_get() { return path; } \
     REGISTER(RegisterSounds, SND, Sounds, name, m_id, NEW(Sound, SND_##name##_get))
 
+// Used in places where a string is required
+#define SND(id) (SND_##id.sound_str())
+
 STATIC_INIT(RegisterSounds_precache) {
     FOREACH(Sounds, true, LAMBDA({
         it.sound_precache(it);
diff --git a/qcsrc/common/sounds/sound.qh b/qcsrc/common/sounds/sound.qh
new file mode 100644 (file)
index 0000000..bc393dd
--- /dev/null
@@ -0,0 +1,36 @@
+#ifndef SOUND_H
+#define SOUND_H
+
+// Play all sounds via sound7, for access to the extra channels.
+// Otherwise, channels 8 to 15 would be blocked for a weird QW feature.
+#ifdef SVQC
+    #define _sound(e, c, s, v, a) do { \
+        entity __e = e; \
+        if (!sound_allowed(MSG_BROADCAST, __e)) break; \
+        sound7(__e, c, s, v, a, 0, 0); \
+    } while (0)
+#else
+    #define _sound(e, c, s, v, a) sound7(e, c, s, v, a, 0, 0)
+#endif
+#define sound(e, c, s, v, a) _sound(e, c, s.sound_str(), v, a)
+
+CLASS(Sound, Object)
+    ATTRIB(Sound, m_id, int, 0)
+    ATTRIB(Sound, sound_str, string(), func_null)
+    CONSTRUCTOR(Sound, string() path)
+    {
+        CONSTRUCT(Sound);
+        this.sound_str = path;
+    }
+    METHOD(Sound, sound_precache, void(entity this)) {
+        string s = this.sound_str();
+        if (s && s != "" && !fexists(strcat("sound/", s))) {
+            LOG_WARNINGF("Missing sound: \"%s\"\n", s);
+            return;
+        }
+        LOG_TRACEF("precache_sound(\"%s\")\n", s);
+        precache_sound(s);
+    }
+ENDCLASS(Sound)
+
+#endif
index 98491820f215da9636d2ce8cd72e7bbffc2e7aaa..95cc59904a5017710f4ff9104ddd1de7cd833f41 100644 (file)
@@ -26,6 +26,8 @@
        #define SUB_LTIME               move_ltime
        #define SUB_FLAGS               move_flags
 
+.vector move_origin;
+
        void SUB_SETORIGIN(entity s, vector v)
        {SELFPARAM();
                s.move_origin = v;
index 9c794c0eb3d229c12627efc98d811254d506098e..b687086ba941ed6f51b38910906074d71e3652d4 100644 (file)
@@ -174,40 +174,6 @@ string ftos_decimals(float number, float decimals)
        return sprintf("%.*f", decimals, number);
 }
 
-vector colormapPaletteColor(float c, bool isPants)
-{
-       switch (c)
-       {
-               case  0: return '1.000000 1.000000 1.000000';
-               case  1: return '1.000000 0.333333 0.000000';
-               case  2: return '0.000000 1.000000 0.501961';
-               case  3: return '0.000000 1.000000 0.000000';
-               case  4: return '1.000000 0.000000 0.000000';
-               case  5: return '0.000000 0.666667 1.000000';
-               case  6: return '0.000000 1.000000 1.000000';
-               case  7: return '0.501961 1.000000 0.000000';
-               case  8: return '0.501961 0.000000 1.000000';
-               case  9: return '1.000000 0.000000 1.000000';
-               case 10: return '1.000000 0.000000 0.501961';
-               case 11: return '0.000000 0.000000 1.000000';
-               case 12: return '1.000000 1.000000 0.000000';
-               case 13: return '0.000000 0.333333 1.000000';
-               case 14: return '1.000000 0.666667 0.000000';
-               case 15:
-                       if (isPants)
-                               return
-                                         '1 0 0' * (0.502 + 0.498 * sin(time / 2.7182818285 + 0.0000000000))
-                                       + '0 1 0' * (0.502 + 0.498 * sin(time / 2.7182818285 + 2.0943951024))
-                                       + '0 0 1' * (0.502 + 0.498 * sin(time / 2.7182818285 + 4.1887902048));
-                       else
-                               return
-                                         '1 0 0' * (0.502 + 0.498 * sin(time / 3.1415926536 + 5.2359877560))
-                                       + '0 1 0' * (0.502 + 0.498 * sin(time / 3.1415926536 + 3.1415926536))
-                                       + '0 0 1' * (0.502 + 0.498 * sin(time / 3.1415926536 + 1.0471975512));
-               default: return '0.000 0.000 0.000';
-       }
-}
-
 // Databases (hash tables)
 const float DB_BUCKETS = 8192;
 void db_save(float db, string pFilename)
index a2774aa509d1dd1909849f29cb959e95227fe2bd..8bedccf0ae44b38d9935e48686c154de7a362479 100644 (file)
@@ -28,8 +28,6 @@ string ftos_decimals(float number, float decimals);
 
 bool fexists(string f);
 
-vector colormapPaletteColor(float c, float isPants);
-
 // unzone the string, and return it as tempstring. Safe to be called on string_null
 string fstrunzone(string s);
 
index 7108e80770cf20e235a8ca81799e56bbfda79fcd..500bc60c8cebf0cea22b394456074e163392131c 100644 (file)
@@ -1,5 +1,4 @@
 #include "sv_vehicles.qh"
-#include "../effects/effects.qh"
 
 #if 0
 bool vehicle_send(entity to, int sf)
index 2b5950a259e8e780c6ae3a12fec2c654105a464e..7bc45c0d5162e45285af95c6a068d572c5342e10 100644 (file)
@@ -27,7 +27,6 @@ REGISTER_VEHICLE(RACER, NEW(Racer));
 #include "racer_weapon.qc"
 
 #ifdef SVQC
-#include "../../effects/effects.qh"
 #include "../../triggers/trigger/impulse.qh"
 
 bool autocvar_g_vehicle_racer;
index 5addff39ff08d6a767393717d7c57ead02fa6134..66a79c83c4ba2d5b655c0dfe274cc3b223a10841 100644 (file)
@@ -30,6 +30,7 @@
 #include "accumulate.qh"
 #include "bits.qh"
 #include "bool.qh"
+#include "color.qh"
 #include "counting.qh"
 #include "cvar.qh"
 #include "defer.qh"
diff --git a/qcsrc/lib/color.qh b/qcsrc/lib/color.qh
new file mode 100644 (file)
index 0000000..d21dab8
--- /dev/null
@@ -0,0 +1,38 @@
+#ifndef COLOR_H
+#define COLOR_H
+
+#define colormapPaletteColor(c, isPants) colormapPaletteColor_(c, isPants, time)
+vector colormapPaletteColor_(int c, bool isPants, float t)
+{
+    switch (c) {
+        case  0: return '1.000000 1.000000 1.000000';
+        case  1: return '1.000000 0.333333 0.000000';
+        case  2: return '0.000000 1.000000 0.501961';
+        case  3: return '0.000000 1.000000 0.000000';
+        case  4: return '1.000000 0.000000 0.000000';
+        case  5: return '0.000000 0.666667 1.000000';
+        case  6: return '0.000000 1.000000 1.000000';
+        case  7: return '0.501961 1.000000 0.000000';
+        case  8: return '0.501961 0.000000 1.000000';
+        case  9: return '1.000000 0.000000 1.000000';
+        case 10: return '1.000000 0.000000 0.501961';
+        case 11: return '0.000000 0.000000 1.000000';
+        case 12: return '1.000000 1.000000 0.000000';
+        case 13: return '0.000000 0.333333 1.000000';
+        case 14: return '1.000000 0.666667 0.000000';
+        case 15:
+            if (isPants)
+                return
+                      '1 0 0' * (0.502 + 0.498 * sin(t / 2.7182818285 + 0.0000000000))
+                    + '0 1 0' * (0.502 + 0.498 * sin(t / 2.7182818285 + 2.0943951024))
+                    + '0 0 1' * (0.502 + 0.498 * sin(t / 2.7182818285 + 4.1887902048));
+            else
+                return
+                      '1 0 0' * (0.502 + 0.498 * sin(t / 3.1415926536 + 5.2359877560))
+                    + '0 1 0' * (0.502 + 0.498 * sin(t / 3.1415926536 + 3.1415926536))
+                    + '0 0 1' * (0.502 + 0.498 * sin(t / 3.1415926536 + 1.0471975512));
+        default: return '0.000 0.000 0.000';
+    }
+}
+
+#endif
index dd3b1aaafb56efe377d21cd3d187328ccec1fdc4..eeb06e7a692f9f86ad283bb5a2e84731f308c152 100644 (file)
@@ -7,6 +7,7 @@
 #include "miscfunctions.qh"
 
 
+#include "../common/effects/all.qh"
 #include "../common/models/all.qh"
 #include "../common/sounds/all.qh"
 
index 9912174dd8d17a5a024fd8ac9e77f5340e839b49..aa87763ca360441eb5268efca18ed2eb922c3818 100644 (file)
@@ -11,7 +11,6 @@
 
 #include "../common/constants.qh"
 #include "../common/deathtypes.qh"
-#include "../common/effects/effects.qh"
 #include "../common/util.qh"
 
 #include "../common/monsters/all.qh"
index a0f9a3f131ab2e2552340692736ad82fd398d324..75c61d2eef8c9cf6023cc195662c5a3bd137ef0e 100644 (file)
@@ -22,7 +22,6 @@
 #include "../common/buffs/all.qh"
 #include "../common/constants.qh"
 #include "../common/deathtypes.qh"
-#include "../common/effects/effects.qh"
 #include "../common/mapinfo.qh"
 #include "../common/monsters/all.qh"
 #include "../common/monsters/sv_monsters.qh"
@@ -557,7 +556,6 @@ spawnfunc(__init_dedicated_server)
 
        // needs to be done so early because of the constants they create
        static_init();
-       CALL_ACCUMULATED_FUNCTION(RegisterNotifications);
        CALL_ACCUMULATED_FUNCTION(RegisterDeathtypes);
 
        MapInfo_Enumerate();
@@ -603,7 +601,6 @@ spawnfunc(worldspawn)
 
        // needs to be done so early because of the constants they create
        static_init();
-       CALL_ACCUMULATED_FUNCTION(RegisterNotifications);
        CALL_ACCUMULATED_FUNCTION(RegisterDeathtypes);
 
        ServerProgsDB = db_load(strcat("server.db", autocvar_sessionid));
index d8eda4986ebfcd6b90a342169d313209c3168b38..ee891aa4d229351c9f24e0c48454ff2cc6403fc2 100644 (file)
@@ -1,4 +1,5 @@
 #include "../lib/_all.inc"
+#include "_all.qh"
 
 #include "anticheat.qc"
 #include "antilag.qc"
@@ -61,7 +62,6 @@
 #include "../common/animdecide.qc"
 #include "../common/campaign_file.qc"
 #include "../common/campaign_setup.qc"
-#include "../common/effects/effects.qc"
 #include "../common/effects/effectinfo.qc"
 #include "../common/mapinfo.qc"
 #include "../common/monsters/spawn.qc"
@@ -78,6 +78,7 @@
 #include "../common/util.qc"
 
 #include "../common/buffs/all.qc"
+#include "../common/effects/all.qc"
 #include "../common/items/all.qc"
 #include "../common/monsters/all.qc"
 #include "../common/mutators/all.qc"
index e31476f52257ab75a85ff2703c5adcb65e3fd9fb..66cf5c57668175008f6547c2341b475f715ca9a1 100755 (executable)
@@ -26,7 +26,7 @@ declare -a QCC_FLAGS=(
 
 function check() {
   declare -l base="${1}"
-  declare -la predefs=("-D${2}" "lib/_all.inc")
+  declare -la predefs=("-D${2}" "lib/_all.inc" "${base}/_all.qh")
   find "$base" -type f -name '*.qc' -print0 | sort -z | while read -r -d '' file; do
     echo "$file"
     ${QCC} "${QCC_FLAGS[@]}" "${NOWARN[@]}" "${FEATURES[@]}" "${predefs[@]}" "$file" >/dev/null