Client: Use the new Crosshair drawing functions to help with cl_thirdperson and remove
obsolete routines.
This commit is contained in:
parent
54f7918edc
commit
7c94b26fc8
15 changed files with 27 additions and 270 deletions
24
manifest.fmf
24
manifest.fmf
|
@ -1,13 +1,13 @@
|
|||
FTEMANIFEST 1
|
||||
GAME valve
|
||||
NAME "Half-Life"
|
||||
BASEGAME platform
|
||||
FTEMANIFEST 1
|
||||
GAME valve
|
||||
NAME "Half-Life"
|
||||
BASEGAME platform
|
||||
BASEGAME valve
|
||||
|
||||
// you don't really want to change these
|
||||
RTCBROKER master.frag-net.com:27950
|
||||
PROTOCOLNAME "FreeHL"
|
||||
MAINCONFIG game.cfg
|
||||
DOWNLOADSURL "http://www.frag-net.com/dl/packages"
|
||||
|
||||
-exec platform_default.cfg
|
||||
|
||||
// you don't really want to change these
|
||||
RTCBROKER master.frag-net.com:27950
|
||||
PROTOCOLNAME "Nuclide"
|
||||
MAINCONFIG game.cfg
|
||||
DOWNLOADSURL "http://www.frag-net.com/dl/packages"
|
||||
|
||||
-exec platform_default.cfg
|
||||
|
|
|
@ -1,76 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2016-2020 Marco Cawthorne <marco@icculus.org>
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER
|
||||
* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
|
||||
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/* called every input frame */
|
||||
void
|
||||
Game_RunClientCommand(void)
|
||||
{
|
||||
player pl = (player)self;
|
||||
pl.Physics_Run();
|
||||
}
|
||||
|
||||
/* custom chat packet */
|
||||
void
|
||||
SV_SendChat(entity sender, string msg, entity eEnt, float fType)
|
||||
{
|
||||
WriteByte(MSG_MULTICAST, SVC_CGAMEPACKET);
|
||||
WriteByte(MSG_MULTICAST, fType == 0 ? EV_CHAT:EV_CHAT_TEAM);
|
||||
WriteByte(MSG_MULTICAST, num_for_edict(sender) - 1);
|
||||
WriteByte(MSG_MULTICAST, sender.team);
|
||||
WriteString(MSG_MULTICAST, msg);
|
||||
|
||||
if (eEnt) {
|
||||
msg_entity = eEnt;
|
||||
multicast([0,0,0], MULTICAST_ONE);
|
||||
} else {
|
||||
multicast([0,0,0], MULTICAST_ALL);
|
||||
}
|
||||
|
||||
localcmd(sprintf("echo [SERVER] %s: %s\n", sender.netname, msg));
|
||||
}
|
||||
|
||||
/* client cmd overrides happen here */
|
||||
void
|
||||
Game_ParseClientCommand(string cmd)
|
||||
{
|
||||
tokenize(cmd);
|
||||
|
||||
if (argv(1) == "timeleft") {
|
||||
string msg;
|
||||
string timestring;
|
||||
float timeleft;
|
||||
timeleft = cvar("timelimit") - (time / 60);
|
||||
timestring = Util_TimeToString(timeleft);
|
||||
msg = sprintf("we have %s minutes remaining", timestring);
|
||||
bprint(PRINT_CHAT, msg);
|
||||
return;
|
||||
}
|
||||
|
||||
if (argv(0) == "say") {
|
||||
SV_SendChat(self, argv(1), world, 0);
|
||||
return;
|
||||
} else if (argv(0) == "say_team") {
|
||||
entity a;
|
||||
for (a = world; (a = find(a, ::classname, "player"));) {
|
||||
if (a.team == self.team) {
|
||||
SV_SendChat(self, argv(1), a, 1);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
clientcommand(self, cmd);
|
||||
}
|
2
src/server/progs.src
Executable file → Normal file
2
src/server/progs.src
Executable file → Normal file
|
@ -55,7 +55,6 @@ monster_turret.qc
|
|||
monster_zombie.qc
|
||||
|
||||
player.qc
|
||||
spectator.qc
|
||||
items.qc
|
||||
item_longjump.qc
|
||||
item_suit.qc
|
||||
|
@ -75,7 +74,6 @@ ammo.qc
|
|||
gamerules.qc
|
||||
gamerules_singleplayer.qc
|
||||
gamerules_multiplayer.qc
|
||||
client.qc
|
||||
server.qc
|
||||
../../../base/src/server/damage.qc
|
||||
flashlight.qc
|
||||
|
|
|
@ -1,28 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2016-2020 Marco Cawthorne <marco@icculus.org>
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER
|
||||
* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
|
||||
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
void Game_SpectatorThink(void)
|
||||
{
|
||||
|
||||
}
|
||||
void Game_SpectatorConnect(void)
|
||||
{
|
||||
|
||||
}
|
||||
void Game_SpectatorDisconnect(void)
|
||||
{
|
||||
|
||||
}
|
|
@ -45,7 +45,7 @@ FX_Blood(vector pos, vector color)
|
|||
#else
|
||||
static void Blood_Touch(void)
|
||||
{
|
||||
if (self.think != Util_Destroy) {
|
||||
if (self.think != NSEntity::Destroy) {
|
||||
if (serverkeyfloat("*bspversion") == BSPVER_HL)
|
||||
Decals_Place(self.origin, sprintf("{blood%d", floor(random(1,9))));
|
||||
else {
|
||||
|
@ -54,7 +54,7 @@ FX_Blood(vector pos, vector color)
|
|||
}
|
||||
}
|
||||
|
||||
self.think = Util_Destroy;
|
||||
self.think = NSEntity::Destroy;
|
||||
self.nextthink = time + 5.0f;
|
||||
}
|
||||
|
||||
|
|
|
@ -187,31 +187,6 @@ string Weapons_GetPlayermodel(player, int);
|
|||
void
|
||||
player::UpdatePlayerAttachments(bool visible)
|
||||
{
|
||||
/* draw the flashlight */
|
||||
if (gflags & GF_FLASHLIGHT) {
|
||||
vector src;
|
||||
vector ang;
|
||||
|
||||
if (entnum != player_localentnum) {
|
||||
src = origin + view_ofs;
|
||||
ang = v_angle;
|
||||
} else {
|
||||
src = pSeat->m_vecPredictedOrigin + [0,0,-8];
|
||||
ang = view_angles;
|
||||
}
|
||||
|
||||
makevectors(ang);
|
||||
traceline(src, src + (v_forward * 8096), MOVE_NORMAL, this);
|
||||
|
||||
if (serverkeyfloat("*bspversion") == BSPVER_HL) {
|
||||
dynamiclight_add(trace_endpos + (v_forward * -2), 128, [1,1,1]);
|
||||
} else {
|
||||
float p = dynamiclight_add(src, 512, [1,1,1], 0, "textures/flashlight");
|
||||
dynamiclight_set(p, LFIELD_ANGLES, ang);
|
||||
dynamiclight_set(p, LFIELD_FLAGS, 3);
|
||||
}
|
||||
}
|
||||
|
||||
/* FIXME: this needs to be incorporated and simplified, now that we can handle it all in-class */
|
||||
if (!visible)
|
||||
return;
|
||||
|
|
|
@ -349,29 +349,9 @@ w_crossbow_crosshair(player pl)
|
|||
vector aicon_pos;
|
||||
|
||||
if (pl.viewzoom == 1) {
|
||||
cross_pos = g_hudmins + (g_hudres / 2) + [-12,-12];
|
||||
drawsubpic(
|
||||
cross_pos,
|
||||
[24,24],
|
||||
g_cross_spr,
|
||||
[72/128,0],
|
||||
[0.1875, 0.1875],
|
||||
[1,1,1],
|
||||
1,
|
||||
DRAWFLAG_NORMAL
|
||||
);
|
||||
Cross_DrawSub(g_cross_spr, [24,24], [72/128,0], [0.1875, 0.1875]);
|
||||
} else {
|
||||
cross_pos = g_hudmins + (g_hudres / 2) + [-52,-8];
|
||||
drawsubpic(
|
||||
cross_pos,
|
||||
[104,16],
|
||||
g_cross_spr,
|
||||
[24/128,96/128],
|
||||
[104/128, 16/128],
|
||||
[1,1,1],
|
||||
1,
|
||||
DRAWFLAG_NORMAL
|
||||
);
|
||||
Cross_DrawSub(g_cross_spr, [104,16], [24/128,96/128], [104/128, 16/128]);
|
||||
}
|
||||
|
||||
HUD_DrawAmmo1();
|
||||
|
|
|
@ -269,9 +269,8 @@ w_egon_postdraw(player pl, int thirdperson)
|
|||
void w_egon_crosshair(player pl)
|
||||
{
|
||||
#ifdef CLIENT
|
||||
static vector cross_pos;
|
||||
cross_pos = g_hudmins + (g_hudres / 2) + [-12,-12];
|
||||
drawsubpic(cross_pos, [24,24], g_cross_spr, [72/128,48/128], [0.1875, 0.1875], [1,1,1], 1, DRAWFLAG_NORMAL);
|
||||
Cross_DrawSub(g_cross_spr, [24,24], [72/128,48/128], [0.1875, 0.1875]);
|
||||
|
||||
HUD_DrawAmmo2();
|
||||
vector aicon_pos = g_hudmins + [g_hudres[0] - 48, g_hudres[1] - 42];
|
||||
drawsubpic(aicon_pos, [24,24], g_hud7_spr, [0,96/128], [24/256, 24/128], g_hud_color, pSeatLocal->m_flAmmo2Alpha, DRAWFLAG_ADDITIVE);
|
||||
|
|
|
@ -327,23 +327,11 @@ void w_gauss_secondary(player pl)
|
|||
void w_gauss_crosshair(player pl)
|
||||
{
|
||||
#ifdef CLIENT
|
||||
vector cross_pos;
|
||||
vector aicon_pos;
|
||||
Cross_DrawSub(g_cross_spr, [24,24], [48/128,48/128], [0.1875, 0.1875]);
|
||||
|
||||
cross_pos = g_hudmins + (g_hudres / 2) + [-12,-12];
|
||||
aicon_pos = g_hudmins + [g_hudres[0] - 48, g_hudres[1] - 42];
|
||||
|
||||
drawsubpic(
|
||||
cross_pos,
|
||||
[24,24],
|
||||
g_cross_spr,
|
||||
[48/128,48/128],
|
||||
[0.1875, 0.1875],
|
||||
[1,1,1],
|
||||
1,
|
||||
DRAWFLAG_NORMAL
|
||||
);
|
||||
|
||||
drawsubpic(
|
||||
aicon_pos,
|
||||
[24,24],
|
||||
|
|
|
@ -327,22 +327,11 @@ void
|
|||
w_glock_hud(player pl)
|
||||
{
|
||||
#ifdef CLIENT
|
||||
vector cross_pos;
|
||||
vector aicon_pos;
|
||||
|
||||
cross_pos = g_hudmins + (g_hudres / 2) + [-12,-12];
|
||||
aicon_pos = g_hudmins + [g_hudres[0] - 48, g_hudres[1] - 42];
|
||||
|
||||
drawsubpic(
|
||||
cross_pos,
|
||||
[24,24],
|
||||
g_cross_spr,
|
||||
[0.1875,0],
|
||||
[0.1875, 0.1875],
|
||||
[1,1,1],
|
||||
1.0f,
|
||||
DRAWFLAG_NORMAL
|
||||
);
|
||||
Cross_DrawSub(g_cross_spr, [24,24], [0.1875,0], [0.1875, 0.1875]);
|
||||
|
||||
HUD_DrawAmmo1();
|
||||
HUD_DrawAmmo2();
|
||||
|
|
|
@ -225,23 +225,11 @@ void
|
|||
w_hornetgun_crosshair(player pl)
|
||||
{
|
||||
#ifdef CLIENT
|
||||
vector cross_pos;
|
||||
vector aicon_pos;
|
||||
|
||||
cross_pos = g_hudmins + (g_hudres / 2) + [-12,-12];
|
||||
Cross_DrawSub(g_cross_spr, [24,24], [72/128,24/128], [0.1875, 0.1875]);
|
||||
aicon_pos = g_hudmins + [g_hudres[0] - 48, g_hudres[1] - 42];
|
||||
|
||||
drawsubpic(
|
||||
cross_pos,
|
||||
[24,24],
|
||||
g_cross_spr,
|
||||
[72/128,24/128],
|
||||
[0.1875, 0.1875],
|
||||
[1,1,1],
|
||||
1.0f,
|
||||
DRAWFLAG_NORMAL
|
||||
);
|
||||
|
||||
HUD_DrawAmmo2();
|
||||
|
||||
drawsubpic(
|
||||
|
|
|
@ -340,21 +340,9 @@ void
|
|||
w_mp5_crosshair(player pl)
|
||||
{
|
||||
#ifdef CLIENT
|
||||
vector cross_pos;
|
||||
vector aicon_pos;
|
||||
|
||||
cross_pos = g_hudmins + (g_hudres / 2) + [-12,-12];
|
||||
|
||||
drawsubpic(
|
||||
cross_pos,
|
||||
[24,24],
|
||||
g_cross_spr,
|
||||
[0,48/128],
|
||||
[0.1875, 0.1875],
|
||||
[1,1,1],
|
||||
1.0f,
|
||||
DRAWFLAG_NORMAL
|
||||
);
|
||||
Cross_DrawSub(g_cross_spr, [24,24], [0,48/128], [0.1875, 0.1875]);
|
||||
|
||||
HUD_DrawAmmo1();
|
||||
HUD_DrawAmmo2();
|
||||
|
|
|
@ -265,33 +265,12 @@ void
|
|||
w_python_crosshair(player pl)
|
||||
{
|
||||
#ifdef CLIENT
|
||||
vector cross_pos;
|
||||
vector aicon_pos;
|
||||
|
||||
cross_pos = g_hudmins + (g_hudres / 2) + [-12,-12];
|
||||
|
||||
if (pl.viewzoom == 1) {
|
||||
drawsubpic(
|
||||
cross_pos,
|
||||
[24,24],
|
||||
g_cross_spr,
|
||||
[48/128,0],
|
||||
[0.1875, 0.1875],
|
||||
[1,1,1],
|
||||
1,
|
||||
DRAWFLAG_NORMAL
|
||||
);
|
||||
Cross_DrawSub(g_cross_spr, [24,24], [48/128,0], [0.1875, 0.1875]);
|
||||
} else {
|
||||
drawsubpic(
|
||||
cross_pos,
|
||||
[24,24],
|
||||
g_cross_spr,
|
||||
[96/128,0],
|
||||
[0.1875, 0.1875],
|
||||
[1,1,1],
|
||||
1,
|
||||
DRAWFLAG_NORMAL
|
||||
);
|
||||
Cross_DrawSub(g_cross_spr, [24,24], [96/128,0], [0.1875, 0.1875]);
|
||||
}
|
||||
|
||||
HUD_DrawAmmo1();
|
||||
|
|
|
@ -279,7 +279,6 @@ void w_rpg_hudpic(player pl, int selected, vector pos, float a)
|
|||
void w_rpg_hud(player pl)
|
||||
{
|
||||
#ifdef CLIENT
|
||||
vector cross_pos;
|
||||
vector laser_pos;
|
||||
vector aicon_pos;
|
||||
|
||||
|
@ -294,7 +293,6 @@ void w_rpg_hud(player pl)
|
|||
jitter[0] = (random(0,2) - 2) * (1 - trace_fraction);
|
||||
jitter[1] = (random(0,2) - 2) * (1 - trace_fraction);
|
||||
laser_pos = g_hudmins + (g_hudres / 2) + ([-lerp,-lerp] / 2);
|
||||
cross_pos = g_hudmins + (g_hudres / 2) + [-12,-12];
|
||||
|
||||
drawsubpic(
|
||||
laser_pos + jitter,
|
||||
|
@ -307,28 +305,9 @@ void w_rpg_hud(player pl)
|
|||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
|
||||
drawsubpic(
|
||||
cross_pos,
|
||||
[24,24],
|
||||
g_cross_spr,
|
||||
[24/128,48/128],
|
||||
[0.1875, 0.1875],
|
||||
[1,1,1],
|
||||
1.0f,
|
||||
DRAWFLAG_NORMAL
|
||||
);
|
||||
Cross_DrawSub(g_cross_spr, [24,24], [24/128,48/128], [0.1875, 0.1875]);
|
||||
} else {
|
||||
cross_pos = g_hudmins + (g_hudres / 2) + [-12,-12];
|
||||
drawsubpic(
|
||||
cross_pos,
|
||||
[24,24],
|
||||
g_cross_spr,
|
||||
[24/128,48/128],
|
||||
[0.1875, 0.1875],
|
||||
[1,1,1],
|
||||
1.0f,
|
||||
DRAWFLAG_NORMAL
|
||||
);
|
||||
Cross_DrawSub(g_cross_spr, [24,24], [24/128,48/128], [0.1875, 0.1875]);
|
||||
}
|
||||
|
||||
/* ammo counters */
|
||||
|
|
|
@ -373,9 +373,7 @@ void
|
|||
w_shotgun_crosshair(player pl)
|
||||
{
|
||||
#ifdef CLIENT
|
||||
static vector cross_pos;
|
||||
cross_pos = g_hudmins + (g_hudres / 2) + [-12,-12];
|
||||
drawsubpic(cross_pos, [24,24], g_cross_spr, [48/128,24/128], [0.1875, 0.1875], [1,1,1], 1, DRAWFLAG_NORMAL);
|
||||
Cross_DrawSub(g_cross_spr, [24,24], [48/128,24/128], [0.1875, 0.1875]);
|
||||
HUD_DrawAmmo1();
|
||||
HUD_DrawAmmo2();
|
||||
vector aicon_pos = g_hudmins + [g_hudres[0] - 48, g_hudres[1] - 42];
|
||||
|
|
Loading…
Reference in a new issue