Whitespace.

This commit is contained in:
Ragnvald Maartmann-Moe IV 2001-05-14 03:08:24 +00:00
parent 56f76e8192
commit 91200a862d
18 changed files with 473 additions and 457 deletions

View file

@ -1,7 +1,7 @@
/* /*
cl_cam.c cl_cam.c
@description@ camera support
Copyright (C) 1996-1997 Id Software, Inc. Copyright (C) 1996-1997 Id Software, Inc.
@ -58,13 +58,15 @@ Chase_Init (void)
chase_active = Cvar_Get ("chase_active", "0", CVAR_NONE, NULL, "None"); chase_active = Cvar_Get ("chase_active", "0", CVAR_NONE, NULL, "None");
} }
void void
Chase_Reset (void) Chase_Reset (void)
{ {
// for respawning and teleporting // for respawning and teleporting
// start position 12 units behind head // start position 12 units behind head
} }
void void
TraceLine (vec3_t start, vec3_t end, vec3_t impact) TraceLine (vec3_t start, vec3_t end, vec3_t impact)
{ {
@ -76,6 +78,7 @@ TraceLine (vec3_t start, vec3_t end, vec3_t impact)
VectorCopy (trace.endpos, impact); VectorCopy (trace.endpos, impact);
} }
void void
Chase_Update (void) Chase_Update (void)
{ {

View file

@ -50,8 +50,6 @@
void CL_FinishTimeDemo (void); void CL_FinishTimeDemo (void);
/* /*
==============================================================================
DEMO CODE DEMO CODE
When a demo is playing back, all NET_SendMessages are skipped, and When a demo is playing back, all NET_SendMessages are skipped, and
@ -59,15 +57,13 @@ NET_GetMessages are read from the demo file.
Whenever cl.time gets past the last received message, another message is Whenever cl.time gets past the last received message, another message is
read from the demo file. read from the demo file.
==============================================================================
*/ */
/*
==============
CL_StopPlayback
Called when a demo file runs out, or the user starts a game /*
============== CL_StopPlayback
Called when a demo file runs out, or the user starts a game
*/ */
void void
CL_StopPlayback (void) CL_StopPlayback (void)
@ -84,12 +80,11 @@ CL_StopPlayback (void)
CL_FinishTimeDemo (); CL_FinishTimeDemo ();
} }
/*
====================
CL_WriteDemoMessage
Dumps the current net message, prefixed by the length and view angles /*
==================== CL_WriteDemoMessage
Dumps the current net message, prefixed by the length and view angles
*/ */
void void
CL_WriteDemoMessage (void) CL_WriteDemoMessage (void)
@ -109,12 +104,11 @@ CL_WriteDemoMessage (void)
Qflush (cls.demofile); Qflush (cls.demofile);
} }
/*
====================
CL_GetMessage
Handles recording and playback of demos, on top of NET_ code /*
==================== CL_GetMessage
Handles recording and playback of demos, on top of NET_ code
*/ */
int int
CL_GetMessage (void) CL_GetMessage (void)
@ -183,11 +177,9 @@ CL_GetMessage (void)
/* /*
==================== CL_Stop_f
CL_Stop_f
stop recording a demo stop recording a demo
====================
*/ */
void void
CL_Stop_f (void) CL_Stop_f (void)
@ -211,12 +203,11 @@ CL_Stop_f (void)
Con_Printf ("Completed demo\n"); Con_Printf ("Completed demo\n");
} }
/*
====================
CL_Record_f
record <demoname> <map> [cd track] /*
==================== CL_Record_f
record <demoname> <map> [cd track]
*/ */
void void
CL_Record_f (void) CL_Record_f (void)
@ -253,13 +244,11 @@ CL_Record_f (void)
snprintf (name, sizeof (name), "%s/%s", com_gamedir, Cmd_Argv (1)); snprintf (name, sizeof (name), "%s/%s", com_gamedir, Cmd_Argv (1));
//
// start the map up // start the map up
// //
if (c > 2) if (c > 2)
Cmd_ExecuteString (va ("map %s", Cmd_Argv (2)), src_command); Cmd_ExecuteString (va ("map %s", Cmd_Argv (2)), src_command);
//
// open the demo file // open the demo file
// //
COM_DefaultExtension (name, ".dem"); COM_DefaultExtension (name, ".dem");
@ -279,11 +268,9 @@ CL_Record_f (void)
/* /*
==================== CL_PlayDemo_f
CL_PlayDemo_f
play [demoname] play [demoname]
====================
*/ */
void void
CL_PlayDemo_f (void) CL_PlayDemo_f (void)
@ -299,12 +286,11 @@ CL_PlayDemo_f (void)
Con_Printf ("play <demoname> : plays a demo\n"); Con_Printf ("play <demoname> : plays a demo\n");
return; return;
} }
//
// disconnect from server // disconnect from server
// //
CL_Disconnect (); CL_Disconnect ();
//
// open the demo file // open the demo file
// //
strcpy (name, Cmd_Argv (1)); strcpy (name, Cmd_Argv (1));
@ -343,7 +329,7 @@ CL_FinishTimeDemo (void)
cls.timedemo = false; cls.timedemo = false;
// the first frame didn't count // the first frame didn't count
frames = (host_framecount - cls.td_startframe) - 1; frames = (host_framecount - cls.td_startframe) - 1;
time = realtime - cls.td_starttime; time = realtime - cls.td_starttime;
if (!time) if (!time)
@ -352,12 +338,11 @@ CL_FinishTimeDemo (void)
frames / time); frames / time);
} }
/*
====================
CL_TimeDemo_f
timedemo [demoname] /*
==================== CL_TimeDemo_f
timedemo [demoname]
*/ */
void void
CL_TimeDemo_f (void) CL_TimeDemo_f (void)
@ -372,8 +357,8 @@ CL_TimeDemo_f (void)
CL_PlayDemo_f (); CL_PlayDemo_f ();
// cls.td_starttime will be grabbed at the second frame of the demo, so // cls.td_starttime will be grabbed at the second frame of the demo, so
// all the loading time doesn't get counted // all the loading time doesn't get counted
cls.timedemo = true; cls.timedemo = true;
cls.td_startframe = host_framecount; cls.td_startframe = host_framecount;

View file

@ -47,8 +47,6 @@
#include "host.h" #include "host.h"
/* /*
===============================================================================
KEY BUTTONS KEY BUTTONS
Continuous button event tracking is complicated by the fact that two different Continuous button event tracking is complicated by the fact that two different
@ -63,8 +61,6 @@ the release.
state bit 0 is the current state of the key state bit 0 is the current state of the key
state bit 1 is edge triggered on the up to down transition state bit 1 is edge triggered on the up to down transition
state bit 2 is edge triggered on the down to up transition state bit 2 is edge triggered on the down to up transition
===============================================================================
*/ */
@ -144,24 +140,28 @@ KeyUp (kbutton_t *b)
b->state |= 4; // impulse up b->state |= 4; // impulse up
} }
void void
IN_KLookDown (void) IN_KLookDown (void)
{ {
KeyDown (&in_klook); KeyDown (&in_klook);
} }
void void
IN_KLookUp (void) IN_KLookUp (void)
{ {
KeyUp (&in_klook); KeyUp (&in_klook);
} }
void void
IN_MLookDown (void) IN_MLookDown (void)
{ {
KeyDown (&in_mlook); KeyDown (&in_mlook);
} }
void void
IN_MLookUp (void) IN_MLookUp (void)
{ {
@ -170,42 +170,49 @@ IN_MLookUp (void)
V_StartPitchDrift (); V_StartPitchDrift ();
} }
void void
IN_UpDown (void) IN_UpDown (void)
{ {
KeyDown (&in_up); KeyDown (&in_up);
} }
void void
IN_UpUp (void) IN_UpUp (void)
{ {
KeyUp (&in_up); KeyUp (&in_up);
} }
void void
IN_DownDown (void) IN_DownDown (void)
{ {
KeyDown (&in_down); KeyDown (&in_down);
} }
void void
IN_DownUp (void) IN_DownUp (void)
{ {
KeyUp (&in_down); KeyUp (&in_down);
} }
void void
IN_LeftDown (void) IN_LeftDown (void)
{ {
KeyDown (&in_left); KeyDown (&in_left);
} }
void void
IN_LeftUp (void) IN_LeftUp (void)
{ {
KeyUp (&in_left); KeyUp (&in_left);
} }
void void
IN_RightDown (void) IN_RightDown (void)
{ {
@ -218,138 +225,161 @@ IN_RightUp (void)
KeyUp (&in_right); KeyUp (&in_right);
} }
void void
IN_ForwardDown (void) IN_ForwardDown (void)
{ {
KeyDown (&in_forward); KeyDown (&in_forward);
} }
void void
IN_ForwardUp (void) IN_ForwardUp (void)
{ {
KeyUp (&in_forward); KeyUp (&in_forward);
} }
void void
IN_BackDown (void) IN_BackDown (void)
{ {
KeyDown (&in_back); KeyDown (&in_back);
} }
void void
IN_BackUp (void) IN_BackUp (void)
{ {
KeyUp (&in_back); KeyUp (&in_back);
} }
void void
IN_LookupDown (void) IN_LookupDown (void)
{ {
KeyDown (&in_lookup); KeyDown (&in_lookup);
} }
void void
IN_LookupUp (void) IN_LookupUp (void)
{ {
KeyUp (&in_lookup); KeyUp (&in_lookup);
} }
void void
IN_LookdownDown (void) IN_LookdownDown (void)
{ {
KeyDown (&in_lookdown); KeyDown (&in_lookdown);
} }
void void
IN_LookdownUp (void) IN_LookdownUp (void)
{ {
KeyUp (&in_lookdown); KeyUp (&in_lookdown);
} }
void void
IN_MoveleftDown (void) IN_MoveleftDown (void)
{ {
KeyDown (&in_moveleft); KeyDown (&in_moveleft);
} }
void void
IN_MoveleftUp (void) IN_MoveleftUp (void)
{ {
KeyUp (&in_moveleft); KeyUp (&in_moveleft);
} }
void void
IN_MoverightDown (void) IN_MoverightDown (void)
{ {
KeyDown (&in_moveright); KeyDown (&in_moveright);
} }
void void
IN_MoverightUp (void) IN_MoverightUp (void)
{ {
KeyUp (&in_moveright); KeyUp (&in_moveright);
} }
void void
IN_SpeedDown (void) IN_SpeedDown (void)
{ {
KeyDown (&in_speed); KeyDown (&in_speed);
} }
void void
IN_SpeedUp (void) IN_SpeedUp (void)
{ {
KeyUp (&in_speed); KeyUp (&in_speed);
} }
void void
IN_StrafeDown (void) IN_StrafeDown (void)
{ {
KeyDown (&in_strafe); KeyDown (&in_strafe);
} }
void void
IN_StrafeUp (void) IN_StrafeUp (void)
{ {
KeyUp (&in_strafe); KeyUp (&in_strafe);
} }
void void
IN_AttackDown (void) IN_AttackDown (void)
{ {
KeyDown (&in_attack); KeyDown (&in_attack);
} }
void void
IN_AttackUp (void) IN_AttackUp (void)
{ {
KeyUp (&in_attack); KeyUp (&in_attack);
} }
void void
IN_UseDown (void) IN_UseDown (void)
{ {
KeyDown (&in_use); KeyDown (&in_use);
} }
void void
IN_UseUp (void) IN_UseUp (void)
{ {
KeyUp (&in_use); KeyUp (&in_use);
} }
void void
IN_JumpDown (void) IN_JumpDown (void)
{ {
KeyDown (&in_jump); KeyDown (&in_jump);
} }
void void
IN_JumpUp (void) IN_JumpUp (void)
{ {
KeyUp (&in_jump); KeyUp (&in_jump);
} }
void void
IN_Impulse (void) IN_Impulse (void)
{ {
@ -358,14 +388,12 @@ IN_Impulse (void)
/* /*
=============== CL_KeyState
CL_KeyState
Returns 0.25 if a key was pressed and released during the frame, Returns 0.25 if a key was pressed and released during the frame,
0.5 if it was pressed and held 0.5 if it was pressed and held
0 if held then released, and 0 if held then released, and
1.0 if held for the entire time 1.0 if held for the entire time
===============
*/ */
float float
CL_KeyState (kbutton_t *key) CL_KeyState (kbutton_t *key)
@ -409,27 +437,20 @@ CL_KeyState (kbutton_t *key)
} }
//==========================================================================
cvar_t *cl_upspeed;
cvar_t *cl_forwardspeed;
cvar_t *cl_backspeed;
cvar_t *cl_sidespeed;
cvar_t *cl_movespeedkey;
cvar_t *cl_yawspeed;
cvar_t *cl_pitchspeed;
cvar_t *cl_anglespeedkey; cvar_t *cl_anglespeedkey;
cvar_t *cl_backspeed;
cvar_t *cl_forwardspeed;
cvar_t *cl_movespeedkey;
cvar_t *cl_pitchspeed;
cvar_t *cl_sidespeed;
cvar_t *cl_upspeed;
cvar_t *cl_yawspeed;
/* /*
================ CL_AdjustAngles
CL_AdjustAngles
Moves the local angle positions Moves the local angle positions
================
*/ */
void void
CL_AdjustAngles (void) CL_AdjustAngles (void)
@ -480,11 +501,9 @@ CL_AdjustAngles (void)
/* /*
================ CL_BaseMove
CL_BaseMove
Send the intended movement message to the server Send the intended movement message to the server
================
*/ */
void void
CL_BaseMove (usercmd_t *cmd) CL_BaseMove (usercmd_t *cmd)
@ -511,7 +530,7 @@ CL_BaseMove (usercmd_t *cmd)
cmd->forwardmove += cl_forwardspeed->value * CL_KeyState (&in_forward); cmd->forwardmove += cl_forwardspeed->value * CL_KeyState (&in_forward);
cmd->forwardmove -= cl_backspeed->value * CL_KeyState (&in_back); cmd->forwardmove -= cl_backspeed->value * CL_KeyState (&in_back);
} }
//
// adjust for speed key // adjust for speed key
// //
if (in_speed.state & 1) { if (in_speed.state & 1) {
@ -544,11 +563,6 @@ CL_BaseMove (usercmd_t *cmd)
} }
/*
==============
CL_SendMove
==============
*/
void void
CL_SendMove (usercmd_t *cmd) CL_SendMove (usercmd_t *cmd)
{ {
@ -563,7 +577,6 @@ CL_SendMove (usercmd_t *cmd)
cl.cmd = *cmd; cl.cmd = *cmd;
//
// send the movement message // send the movement message
// //
MSG_WriteByte (&buf, clc_move); MSG_WriteByte (&buf, clc_move);
@ -577,7 +590,6 @@ CL_SendMove (usercmd_t *cmd)
MSG_WriteShort (&buf, cmd->sidemove); MSG_WriteShort (&buf, cmd->sidemove);
MSG_WriteShort (&buf, cmd->upmove); MSG_WriteShort (&buf, cmd->upmove);
//
// send button bits // send button bits
// //
bits = 0; bits = 0;
@ -596,22 +608,18 @@ CL_SendMove (usercmd_t *cmd)
in_impulse = 0; in_impulse = 0;
#ifdef QUAKE2 #ifdef QUAKE2
//
// light level // light level
// //
MSG_WriteByte (&buf, cmd->lightlevel); MSG_WriteByte (&buf, cmd->lightlevel);
#endif #endif
//
// deliver the message // deliver the message
// //
if (cls.demoplayback) if (cls.demoplayback)
return; return;
//
// always dump the first two message, because it may contain leftover inputs // always dump the first two message, because it may contain leftover inputs
// from the last level // from the last level
//
if (++cl.movemessages <= 2) if (++cl.movemessages <= 2)
return; return;

View file

@ -97,18 +97,11 @@ entity_t *cl_visedicts[MAX_VISEDICTS];
void void
CL_InitCvars (void) CL_InitCvars (void)
{ {
r_firecolor = Cvar_Get ("r_firecolor", "0.9 0.4 0", CVAR_ARCHIVE, NULL,
"color of rocket and lava ball fires");
show_fps = Cvar_Get ("show_fps", "0", CVAR_NONE, NULL,
"display realtime frames per second");
show_time = Cvar_Get ("show_time", "0", CVAR_NONE, NULL,
"display the current time");
// Misty: Turn on or off screen filling colors for powerups among other things.
cl_cshift_bonus = Cvar_Get ("cl_cshift_bonus", "1", CVAR_ARCHIVE, NULL, cl_cshift_bonus = Cvar_Get ("cl_cshift_bonus", "1", CVAR_ARCHIVE, NULL,
"Show bonus flash on item pickup"); "Show bonus flash on item pickup");
cl_cshift_contents = Cvar_Get ("cl_cshift_content", "1", CVAR_ARCHIVE, NULL, cl_cshift_contents = Cvar_Get ("cl_cshift_content", "1", CVAR_ARCHIVE,
"Shift view colors for contents (water, slime, etc)"); NULL, "Shift view colors for contents "
"(water, slime, etc)");
cl_cshift_damage = Cvar_Get ("cl_cshift_damage", "1", CVAR_ARCHIVE, NULL, cl_cshift_damage = Cvar_Get ("cl_cshift_damage", "1", CVAR_ARCHIVE, NULL,
"Shift view colors on damage"); "Shift view colors on damage");
cl_cshift_powerup = Cvar_Get ("cl_cshift_powerup", "1", CVAR_ARCHIVE, NULL, "Shift view colors for powerups"); cl_cshift_powerup = Cvar_Get ("cl_cshift_powerup", "1", CVAR_ARCHIVE, NULL, "Shift view colors for powerups");
@ -118,22 +111,22 @@ CL_InitCvars (void)
"Player name"); "Player name");
cl_color = Cvar_Get ("_cl_color", "0", CVAR_ARCHIVE, NULL, cl_color = Cvar_Get ("_cl_color", "0", CVAR_ARCHIVE, NULL,
"Player color"); "Player color");
cl_upspeed = Cvar_Get ("cl_upspeed", "200", CVAR_NONE, NULL, cl_anglespeedkey = Cvar_Get ("cl_anglespeedkey", "1.5", CVAR_NONE, NULL,
"swim/fly up/down speed"); "turn `run' speed multiplier");
cl_forwardspeed = Cvar_Get ("cl_forwardspeed", "200", CVAR_ARCHIVE, NULL,
"forward speed");
cl_backspeed = Cvar_Get ("cl_backspeed", "200", CVAR_ARCHIVE, NULL, cl_backspeed = Cvar_Get ("cl_backspeed", "200", CVAR_ARCHIVE, NULL,
"backward speed"); "backward speed");
cl_sidespeed = Cvar_Get ("cl_sidespeed", "350", CVAR_NONE, NULL, cl_forwardspeed = Cvar_Get ("cl_forwardspeed", "200", CVAR_ARCHIVE, NULL,
"strafe speed"); "forward speed");
cl_movespeedkey = Cvar_Get ("cl_movespeedkey", "2.0", CVAR_NONE, NULL, cl_movespeedkey = Cvar_Get ("cl_movespeedkey", "2.0", CVAR_NONE, NULL,
"move `run' speed multiplier"); "move `run' speed multiplier");
cl_yawspeed = Cvar_Get ("cl_yawspeed", "140", CVAR_NONE, NULL,
"turning speed");
cl_pitchspeed = Cvar_Get ("cl_pitchspeed", "150", CVAR_NONE, NULL, cl_pitchspeed = Cvar_Get ("cl_pitchspeed", "150", CVAR_NONE, NULL,
"look up/down speed"); "look up/down speed");
cl_anglespeedkey = Cvar_Get ("cl_anglespeedkey", "1.5", CVAR_NONE, cl_sidespeed = Cvar_Get ("cl_sidespeed", "350", CVAR_NONE, NULL,
NULL, "turn `run' speed multiplier"); "strafe speed");
cl_upspeed = Cvar_Get ("cl_upspeed", "200", CVAR_NONE, NULL,
"swim/fly up/down speed");
cl_yawspeed = Cvar_Get ("cl_yawspeed", "140", CVAR_NONE, NULL,
"turning speed");
cl_shownet = Cvar_Get ("cl_shownet", "0", CVAR_NONE, NULL, cl_shownet = Cvar_Get ("cl_shownet", "0", CVAR_NONE, NULL,
"show network packets. 0=off, 1=basic, 2=verbose"); "show network packets. 0=off, 1=basic, 2=verbose");
cl_nolerp = Cvar_Get ("cl_nolerp", "0", CVAR_NONE, NULL, cl_nolerp = Cvar_Get ("cl_nolerp", "0", CVAR_NONE, NULL,
@ -142,9 +135,8 @@ CL_InitCvars (void)
"status bar mode"); "status bar mode");
cl_hudswap = Cvar_Get ("cl_hudswap", "0", CVAR_ARCHIVE, NULL, cl_hudswap = Cvar_Get ("cl_hudswap", "0", CVAR_ARCHIVE, NULL,
"new HUD on left side?"); "new HUD on left side?");
lookspring = lookspring = Cvar_Get ("lookspring", "0", CVAR_ARCHIVE, NULL, "Snap view "
Cvar_Get ("lookspring", "0", CVAR_ARCHIVE, NULL, "to center when moving and no mlook/klook");
"Snap view to center when moving and no mlook/klook");
m_pitch = Cvar_Get ("m_pitch", "0.022", CVAR_ARCHIVE, NULL, m_pitch = Cvar_Get ("m_pitch", "0.022", CVAR_ARCHIVE, NULL,
"mouse pitch (up/down) multipier"); "mouse pitch (up/down) multipier");
m_yaw = Cvar_Get ("m_yaw", "0.022", CVAR_ARCHIVE, NULL, m_yaw = Cvar_Get ("m_yaw", "0.022", CVAR_ARCHIVE, NULL,
@ -153,6 +145,12 @@ CL_InitCvars (void)
"mouse forward/back speed"); "mouse forward/back speed");
m_side = Cvar_Get ("m_side", "0.8", CVAR_ARCHIVE, NULL, m_side = Cvar_Get ("m_side", "0.8", CVAR_ARCHIVE, NULL,
"mouse strafe speed"); "mouse strafe speed");
r_firecolor = Cvar_Get ("r_firecolor", "0.9 0.4 0", CVAR_ARCHIVE, NULL,
"color of rocket and lava ball fires");
show_fps = Cvar_Get ("show_fps", "0", CVAR_NONE, NULL,
"display realtime frames per second");
show_time = Cvar_Get ("show_time", "0", CVAR_NONE, NULL,
"display the current time");
} }

View file

@ -100,15 +100,11 @@ char *svc_strings[] = {
"svc_cutscene" "svc_cutscene"
}; };
//=============================================================================
/* /*
=============== CL_EntityNum
CL_EntityNum
This error checks and tracks the total number of entities This error checks and tracks the total number of entities
===============
*/ */
entity_t * entity_t *
CL_EntityNum (int num) CL_EntityNum (int num)
@ -167,12 +163,10 @@ CL_ParseStartSoundPacket (void)
/* /*
================== CL_KeepaliveMessage
CL_KeepaliveMessage
When the client is taking a long time to load stuff, send keepalive messages When the client is taking a long time to load stuff, send keepalive
so the server doesn't disconnect. messages so the server doesn't disconnect.
==================
*/ */
void void
CL_KeepaliveMessage (void) CL_KeepaliveMessage (void)
@ -239,12 +233,12 @@ CL_ParseServerInfo (void)
char sound_precache[MAX_SOUNDS][MAX_QPATH]; char sound_precache[MAX_SOUNDS][MAX_QPATH];
Con_DPrintf ("Serverinfo packet received.\n"); Con_DPrintf ("Serverinfo packet received.\n");
//
// wipe the client_state_t struct // wipe the client_state_t struct
// //
CL_ClearState (); CL_ClearState ();
// parse protocol version number // parse protocol version number
i = MSG_ReadLong (net_message); i = MSG_ReadLong (net_message);
if (i != PROTOCOL_VERSION) { if (i != PROTOCOL_VERSION) {
Con_Printf ("Server returned version %i, not %i", i, PROTOCOL_VERSION); Con_Printf ("Server returned version %i, not %i", i, PROTOCOL_VERSION);
@ -270,11 +264,9 @@ CL_ParseServerInfo (void)
("\n\n\35\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\37\n\n"); ("\n\n\35\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\37\n\n");
Con_Printf ("%c%s\n", 2, str); Con_Printf ("%c%s\n", 2, str);
//
// first we go through and touch all of the precache data that still // first we go through and touch all of the precache data that still
// happens to be in the cache, so precaching something else doesn't // happens to be in the cache, so precaching something else doesn't
// needlessly purge it // needlessly purge it
//
// precache models // precache models
memset (cl.model_precache, 0, sizeof (cl.model_precache)); memset (cl.model_precache, 0, sizeof (cl.model_precache));
@ -304,9 +296,7 @@ CL_ParseServerInfo (void)
S_TouchSound (str); S_TouchSound (str);
} }
//
// now we try to load everything else until a cache allocation fails // now we try to load everything else until a cache allocation fails
//
for (i = 1; i < nummodels; i++) { for (i = 1; i < nummodels; i++) {
cl.model_precache[i] = Mod_ForName (model_precache[i], false); cl.model_precache[i] = Mod_ForName (model_precache[i], false);
@ -336,17 +326,16 @@ CL_ParseServerInfo (void)
} }
/*
==================
CL_ParseUpdate
Parse an entity update message from the server
If an entities model or origin changes from frame to frame, it must be
relinked. Other attributes can change without relinking.
==================
*/
int bitcounts[16]; int bitcounts[16];
/*
CL_ParseUpdate
Parse an entity update message from the server
If an entities model or origin changes from frame to frame, it must be
relinked. Other attributes can change without relinking.
*/
void void
CL_ParseUpdate (int bits) CL_ParseUpdate (int bits)
{ {
@ -504,11 +493,9 @@ CL_ParseBaseline (entity_t *ent)
/* /*
================== CL_ParseClientdata
CL_ParseClientdata
Server information pertaining to this client only Server information pertaining to this client only
==================
*/ */
void void
CL_ParseClientdata (int bits) CL_ParseClientdata (int bits)
@ -696,7 +683,6 @@ CL_ParseServerMessage (void)
int cmd; int cmd;
int i; int i;
//
// if recording demos, copy the message out // if recording demos, copy the message out
// //
if (cl_shownet->int_val == 1) if (cl_shownet->int_val == 1)
@ -705,7 +691,7 @@ CL_ParseServerMessage (void)
Con_Printf ("------------------\n"); Con_Printf ("------------------\n");
cl.onground = false; // unless the server says otherwise cl.onground = false; // unless the server says otherwise
//
// parse the message // parse the message
// //
MSG_BeginReading (net_message); MSG_BeginReading (net_message);

View file

@ -77,6 +77,7 @@ double cam_lastviewtime;
int spec_track = 0; // player# of who we are tracking int spec_track = 0; // player# of who we are tracking
int autocam = CAM_NONE; int autocam = CAM_NONE;
static void static void
vectoangles (vec3_t vec, vec3_t ang) vectoangles (vec3_t vec, vec3_t ang)
{ {
@ -105,12 +106,14 @@ vectoangles (vec3_t vec, vec3_t ang)
ang[2] = 0; ang[2] = 0;
} }
static float static float
vlen (vec3_t v) vlen (vec3_t v)
{ {
return sqrt (v[0] * v[0] + v[1] * v[1] + v[2] * v[2]); return sqrt (v[0] * v[0] + v[1] * v[1] + v[2] * v[2]);
} }
// returns true if weapon model should be drawn in camera mode // returns true if weapon model should be drawn in camera mode
qboolean qboolean
Cam_DrawViewModel (void) Cam_DrawViewModel (void)
@ -123,6 +126,7 @@ Cam_DrawViewModel (void)
return false; return false;
} }
// returns true if we should draw this player, we don't if we are chase camming // returns true if we should draw this player, we don't if we are chase camming
qboolean qboolean
Cam_DrawPlayer (int playernum) Cam_DrawPlayer (int playernum)
@ -133,6 +137,7 @@ Cam_DrawPlayer (int playernum)
return true; return true;
} }
void void
Cam_Unlock (void) Cam_Unlock (void)
{ {
@ -145,6 +150,7 @@ Cam_Unlock (void)
} }
} }
void void
Cam_Lock (int playernum) Cam_Lock (int playernum)
{ {
@ -159,6 +165,7 @@ Cam_Lock (int playernum)
Sbar_Changed (); Sbar_Changed ();
} }
pmtrace_t pmtrace_t
Cam_DoTrace (vec3_t vec1, vec3_t vec2) Cam_DoTrace (vec3_t vec1, vec3_t vec2)
{ {
@ -174,6 +181,7 @@ Cam_DoTrace (vec3_t vec1, vec3_t vec2)
return PM_PlayerMove (pmove.origin, vec2); return PM_PlayerMove (pmove.origin, vec2);
} }
// Returns distance or 9999 if invalid for some reason // Returns distance or 9999 if invalid for some reason
static float static float
Cam_TryFlyby (player_state_t * self, player_state_t * player, vec3_t vec, Cam_TryFlyby (player_state_t * self, player_state_t * player, vec3_t vec,
@ -209,6 +217,7 @@ Cam_TryFlyby (player_state_t * self, player_state_t * player, vec3_t vec,
return len; return len;
} }
// Is player visible? // Is player visible?
static qboolean static qboolean
Cam_IsVisible (player_state_t * player, vec3_t vec) Cam_IsVisible (player_state_t * player, vec3_t vec)
@ -228,6 +237,7 @@ Cam_IsVisible (player_state_t * player, vec3_t vec)
return true; return true;
} }
static qboolean static qboolean
InitFlyby (player_state_t * self, player_state_t * player, int checkvis) InitFlyby (player_state_t * self, player_state_t * player, int checkvis)
{ {
@ -318,6 +328,7 @@ InitFlyby (player_state_t * self, player_state_t * player, int checkvis)
return true; return true;
} }
static void static void
Cam_CheckHighTarget (void) Cam_CheckHighTarget (void)
{ {
@ -339,6 +350,7 @@ Cam_CheckHighTarget (void)
Cam_Unlock (); Cam_Unlock ();
} }
// ZOID // ZOID
// //
// Take over the user controls and track a player. // Take over the user controls and track a player.
@ -425,6 +437,7 @@ Cam_Track (usercmd_t *cmd)
} }
} }
#if 0 #if 0
static float static float
adjustang (float current, float ideal, float speed) adjustang (float current, float ideal, float speed)
@ -458,6 +471,7 @@ adjustang (float current, float ideal, float speed)
} }
#endif #endif
#if 0 #if 0
void void
Cam_SetView (void) Cam_SetView (void)
@ -494,6 +508,7 @@ Cam_SetView (void)
} }
#endif #endif
void void
Cam_FinishMove (usercmd_t *cmd) Cam_FinishMove (usercmd_t *cmd)
{ {
@ -593,6 +608,7 @@ Cam_FinishMove (usercmd_t *cmd)
autocam = locked = false; autocam = locked = false;
} }
void void
Cam_Reset (void) Cam_Reset (void)
{ {
@ -600,13 +616,18 @@ Cam_Reset (void)
spec_track = 0; spec_track = 0;
} }
void void
CL_Cam_Init_Cvars (void) CL_Cam_Init_Cvars (void)
{ {
cl_hightrack = Cvar_Get ("cl_hightrack", "0", CVAR_NONE, NULL, "view the player with the highest frags while in spectator mode."); cl_hightrack = Cvar_Get ("cl_hightrack", "0", CVAR_NONE, NULL, "view the "
cl_chasecam = Cvar_Get ("cl_chasecam", "0", CVAR_NONE, NULL, "get first person view of the person you are tracking in spectator mode"); "player who has the most frags while you are in "
cl_camera_maxpitch = "spectator mode.");
Cvar_Get ("cl_camera_maxpitch", "10", CVAR_NONE, NULL, "highest camera pitch in spectator mode"); cl_chasecam = Cvar_Get ("cl_chasecam", "0", CVAR_NONE, NULL, "get first "
cl_camera_maxyaw = Cvar_Get ("cl_camera_maxyaw", "30", CVAR_NONE, NULL, "highest camera yaw in spectator mode"); "person view of the person you are tracking in "
"spectator mode");
cl_camera_maxpitch = Cvar_Get ("cl_camera_maxpitch", "10", CVAR_NONE, NULL,
"highest camera pitch in spectator mode");
cl_camera_maxyaw = Cvar_Get ("cl_camera_maxyaw", "30", CVAR_NONE, NULL,
"highest camera yaw in spectator mode");
} }

View file

@ -42,6 +42,7 @@
#include "QF/msg.h" #include "QF/msg.h"
#include "QF/teamplay.h" #include "QF/teamplay.h"
/* /*
Cmd_ForwardToServer Cmd_ForwardToServer
@ -86,6 +87,7 @@ Cmd_ForwardToServer (void)
} }
} }
// don't forward the first argument // don't forward the first argument
void void
Cmd_ForwardToServer_f (void) Cmd_ForwardToServer_f (void)
@ -109,22 +111,19 @@ Cmd_ForwardToServer_f (void)
} }
} }
/*
cl_Cmd_Init
*/
void void
cl_Cmd_Init (void) cl_Cmd_Init (void)
{ {
//
// register our commands // register our commands
//
Cmd_AddCommand ("cmd", Cmd_ForwardToServer_f, "Send a command to the server.\n" Cmd_AddCommand ("cmd", Cmd_ForwardToServer_f, "Send a command to the server.\n"
"Commands:\n" "Commands:\n"
"download - Same as the command.\n" "download - Same as the command.\n"
"kill - Same as the command.\n" "kill - Same as the command.\n"
"msg (value) - Same as the command.\n" "msg (value) - Same as the command.\n"
"prespawn (entity) (spot) - Find a spawn spot for the player entity.\n" "prespawn (entity) (spot) - Find a spawn spot for the"
"spawn (entity) - Spawn the player entity.\n" " player entity.\n"
"setinfo - Same as the command.\n" "spawn (entity) - Spawn the player entity.\n"
"serverinfo - Same as the command."); "setinfo - Same as the command.\n"
"serverinfo - Same as the command.");
} }

View file

@ -61,6 +61,7 @@ int demotime_cached;
read from the demo file. read from the demo file.
*/ */
/* /*
CL_StopPlayback CL_StopPlayback
@ -82,10 +83,12 @@ CL_StopPlayback (void)
CL_FinishTimeDemo (); CL_FinishTimeDemo ();
} }
#define dem_cmd 0 #define dem_cmd 0
#define dem_read 1 #define dem_read 1
#define dem_set 2 #define dem_set 2
/* /*
CL_WriteDemoCmd CL_WriteDemoCmd
@ -99,7 +102,7 @@ CL_WriteDemoCmd (usercmd_t *pcmd)
byte c; byte c;
usercmd_t cmd; usercmd_t cmd;
//Con_Printf("write: %ld bytes, %4.4f\n", msg->cursize, realtime); // Con_Printf("write: %ld bytes, %4.4f\n", msg->cursize, realtime);
fl = LittleFloat ((float) realtime); fl = LittleFloat ((float) realtime);
Qwrite (cls.demofile, &fl, sizeof (fl)); Qwrite (cls.demofile, &fl, sizeof (fl));
@ -126,6 +129,7 @@ CL_WriteDemoCmd (usercmd_t *pcmd)
Qflush (cls.demofile); Qflush (cls.demofile);
} }
/* /*
CL_WriteDemoMessage CL_WriteDemoMessage
@ -138,7 +142,7 @@ CL_WriteDemoMessage (sizebuf_t *msg)
float fl; float fl;
byte c; byte c;
//Con_Printf("write: %ld bytes, %4.4f\n", msg->cursize, realtime); // Con_Printf("write: %ld bytes, %4.4f\n", msg->cursize, realtime);
if (!cls.demorecording) if (!cls.demorecording)
return; return;
@ -156,11 +160,7 @@ CL_WriteDemoMessage (sizebuf_t *msg)
Qflush (cls.demofile); Qflush (cls.demofile);
} }
/*
CL_GetDemoMessage
FIXME...
*/
qboolean qboolean
CL_GetDemoMessage (void) CL_GetDemoMessage (void)
{ {
@ -180,7 +180,7 @@ CL_GetDemoMessage (void)
demotime = LittleFloat (demotime); demotime = LittleFloat (demotime);
} }
// decide if it is time to grab the next message // decide if it is time to grab the next message
if (cls.timedemo) { if (cls.timedemo) {
if (cls.td_lastframe < 0) if (cls.td_lastframe < 0)
cls.td_lastframe = demotime; cls.td_lastframe = demotime;
@ -250,9 +250,9 @@ CL_GetDemoMessage (void)
// get the next message // get the next message
Qread (cls.demofile, &net_message->message->cursize, 4); Qread (cls.demofile, &net_message->message->cursize, 4);
net_message->message->cursize = LittleLong (net_message->message->cursize); net_message->message->cursize = LittleLong (net_message->message->cursize);
// Con_Printf("read: %ld bytes\n", net_message->message->cursize); // Con_Printf("read: %ld bytes\n", net_message->message->cursize);
if (net_message->message->cursize > MAX_MSGLEN) if (net_message->message->cursize > MAX_MSGLEN)
// Sys_Error ("Demo message > MAX_MSGLEN"); // Sys_Error ("Demo message > MAX_MSGLEN");
Host_EndGame ("Demo message > MAX_MSGLEN"); Host_EndGame ("Demo message > MAX_MSGLEN");
r = Qread (cls.demofile, net_message->message->data, net_message->message->cursize); r = Qread (cls.demofile, net_message->message->data, net_message->message->cursize);
if (r != net_message->message->cursize) { if (r != net_message->message->cursize) {
@ -277,6 +277,7 @@ CL_GetDemoMessage (void)
return 1; return 1;
} }
/* /*
CL_GetMessage CL_GetMessage
@ -337,7 +338,7 @@ CL_WriteRecordDemoMessage (sizebuf_t *msg, int seq)
float fl; float fl;
byte c; byte c;
//Con_Printf("write: %ld bytes, %4.4f\n", msg->cursize, realtime); // Con_Printf("write: %ld bytes, %4.4f\n", msg->cursize, realtime);
if (!cls.demorecording) if (!cls.demorecording)
return; return;
@ -388,8 +389,6 @@ CL_WriteSetDemoMessage (void)
} }
/* /*
CL_Record_f CL_Record_f
@ -426,7 +425,6 @@ CL_Record_f (void)
snprintf (name, sizeof (name), "%s/%s", com_gamedir, Cmd_Argv (1)); snprintf (name, sizeof (name), "%s/%s", com_gamedir, Cmd_Argv (1));
//
// open the demo file // open the demo file
// //
COM_DefaultExtension (name, ".qwd"); COM_DefaultExtension (name, ".qwd");
@ -676,6 +674,7 @@ CL_Record_f (void)
// done // done
} }
/* /*
CL_ReRecord_f CL_ReRecord_f
@ -703,7 +702,6 @@ CL_ReRecord_f (void)
snprintf (name, sizeof (name), "%s/%s", com_gamedir, Cmd_Argv (1)); snprintf (name, sizeof (name), "%s/%s", com_gamedir, Cmd_Argv (1));
//
// open the demo file // open the demo file
// //
COM_DefaultExtension (name, ".qwd"); COM_DefaultExtension (name, ".qwd");
@ -736,14 +734,11 @@ CL_PlayDemo_f (void)
Con_Printf ("play <demoname> : plays a demo\n"); Con_Printf ("play <demoname> : plays a demo\n");
return; return;
} }
//
// disconnect from server // disconnect from server
//
CL_Disconnect (); CL_Disconnect ();
// // open the demo file
// open the demo file
//
strcpy (name, Cmd_Argv (1)); strcpy (name, Cmd_Argv (1));
COM_DefaultExtension (name, ".qwd"); COM_DefaultExtension (name, ".qwd");
@ -761,9 +756,7 @@ CL_PlayDemo_f (void)
realtime = 0; realtime = 0;
} }
/*
CL_FinishTimeDemo
*/
void void
CL_FinishTimeDemo (void) CL_FinishTimeDemo (void)
{ {
@ -772,7 +765,7 @@ CL_FinishTimeDemo (void)
cls.timedemo = false; cls.timedemo = false;
// the first frame didn't count // the first frame didn't count
frames = (host_framecount - cls.td_startframe) - 1; frames = (host_framecount - cls.td_startframe) - 1;
time = Sys_DoubleTime () - cls.td_starttime; time = Sys_DoubleTime () - cls.td_starttime;
if (!time) if (!time)
@ -781,6 +774,7 @@ CL_FinishTimeDemo (void)
frames / time); frames / time);
} }
/* /*
CL_TimeDemo_f CL_TimeDemo_f
@ -799,8 +793,8 @@ CL_TimeDemo_f (void)
if (cls.state != ca_demostart) if (cls.state != ca_demostart)
return; return;
// cls.td_starttime will be grabbed at the second frame of the demo, so // cls.td_starttime will be grabbed at the second frame of the demo, so
// all the loading time doesn't get counted // all the loading time doesn't get counted
cls.timedemo = true; cls.timedemo = true;
cls.td_starttime = 0; cls.td_starttime = 0;

View file

@ -69,11 +69,7 @@ entity_t cl_packet_ents[512]; // FIXME: magic number
entity_t cl_flag_ents[MAX_CLIENTS]; entity_t cl_flag_ents[MAX_CLIENTS];
entity_t cl_player_ents[MAX_CLIENTS]; entity_t cl_player_ents[MAX_CLIENTS];
//============================================================
/*
CL_ClearEnts
*/
void void
CL_ClearEnts () CL_ClearEnts ()
{ {
@ -87,9 +83,7 @@ CL_ClearEnts ()
CL_Init_Entity (&cl_player_ents[i]); CL_Init_Entity (&cl_player_ents[i]);
} }
/*
CL_AllocDlight
*/
dlight_t * dlight_t *
CL_AllocDlight (int key) CL_AllocDlight (int key)
{ {
@ -125,9 +119,7 @@ CL_AllocDlight (int key)
return dl; return dl;
} }
/*
CL_NewDlight
*/
void void
CL_NewDlight (int key, vec3_t org, int effects) CL_NewDlight (int key, vec3_t org, int effects)
{ {
@ -168,9 +160,6 @@ CL_NewDlight (int key, vec3_t org, int effects)
} }
/*
CL_DecayLights
*/
void void
CL_DecayLights (void) CL_DecayLights (void)
{ {
@ -193,6 +182,7 @@ CL_DecayLights (void)
PACKET ENTITY PARSING / LINKING PACKET ENTITY PARSING / LINKING
*/ */
/* /*
CL_ParseDelta CL_ParseDelta
@ -285,20 +275,22 @@ CL_ParseDelta (entity_state_t *from, entity_state_t *to, int bits)
if (bits & U_SOLID) { if (bits & U_SOLID) {
// FIXME // FIXME
} }
/* /*
if ((!to->alpha) || (!to->colormod)) Con_Printf("fa: %d, fc: %d, ta: if ((!to->alpha) || (!to->colormod))
%d, tc: %d\n", from->alpha, from->colormod, to->alpha, to->colormod); */ Con_Printf("fa: %d, fc: %d, ta: %d, tc: %d\n",
/* from->alpha, from->colormod, to->alpha, to->colormod);
if ((!ent->alpha) || (!ent->colormod[0]) || (!ent->colormod[1]) || */
(!ent->colormod[2])) { Con_Printf("ea: %f, ec0: %f, ec1: %f ec2: %f, /*
sa: %d, sc: %d\n", ent->alpha, ent->colormod[0], ent->colormod[1], if ((!ent->alpha) || (!ent->colormod[0]) || (!ent->colormod[1]) ||
ent->colormod[2], s1->alpha, s1->colormod); } */ (!ent->colormod[2])) {
Con_Printf ("ea: %f, ec0: %f, ec1: %f ec2: %f, sa: %d, sc: %d\n",
ent->alpha, ent->colormod[0], ent->colormod[1],
ent->colormod[2], s1->alpha, s1->colormod);
}
*/
} }
/*
FlushEntityPacket
*/
void void
FlushEntityPacket (void) FlushEntityPacket (void)
{ {
@ -315,7 +307,7 @@ FlushEntityPacket (void)
// read it all, but ignore it // read it all, but ignore it
while (1) { while (1) {
word = (unsigned short) MSG_ReadShort (net_message); word = (unsigned short) MSG_ReadShort (net_message);
if (net_message->badread) { // something didn't parse right... if (net_message->badread) { // something didn't parse right...
Host_EndGame ("msg_badread in packetentities"); Host_EndGame ("msg_badread in packetentities");
return; return;
} }
@ -327,6 +319,7 @@ FlushEntityPacket (void)
} }
} }
/* /*
CL_ParsePacketEntities CL_ParsePacketEntities
@ -456,9 +449,6 @@ CL_ParsePacketEntities (qboolean delta)
} }
/*
CL_LinkPacketEntities
*/
void void
CL_LinkPacketEntities (void) CL_LinkPacketEntities (void)
{ {
@ -602,12 +592,14 @@ int cl_num_projectiles;
extern int cl_spikeindex; extern int cl_spikeindex;
void void
CL_ClearProjectiles (void) CL_ClearProjectiles (void)
{ {
cl_num_projectiles = 0; cl_num_projectiles = 0;
} }
/* /*
CL_ParseProjectiles CL_ParseProjectiles
@ -640,9 +632,7 @@ CL_ParseProjectiles (void)
} }
} }
/*
CL_LinkProjectiles
*/
void void
CL_LinkProjectiles (void) CL_LinkProjectiles (void)
{ {
@ -674,13 +664,12 @@ CL_LinkProjectiles (void)
} }
} }
//======================================== //========================================
extern int cl_spikeindex, cl_playerindex, cl_flagindex; extern int cl_spikeindex, cl_playerindex, cl_flagindex;
/*
CL_ParsePlayerinfo
*/
extern int parsecountmod; extern int parsecountmod;
extern double parsecounttime; extern double parsecounttime;
void void
@ -824,6 +813,7 @@ CL_AddFlagModels (entity_t *ent, int team)
(*newent)->angles[2] -= 45; (*newent)->angles[2] -= 45;
} }
/* /*
CL_LinkPlayers CL_LinkPlayers
@ -933,8 +923,10 @@ CL_LinkPlayers (void)
} }
} }
//====================================================================== //======================================================================
/* /*
CL_SetSolid CL_SetSolid
@ -974,6 +966,7 @@ CL_SetSolidEntities (void)
} }
/* /*
Calculate the new position of players, without other player clipping Calculate the new position of players, without other player clipping
@ -1038,6 +1031,7 @@ CL_SetUpPlayerPrediction (qboolean dopred)
} }
} }
/* /*
CL_SetSolid CL_SetSolid
@ -1105,6 +1099,7 @@ CL_EmitEntities (void)
CL_UpdateTEnts (); CL_UpdateTEnts ();
} }
void void
CL_Ents_Init (void) CL_Ents_Init (void)
{ {

View file

@ -146,24 +146,28 @@ KeyUp (kbutton_t *b)
b->state |= 4; // impulse up b->state |= 4; // impulse up
} }
void void
IN_KLookDown (void) IN_KLookDown (void)
{ {
KeyDown (&in_klook); KeyDown (&in_klook);
} }
void void
IN_KLookUp (void) IN_KLookUp (void)
{ {
KeyUp (&in_klook); KeyUp (&in_klook);
} }
void void
IN_MLookDown (void) IN_MLookDown (void)
{ {
KeyDown (&in_mlook); KeyDown (&in_mlook);
} }
void void
IN_MLookUp (void) IN_MLookUp (void)
{ {
@ -172,186 +176,217 @@ IN_MLookUp (void)
V_StartPitchDrift (); V_StartPitchDrift ();
} }
void void
IN_UpDown (void) IN_UpDown (void)
{ {
KeyDown (&in_up); KeyDown (&in_up);
} }
void void
IN_UpUp (void) IN_UpUp (void)
{ {
KeyUp (&in_up); KeyUp (&in_up);
} }
void void
IN_DownDown (void) IN_DownDown (void)
{ {
KeyDown (&in_down); KeyDown (&in_down);
} }
void void
IN_DownUp (void) IN_DownUp (void)
{ {
KeyUp (&in_down); KeyUp (&in_down);
} }
void void
IN_LeftDown (void) IN_LeftDown (void)
{ {
KeyDown (&in_left); KeyDown (&in_left);
} }
void void
IN_LeftUp (void) IN_LeftUp (void)
{ {
KeyUp (&in_left); KeyUp (&in_left);
} }
void void
IN_RightDown (void) IN_RightDown (void)
{ {
KeyDown (&in_right); KeyDown (&in_right);
} }
void void
IN_RightUp (void) IN_RightUp (void)
{ {
KeyUp (&in_right); KeyUp (&in_right);
} }
void void
IN_ForwardDown (void) IN_ForwardDown (void)
{ {
KeyDown (&in_forward); KeyDown (&in_forward);
} }
void void
IN_ForwardUp (void) IN_ForwardUp (void)
{ {
KeyUp (&in_forward); KeyUp (&in_forward);
} }
void void
IN_BackDown (void) IN_BackDown (void)
{ {
KeyDown (&in_back); KeyDown (&in_back);
} }
void void
IN_BackUp (void) IN_BackUp (void)
{ {
KeyUp (&in_back); KeyUp (&in_back);
} }
void void
IN_LookupDown (void) IN_LookupDown (void)
{ {
KeyDown (&in_lookup); KeyDown (&in_lookup);
} }
void void
IN_LookupUp (void) IN_LookupUp (void)
{ {
KeyUp (&in_lookup); KeyUp (&in_lookup);
} }
void void
IN_LookdownDown (void) IN_LookdownDown (void)
{ {
KeyDown (&in_lookdown); KeyDown (&in_lookdown);
} }
void void
IN_LookdownUp (void) IN_LookdownUp (void)
{ {
KeyUp (&in_lookdown); KeyUp (&in_lookdown);
} }
void void
IN_MoveleftDown (void) IN_MoveleftDown (void)
{ {
KeyDown (&in_moveleft); KeyDown (&in_moveleft);
} }
void void
IN_MoveleftUp (void) IN_MoveleftUp (void)
{ {
KeyUp (&in_moveleft); KeyUp (&in_moveleft);
} }
void void
IN_MoverightDown (void) IN_MoverightDown (void)
{ {
KeyDown (&in_moveright); KeyDown (&in_moveright);
} }
void void
IN_MoverightUp (void) IN_MoverightUp (void)
{ {
KeyUp (&in_moveright); KeyUp (&in_moveright);
} }
void void
IN_SpeedDown (void) IN_SpeedDown (void)
{ {
KeyDown (&in_speed); KeyDown (&in_speed);
} }
void void
IN_SpeedUp (void) IN_SpeedUp (void)
{ {
KeyUp (&in_speed); KeyUp (&in_speed);
} }
void void
IN_StrafeDown (void) IN_StrafeDown (void)
{ {
KeyDown (&in_strafe); KeyDown (&in_strafe);
} }
void void
IN_StrafeUp (void) IN_StrafeUp (void)
{ {
KeyUp (&in_strafe); KeyUp (&in_strafe);
} }
void void
IN_AttackDown (void) IN_AttackDown (void)
{ {
KeyDown (&in_attack); KeyDown (&in_attack);
} }
void void
IN_AttackUp (void) IN_AttackUp (void)
{ {
KeyUp (&in_attack); KeyUp (&in_attack);
} }
void void
IN_UseDown (void) IN_UseDown (void)
{ {
KeyDown (&in_use); KeyDown (&in_use);
} }
void void
IN_UseUp (void) IN_UseUp (void)
{ {
KeyUp (&in_use); KeyUp (&in_use);
} }
void void
IN_JumpDown (void) IN_JumpDown (void)
{ {
KeyDown (&in_jump); KeyDown (&in_jump);
} }
void void
IN_JumpUp (void) IN_JumpUp (void)
{ {
KeyUp (&in_jump); KeyUp (&in_jump);
} }
void void
IN_Impulse (void) IN_Impulse (void)
{ {
@ -362,6 +397,7 @@ IN_Impulse (void)
Team_BestWeaponImpulse (); // HACK HACK HACK Team_BestWeaponImpulse (); // HACK HACK HACK
} }
/* /*
CL_KeyState CL_KeyState
@ -412,21 +448,16 @@ CL_KeyState (kbutton_t *key)
} }
//========================================================================== //==========================================================================
cvar_t *cl_upspeed;
cvar_t *cl_forwardspeed;
cvar_t *cl_backspeed;
cvar_t *cl_sidespeed;
cvar_t *cl_movespeedkey;
cvar_t *cl_yawspeed;
cvar_t *cl_pitchspeed;
cvar_t *cl_anglespeedkey; cvar_t *cl_anglespeedkey;
cvar_t *cl_backspeed;
cvar_t *cl_forwardspeed;
cvar_t *cl_movespeedkey;
cvar_t *cl_pitchspeed;
cvar_t *cl_sidespeed;
cvar_t *cl_upspeed;
cvar_t *cl_yawspeed;
/* /*
@ -481,6 +512,7 @@ CL_AdjustAngles (void)
} }
/* /*
CL_BaseMove CL_BaseMove
@ -509,7 +541,7 @@ CL_BaseMove (usercmd_t *cmd)
cmd->forwardmove += cl_forwardspeed->value * CL_KeyState (&in_forward); cmd->forwardmove += cl_forwardspeed->value * CL_KeyState (&in_forward);
cmd->forwardmove -= cl_backspeed->value * CL_KeyState (&in_back); cmd->forwardmove -= cl_backspeed->value * CL_KeyState (&in_back);
} }
//
// adjust for speed key // adjust for speed key
// //
if (in_speed.state & 1) { if (in_speed.state & 1) {
@ -538,6 +570,7 @@ CL_BaseMove (usercmd_t *cmd)
} }
} }
int int
MakeChar (int i) MakeChar (int i)
{ {
@ -549,22 +582,18 @@ MakeChar (int i)
return i; return i;
} }
/*
CL_FinishMove
*/
void void
CL_FinishMove (usercmd_t *cmd) CL_FinishMove (usercmd_t *cmd)
{ {
int i; int i;
int ms; int ms;
//
// always dump the first two message, because it may contain leftover inputs // always dump the first two message, because it may contain leftover inputs
// from the last level // from the last level
//
if (++cl.movemessages <= 2) if (++cl.movemessages <= 2)
return; return;
//
// figure button bits // figure button bits
// //
if (in_attack.state & 3) if (in_attack.state & 3)
@ -592,8 +621,6 @@ CL_FinishMove (usercmd_t *cmd)
cmd->impulse = in_impulse; cmd->impulse = in_impulse;
in_impulse = 0; in_impulse = 0;
//
// chop down so no extra bits are kept that the server wouldn't get // chop down so no extra bits are kept that the server wouldn't get
// //
cmd->forwardmove = MakeChar (cmd->forwardmove); cmd->forwardmove = MakeChar (cmd->forwardmove);
@ -606,9 +633,7 @@ CL_FinishMove (usercmd_t *cmd)
65536.0); 65536.0);
} }
/*
CL_SendCmd
*/
void void
CL_SendCmd (void) CL_SendCmd (void)
{ {
@ -629,7 +654,7 @@ CL_SendCmd (void)
cl.frames[i].senttime = realtime; cl.frames[i].senttime = realtime;
cl.frames[i].receivedtime = -1; // we haven't gotten a reply yet cl.frames[i].receivedtime = -1; // we haven't gotten a reply yet
// seq_hash = (cls.netchan.outgoing_sequence & 0xffff) ; // ^ QW_CHECK_HASH; // seq_hash = (cls.netchan.outgoing_sequence & 0xffff) ; // ^ QW_CHECK_HASH;
seq_hash = cls.netchan.outgoing_sequence; seq_hash = cls.netchan.outgoing_sequence;
// get basic movement from keyboard // get basic movement from keyboard
@ -698,61 +723,93 @@ CL_SendCmd (void)
if (cls.demorecording) if (cls.demorecording)
CL_WriteDemoCmd (cmd); CL_WriteDemoCmd (cmd);
//
// deliver the message // deliver the message
// //
Netchan_Transmit (&cls.netchan, buf.cursize, buf.data); Netchan_Transmit (&cls.netchan, buf.cursize, buf.data);
} }
/*
CL_InitInput
*/
void void
CL_Input_Init (void) CL_Input_Init (void)
{ {
Cmd_AddCommand ("+moveup", IN_UpDown, "When active the player is swimming up in a liquid"); Cmd_AddCommand ("+moveup", IN_UpDown, "When active the player is swimming "
Cmd_AddCommand ("-moveup", IN_UpUp, "When active the player is not swimming up in a liquid"); "up in a liquid");
Cmd_AddCommand ("+movedown", IN_DownDown, "When active the player is swimming down in a liquid"); Cmd_AddCommand ("-moveup", IN_UpUp, "When active the player is not "
Cmd_AddCommand ("-movedown", IN_DownUp, "When active the player is not swimming down in a liquid"); "swimming up in a liquid");
Cmd_AddCommand ("+left", IN_LeftDown, "When active the player is turning left"); Cmd_AddCommand ("+movedown", IN_DownDown, "When active the player is "
Cmd_AddCommand ("-left", IN_LeftUp, "When active the player is not turning left"); "swimming down in a liquid");
Cmd_AddCommand ("+right", IN_RightDown, "When active the player is turning right"); Cmd_AddCommand ("-movedown", IN_DownUp, "When active the player is not "
Cmd_AddCommand ("-right", IN_RightUp, "When active the player is not turning right"); "swimming down in a liquid");
Cmd_AddCommand ("+forward", IN_ForwardDown, "When active the player is moving forward"); Cmd_AddCommand ("+left", IN_LeftDown, "When active the player is turning "
Cmd_AddCommand ("-forward", IN_ForwardUp, "When active the player is not moving forward"); "left");
Cmd_AddCommand ("+back", IN_BackDown, "When active the player is moving backwards"); Cmd_AddCommand ("-left", IN_LeftUp, "When active the player is not turning"
Cmd_AddCommand ("-back", IN_BackUp, "When active the player is not moving backwards"); " left");
Cmd_AddCommand ("+lookup", IN_LookupDown, "When active the player's view is looking up"); Cmd_AddCommand ("+right", IN_RightDown, "When active the player is "
Cmd_AddCommand ("-lookup", IN_LookupUp, "When active the player's view is not looking up"); "turning right");
Cmd_AddCommand ("+lookdown", IN_LookdownDown, "When active the player's view is looking down"); Cmd_AddCommand ("-right", IN_RightUp, "When active the player is not "
Cmd_AddCommand ("-lookdown", IN_LookdownUp, "When active the player's view is not looking up"); "turning right");
Cmd_AddCommand ("+strafe", IN_StrafeDown, "When active, +left and +right function like +moveleft and +moveright"); Cmd_AddCommand ("+forward", IN_ForwardDown, "When active the player is "
Cmd_AddCommand ("-strafe", IN_StrafeUp, "When active, +left and +right stop functioning like +moveleft and +moveright"); "moving forward");
Cmd_AddCommand ("+moveleft", IN_MoveleftDown, "When active the player is strafing left"); Cmd_AddCommand ("-forward", IN_ForwardUp, "When active the player is not "
Cmd_AddCommand ("-moveleft", IN_MoveleftUp, "When active the player is not strafing left"); "moving forward");
Cmd_AddCommand ("+moveright", IN_MoverightDown, "When active the player is strafing right"); Cmd_AddCommand ("+back", IN_BackDown, "When active the player is moving "
Cmd_AddCommand ("-moveright", IN_MoverightUp, "When active the player is not strafing right"); "backwards");
Cmd_AddCommand ("+speed", IN_SpeedDown, "When active the player is running"); Cmd_AddCommand ("-back", IN_BackUp, "When active the player is not "
Cmd_AddCommand ("-speed", IN_SpeedUp, "When active the player is not running"); "moving backwards");
Cmd_AddCommand ("+attack", IN_AttackDown, "When active player is firing/using current weapon"); Cmd_AddCommand ("+lookup", IN_LookupDown, "When active the player's view "
Cmd_AddCommand ("-attack", IN_AttackUp, "When active player is not firing/using current weapon"); "is looking up");
Cmd_AddCommand ("+use", IN_UseDown, "Non-functional. Left over command for opening doors and triggering switches"); Cmd_AddCommand ("-lookup", IN_LookupUp, "When active the player's view is "
Cmd_AddCommand ("-use", IN_UseUp, "Non-functional. Left over command for opening doors and triggering switches"); "not looking up");
Cmd_AddCommand ("+lookdown", IN_LookdownDown, "When active the player's "
"view is looking down");
Cmd_AddCommand ("-lookdown", IN_LookdownUp, "When active the player's "
"view is not looking up");
Cmd_AddCommand ("+strafe", IN_StrafeDown, "When active, +left and +right "
"function like +moveleft and +moveright");
Cmd_AddCommand ("-strafe", IN_StrafeUp, "When active, +left and +right "
"stop functioning like +moveleft and +moveright");
Cmd_AddCommand ("+moveleft", IN_MoveleftDown, "When active the player is "
"strafing left");
Cmd_AddCommand ("-moveleft", IN_MoveleftUp, "When active the player is "
"not strafing left");
Cmd_AddCommand ("+moveright", IN_MoverightDown, "When active the player "
"is strafing right");
Cmd_AddCommand ("-moveright", IN_MoverightUp, "When active the player is "
"not strafing right");
Cmd_AddCommand ("+speed", IN_SpeedDown, "When active the player is "
"running");
Cmd_AddCommand ("-speed", IN_SpeedUp, "When active the player is not "
"running");
Cmd_AddCommand ("+attack", IN_AttackDown, "When active player is "
"firing/using current weapon");
Cmd_AddCommand ("-attack", IN_AttackUp, "When active player is not "
"firing/using current weapon");
Cmd_AddCommand ("+use", IN_UseDown, "Non-functional. Left over command "
"for opening doors and triggering switches");
Cmd_AddCommand ("-use", IN_UseUp, "Non-functional. Left over command for "
"opening doors and triggering switches");
Cmd_AddCommand ("+jump", IN_JumpDown, "When active the player is jumping"); Cmd_AddCommand ("+jump", IN_JumpDown, "When active the player is jumping");
Cmd_AddCommand ("-jump", IN_JumpUp, "When active the player is not jumping"); Cmd_AddCommand ("-jump", IN_JumpUp, "When active the player is not "
Cmd_AddCommand ("impulse", IN_Impulse, "Call a game function or QuakeC function."); "jumping");
Cmd_AddCommand ("+klook", IN_KLookDown, "When active, +forward and +back perform +lookup and +lookdown"); Cmd_AddCommand ("impulse", IN_Impulse, "Call a game function or QuakeC "
Cmd_AddCommand ("-klook", IN_KLookUp, "When active, +forward and +back don't perform +lookup and +lookdown"); "function.");
Cmd_AddCommand ("+mlook", IN_MLookDown, "When active moving the mouse or joystick forwards and backwards performs +lookup and +lookdown"); Cmd_AddCommand ("+klook", IN_KLookDown, "When active, +forward and +back "
Cmd_AddCommand ("-mlook", IN_MLookUp, "When active moving the mouse or joystick forwards and backwards doesn't perform +lookup and +lookdown"); "perform +lookup and +lookdown");
Cmd_AddCommand ("-klook", IN_KLookUp, "When active, +forward and +back "
"don't perform +lookup and +lookdown");
Cmd_AddCommand ("+mlook", IN_MLookDown, "When active moving the mouse or "
"joystick forwards and backwards performs +lookup and "
"+lookdown");
Cmd_AddCommand ("-mlook", IN_MLookUp, "When active moving the mouse or "
"joystick forwards and backwards doesn't perform +lookup "
"and +lookdown");
} }
void void
CL_Input_Init_Cvars (void) CL_Input_Init_Cvars (void)
{ {
cl_nodelta = Cvar_Get ("cl_nodelta", "0", CVAR_NONE, NULL, cl_nodelta = Cvar_Get ("cl_nodelta", "0", CVAR_NONE, NULL,
"disable player delta compression. " "Disable player delta compression. Set to 1 if you "
"set to 1 if you have a poor ISP and get a lot of U_REMOVE warnings."); "have a poor ISP and get many U_REMOVE warnings.");
} }

View file

@ -1045,9 +1045,8 @@ CL_ReadPackets (void)
#ifdef PACKET_LOGGING #ifdef PACKET_LOGGING
if (cls.demoplayback) Log_Incoming_Packet(net_message->message->data,net_message->message->cursize); if (cls.demoplayback) Log_Incoming_Packet(net_message->message->data,net_message->message->cursize);
#endif #endif
//
// remote command packet // remote command packet
//
if (*(int *) net_message->message->data == -1) { if (*(int *) net_message->message->data == -1) {
CL_ConnectionlessPacket (); CL_ConnectionlessPacket ();
continue; continue;
@ -1061,9 +1060,8 @@ CL_ReadPackets (void)
Con_Printf ("%s: Runt packet\n", NET_AdrToString (net_from)); Con_Printf ("%s: Runt packet\n", NET_AdrToString (net_from));
continue; continue;
} }
//
// packet from server // packet from server
//
if (!cls.demoplayback && if (!cls.demoplayback &&
!NET_CompareAdr (net_from, cls.netchan.remote_address)) { !NET_CompareAdr (net_from, cls.netchan.remote_address)) {
Con_DPrintf ("%s:sequenced packet without connection\n", Con_DPrintf ("%s:sequenced packet without connection\n",
@ -1091,9 +1089,6 @@ CL_ReadPackets (void)
} }
//=============================================================================
void void
CL_Download_f (void) CL_Download_f (void)
{ {
@ -1154,78 +1149,72 @@ CL_Init (void)
SList_Init (); SList_Init ();
//
// register our commands // register our commands
//
Cmd_AddCommand ("version", CL_Version_f, "Report version information"); Cmd_AddCommand ("version", CL_Version_f, "Report version information");
Cmd_AddCommand ("changing", CL_Changing_f, "Used when maps are changing"); Cmd_AddCommand ("changing", CL_Changing_f, "Used when maps are changing");
Cmd_AddCommand ("disconnect", CL_Disconnect_f, "Disconnect from server"); Cmd_AddCommand ("disconnect", CL_Disconnect_f, "Disconnect from server");
Cmd_AddCommand ("record", CL_Record_f, "Record a demo 'record filename server'"); Cmd_AddCommand ("record", CL_Record_f, "Record a demo 'record filename "
Cmd_AddCommand ("rerecord", CL_ReRecord_f, "Rerecord a demo on the same server"); "server'");
Cmd_AddCommand ("rerecord", CL_ReRecord_f, "Rerecord a demo on the same "
"server");
Cmd_AddCommand ("stop", CL_Stop_f, "Stop recording a demo"); Cmd_AddCommand ("stop", CL_Stop_f, "Stop recording a demo");
Cmd_AddCommand ("playdemo", CL_PlayDemo_f, "Play a recorded demo"); Cmd_AddCommand ("playdemo", CL_PlayDemo_f, "Play a recorded demo");
Cmd_AddCommand ("timedemo", CL_TimeDemo_f, "Play a demo as fast as your hardware can. Useful for benchmarking."); Cmd_AddCommand ("timedemo", CL_TimeDemo_f, "Play a demo as fast as your "
"hardware can. Useful for benchmarking.");
Cmd_AddCommand ("maplist", COM_Maplist_f, "List maps available"); Cmd_AddCommand ("maplist", COM_Maplist_f, "List maps available");
Cmd_AddCommand ("quit", CL_Quit_f, "Exit the program"); Cmd_AddCommand ("quit", CL_Quit_f, "Exit the program");
Cmd_AddCommand ("connect", CL_Connect_f, "Connect to a server 'connect "
"hostname:port'");
Cmd_AddCommand ("reconnect", CL_Reconnect_f, "Reconnect to the last "
"server");
Cmd_AddCommand ("rcon", CL_Rcon_f, "Issue set of commands to the current "
"connected server or the one set in rcon_address");
Cmd_AddCommand ("packet", CL_Packet_f, "Send a packet with specified "
"contents to the destination");
Cmd_AddCommand ("user", CL_User_f, "Queries the user for his setinfo "
"information");
Cmd_AddCommand ("users", CL_Users_f, "Report information on connected "
"players and retrieve user ids");
Cmd_AddCommand ("setinfo", CL_SetInfo_f, "Sets information about your "
"QuakeWorld user.\n Used without a key it will list all "
"of your current settings.\n Specifying a non-existent "
"key and a value will create the new key.\n"
"Special Keys:\n b_switch - Determines the highest weapon "
"that Quake should switch to upon a backpack pickup.\n "
"w_switch - Determines the highest weapon that Quake "
"should switch to upon a weapon pickup.");
Cmd_AddCommand ("fullinfo", CL_FullInfo_f, "Used by QuakeSpy and Qlist to "
"set setinfo variables");
Cmd_AddCommand ("fullserverinfo", CL_FullServerinfo_f, "Used by QuakeSpy "
"and Qlist to obtain server variables");
Cmd_AddCommand ("download", CL_Download_f, "Manually download a quake "
"file from the server");
Cmd_AddCommand ("nextul", CL_NextUpload, "Tells the client to send the "
"next upload");
Cmd_AddCommand ("stopul", CL_StopUpload, "Tells the client to stop "
"uploading");
Cmd_AddCommand ("connect", CL_Connect_f, "Connect to a server 'connect hostname:port'");
Cmd_AddCommand ("reconnect", CL_Reconnect_f, "Reconnect to the last server");
Cmd_AddCommand ("rcon", CL_Rcon_f, "Issue the set of commands to the server you are currently connected to or have set in rcon_address");
Cmd_AddCommand ("packet", CL_Packet_f, "Send a packet with specified contents to the destination");
Cmd_AddCommand ("user", CL_User_f, "Queries the user for his setinfo information");
Cmd_AddCommand ("users", CL_Users_f, "Report information on connected players and retrieve user ids");
Cmd_AddCommand ("setinfo", CL_SetInfo_f, "Sets information about your QuakeWorld user.\n"
"Used without a key it will list all of your current settings.\n"
"Specifying a non-existent key and a value will create the new key.\n"
"Special Keys:\n"
"b_switch - Determines the highest weapon that Quake should switch to upon a backpack pickup.\n"
"w_switch - Determines the highest weapon that Quake should switch to upon a weapon pickup.");
Cmd_AddCommand ("fullinfo", CL_FullInfo_f, "Used by QuakeSpy and Qlist to set setinfo variables");
Cmd_AddCommand ("fullserverinfo", CL_FullServerinfo_f, "Used by QuakeSpy and Qlist to obtain server variables");
Cmd_AddCommand ("download", CL_Download_f, "Manually download a quake file from the server");
Cmd_AddCommand ("nextul", CL_NextUpload, "Tells the client to send the next upload");
Cmd_AddCommand ("stopul", CL_StopUpload, "Tells the client to stop uploading");
//
// forward to server commands // forward to server commands
//
Cmd_AddCommand ("kill", Cmd_ForwardToServer, "Suicide :)"); Cmd_AddCommand ("kill", Cmd_ForwardToServer, "Suicide :)");
Cmd_AddCommand ("pause", Cmd_ForwardToServer, "Pause the game"); Cmd_AddCommand ("pause", Cmd_ForwardToServer, "Pause the game");
Cmd_AddCommand ("say", Cmd_ForwardToServer, "Say something to all other players"); Cmd_AddCommand ("say", Cmd_ForwardToServer, "Say something to all other "
Cmd_AddCommand ("say_team", Cmd_ForwardToServer, "Say something only to people on your team"); "players");
Cmd_AddCommand ("serverinfo", Cmd_ForwardToServer, "Report the current server info"); Cmd_AddCommand ("say_team", Cmd_ForwardToServer, "Say something only to "
"people on your team");
Cmd_AddCommand ("serverinfo", Cmd_ForwardToServer, "Report the current "
"server info");
} }
void void
CL_Init_Cvars (void) CL_Init_Cvars (void)
{ {
// LordHavoc: some people like it asking on quit, others don't... confirm_quit = Cvar_Get ("confirm_quit", "1", CVAR_ARCHIVE, NULL,
confirm_quit = "confirm quit command");
Cvar_Get ("confirm_quit", "1", CVAR_ARCHIVE, NULL,
"confirm quit command");
cl_allow_cmd_pkt = Cvar_Get ("cl_allow_cmd_pkt", "1", CVAR_NONE, NULL, cl_allow_cmd_pkt = Cvar_Get ("cl_allow_cmd_pkt", "1", CVAR_NONE, NULL,
"enables packets from the likes of gamespy"); "enables packets from the likes of gamespy");
show_fps = Cvar_Get ("show_fps", "0", CVAR_NONE, NULL,
"display realtime frames per second");
// Misty: I like to be able to see the time when I play
show_time = Cvar_Get ("show_time", "0", CVAR_ARCHIVE, NULL,
"display the current time");
host_speeds = Cvar_Get ("host_speeds", "0", CVAR_NONE, NULL,
"display host processing times");
cl_demospeed = Cvar_Get ("cl_demospeed", "1.0", CVAR_NONE, NULL, cl_demospeed = Cvar_Get ("cl_demospeed", "1.0", CVAR_NONE, NULL,
"adjust demo playback speed. 1.0 = normal, < 1 slow-mo, > 1 timelaps"); "adjust demo playback speed. 1.0 = normal, < 1 slow-mo, > 1 timelaps");
// Misty: Turn on or off screen filling colors for powerups among other things.
cl_cshift_bonus = Cvar_Get ("cl_cshift_bonus", "1", CVAR_ARCHIVE, NULL, cl_cshift_bonus = Cvar_Get ("cl_cshift_bonus", "1", CVAR_ARCHIVE, NULL,
"Show bonus flash on item pickup"); "Show bonus flash on item pickup");
cl_cshift_contents = Cvar_Get ("cl_cshift_content", "1", CVAR_ARCHIVE, NULL, cl_cshift_contents = Cvar_Get ("cl_cshift_content", "1", CVAR_ARCHIVE, NULL,
@ -1274,24 +1263,24 @@ CL_Init_Cvars (void)
m_forward = Cvar_Get ("m_forward", "1", CVAR_NONE, NULL, m_forward = Cvar_Get ("m_forward", "1", CVAR_NONE, NULL,
"mouse forward/back speed"); "mouse forward/back speed");
m_side = Cvar_Get ("m_side", "0.8", CVAR_NONE, NULL, "mouse strafe speed"); m_side = Cvar_Get ("m_side", "0.8", CVAR_NONE, NULL, "mouse strafe speed");
rcon_password = Cvar_Get ("rcon_password", "", CVAR_NONE, NULL, rcon_password = Cvar_Get ("rcon_password", "", CVAR_NONE, NULL,
"remote control password"); "remote control password");
rcon_address = Cvar_Get ("rcon_address", "", CVAR_NONE, NULL, rcon_address = Cvar_Get ("rcon_address", "", CVAR_NONE, NULL, "server IP "
"server IP address when client not connected - for sending rcon commands"); "address when client not connected - for "
"sending rcon commands");
cl_writecfg = Cvar_Get ("cl_writecfg", "1", CVAR_NONE, NULL, cl_writecfg = Cvar_Get ("cl_writecfg", "1", CVAR_NONE, NULL,
"write config files?"); "write config files?");
cl_predict_players2 = Cvar_Get ("cl_predict_players2", "1", CVAR_NONE,
cl_predict_players2 = Cvar_Get ("cl_predict_players2", "1", CVAR_NONE, NULL, NULL, "If this and cl_predict_players are "
"If this and cl_predict_players is 0, no player prediction is done"); "0, no player prediction is done");
cl_predict_players = Cvar_Get ("cl_predict_players", "1", CVAR_NONE, NULL, cl_predict_players = Cvar_Get ("cl_predict_players", "1", CVAR_NONE, NULL,
"If this and cl_predict_players2 is 0, no player prediction is done"); "If this and cl_predict_players2 is 0, no "
"player prediction is done");
cl_solid_players = Cvar_Get ("cl_solid_players", "1", CVAR_NONE, NULL, cl_solid_players = Cvar_Get ("cl_solid_players", "1", CVAR_NONE, NULL,
"Are players solid? If off, you can walk through them with difficulty"); "Are players solid? If off, you can walk "
"through them with difficulty");
localid = Cvar_Get ("localid", "", CVAR_NONE, NULL, localid = Cvar_Get ("localid", "", CVAR_NONE, NULL, "FIXME: This has "
"FIXME: This has something to do with client authentication. No Description"); "something to do with client authentication.");
// //
// info mirrors // info mirrors
@ -1398,9 +1387,6 @@ Host_WriteConfiguration (void)
} }
//============================================================================
/* /*
Host_SimulationTime Host_SimulationTime
@ -1523,9 +1509,6 @@ Host_Frame (float time)
} }
//============================================================================
static int static int
check_quakerc (void) check_quakerc (void)
{ {

View file

@ -36,12 +36,14 @@
#include "QF/compat.h" #include "QF/compat.h"
#include "QF/sys.h" #include "QF/sys.h"
qboolean qboolean
ServerPaused (void) ServerPaused (void)
{ {
return false; return false;
} }
void void
SV_Error (char *error, ...) SV_Error (char *error, ...)
{ {

View file

@ -45,23 +45,21 @@ cvar_t *cl_nostatpred;
extern frame_t *view_frame; extern frame_t *view_frame;
/*
CL_PredictUsercmd
*/
void void
CL_PredictUsercmd (player_state_t * from, player_state_t * to, usercmd_t *u, CL_PredictUsercmd (player_state_t * from, player_state_t * to, usercmd_t *u,
qboolean spectator) qboolean spectator)
{ {
// Dabb: if there is no movement to start with, don't predict... // Dabb: if there is no movement to start with, don't predict...
if(cl_nostatpred->int_val && !from->velocity[0] if(cl_nostatpred->int_val && !from->velocity[0]
&& !from->velocity[1] && !from->velocity[1]
&& !from->velocity[2]) { && !from->velocity[2]) {
VectorCopy (from->origin, to->origin); VectorCopy (from->origin, to->origin);
VectorCopy (u->angles, to->viewangles); VectorCopy (u->angles, to->viewangles);
VectorCopy (from->velocity, to->velocity); VectorCopy (from->velocity, to->velocity);
return; return;
} }
// split up very long moves // split up very long moves
if (u->msec > 50) { if (u->msec > 50) {
@ -77,7 +75,7 @@ CL_PredictUsercmd (player_state_t * from, player_state_t * to, usercmd_t *u,
} }
VectorCopy (from->origin, pmove.origin); VectorCopy (from->origin, pmove.origin);
// VectorCopy (from->viewangles, pmove.angles); // VectorCopy (from->viewangles, pmove.angles);
VectorCopy (u->angles, pmove.angles); VectorCopy (u->angles, pmove.angles);
VectorCopy (from->velocity, pmove.velocity); VectorCopy (from->velocity, pmove.velocity);
@ -90,24 +88,19 @@ CL_PredictUsercmd (player_state_t * from, player_state_t * to, usercmd_t *u,
pmove.cmd = *u; pmove.cmd = *u;
PlayerMove (); PlayerMove ();
//for (i=0 ; i<3 ; i++) // for (i=0 ; i<3 ; i++)
//pmove.origin[i] = ((int)(pmove.origin[i]*8))*0.125; // pmove.origin[i] = ((int)(pmove.origin[i]*8))*0.125;
to->waterjumptime = pmove.waterjumptime; to->waterjumptime = pmove.waterjumptime;
to->oldbuttons = pmove.oldbuttons; // Tonik to->oldbuttons = pmove.oldbuttons; // Tonik
// to->oldbuttons = pmove.cmd.buttons; // to->oldbuttons = pmove.cmd.buttons;
VectorCopy (pmove.origin, to->origin); VectorCopy (pmove.origin, to->origin);
VectorCopy (pmove.angles, to->viewangles); VectorCopy (pmove.angles, to->viewangles);
VectorCopy (pmove.velocity, to->velocity); VectorCopy (pmove.velocity, to->velocity);
to->onground = onground; to->onground = onground;
to->weaponframe = from->weaponframe; to->weaponframe = from->weaponframe;
} }
/*
CL_PredictMove
*/
void void
CL_PredictMove (void) CL_PredictMove (void)
{ {
@ -158,19 +151,19 @@ CL_PredictMove (void)
// Dabb: if there is no movement to start with, don't predict... // Dabb: if there is no movement to start with, don't predict...
if(cl_nostatpred->int_val && !from->playerstate[cl.playernum].velocity[0] if(cl_nostatpred->int_val && !from->playerstate[cl.playernum].velocity[0]
&& !from->playerstate[cl.playernum].velocity[1] && !from->playerstate[cl.playernum].velocity[1]
&& !from->playerstate[cl.playernum].velocity[2]) { && !from->playerstate[cl.playernum].velocity[2]) {
VectorCopy (from->playerstate[cl.playernum].velocity, cl.simvel); VectorCopy (from->playerstate[cl.playernum].velocity, cl.simvel);
VectorCopy (from->playerstate[cl.playernum].origin, cl.simorg); VectorCopy (from->playerstate[cl.playernum].origin, cl.simorg);
return; return;
} }
// predict forward until cl.time <= to->senttime // predict forward until cl.time <= to->senttime
oldphysent = pmove.numphysent; oldphysent = pmove.numphysent;
CL_SetSolidPlayers (cl.playernum); CL_SetSolidPlayers (cl.playernum);
// to = &cl.frames[cls.netchan.incoming_sequence & UPDATE_MASK]; // to = &cl.frames[cls.netchan.incoming_sequence & UPDATE_MASK];
for (i = 1; i < UPDATE_BACKUP - 1 && cls.netchan.incoming_sequence + i < for (i = 1; i < UPDATE_BACKUP - 1 && cls.netchan.incoming_sequence + i <
cls.netchan.outgoing_sequence; i++) { cls.netchan.outgoing_sequence; i++) {
@ -205,9 +198,8 @@ CL_PredictMove (void)
for (i = 0; i < 3; i++) for (i = 0; i < 3; i++)
if (fabs if (fabs
(from->playerstate[cl.playernum].origin[i] - (from->playerstate[cl.playernum].origin[i] -
to->playerstate[cl.playernum].origin[i]) > 128) { // teleported, to->playerstate[cl.playernum].origin[i]) > 128) {
// so don't // teleported, so don't lerp
// lerp
VectorCopy (to->playerstate[cl.playernum].velocity, cl.simvel); VectorCopy (to->playerstate[cl.playernum].velocity, cl.simvel);
VectorCopy (to->playerstate[cl.playernum].origin, cl.simorg); VectorCopy (to->playerstate[cl.playernum].origin, cl.simorg);
return; return;
@ -224,18 +216,13 @@ CL_PredictMove (void)
} }
/*
CL_Prediction_Init_Cvars
*/
void void
CL_Prediction_Init_Cvars (void) CL_Prediction_Init_Cvars (void)
{ {
/* I'm not totally sure what cl_pushlatency is for. Or if it is SUPPOSED TO BE SETTABLE. */
cl_pushlatency = Cvar_Get ("pushlatency", "-999", CVAR_NONE, NULL, cl_pushlatency = Cvar_Get ("pushlatency", "-999", CVAR_NONE, NULL,
"How much prediction should the client make"); "How much prediction should the client make");
cl_nopred = Cvar_Get ("cl_nopred", "0", CVAR_NONE, NULL, cl_nopred = Cvar_Get ("cl_nopred", "0", CVAR_NONE, NULL,
"Set to turn off client prediction"); "Set to turn off client prediction");
cl_nostatpred = Cvar_Get ("cl_nostatpred", "0", CVAR_NONE, NULL, cl_nostatpred = Cvar_Get ("cl_nostatpred", "0", CVAR_NONE, NULL,
"Set to turn off static player prediction"); "Set to turn off static player prediction");
} }

View file

@ -55,9 +55,7 @@ cvar_t *bottomcolor;
char allskins[128]; char allskins[128];
/*
Skin_NextDownload
*/
void void
Skin_NextDownload (void) Skin_NextDownload (void)
{ {
@ -128,6 +126,7 @@ CL_AllSkins_f (void)
CL_Skins_f (); CL_Skins_f ();
} }
void void
CL_Color_f (void) CL_Color_f (void)
{ {
@ -163,15 +162,21 @@ CL_Color_f (void)
Cvar_Set (bottomcolor, num); Cvar_Set (bottomcolor, num);
} }
void void
CL_Skin_Init (void) CL_Skin_Init (void)
{ {
Skin_Init (); Skin_Init ();
Cmd_AddCommand ("skins", CL_Skins_f, "Download all skins that are currently in use"); Cmd_AddCommand ("skins", CL_Skins_f, "Download all skins that are "
Cmd_AddCommand ("allskins", CL_AllSkins_f, "Force all player skins to one skin"); "currently in use");
Cmd_AddCommand ("color", CL_Color_f, "The pant and shirt color (color shirt pants) Note that if only shirt color is given, pants will match"); Cmd_AddCommand ("allskins", CL_AllSkins_f, "Force all player skins to "
"one skin");
Cmd_AddCommand ("color", CL_Color_f, "The pant and shirt color (color "
"shirt pants) Note that if only shirt color is given, "
"pants will match");
} }
void void
CL_Skin_Init_Cvars (void) CL_Skin_Init_Cvars (void)
{ {
@ -179,16 +184,14 @@ CL_Skin_Init_Cvars (void)
noskins = Cvar_Get ("noskins", "0", CVAR_NONE, NULL, //XXX FIXME noskins = Cvar_Get ("noskins", "0", CVAR_NONE, NULL, //XXX FIXME
"set to 1 to not download new skins"); "set to 1 to not download new skins");
skin = Cvar_Get ("skin", "", CVAR_ARCHIVE | CVAR_USERINFO, Cvar_Info, skin = Cvar_Get ("skin", "", CVAR_ARCHIVE | CVAR_USERINFO, Cvar_Info,
"Players skin"); "Players skin");
topcolor = Cvar_Get ("topcolor", "0", CVAR_ARCHIVE | CVAR_USERINFO, topcolor = Cvar_Get ("topcolor", "0", CVAR_ARCHIVE | CVAR_USERINFO,
Cvar_Info, "Players color on top"); Cvar_Info, "Players color on top");
bottomcolor = Cvar_Get ("bottomcolor", "0", CVAR_ARCHIVE | CVAR_USERINFO, bottomcolor = Cvar_Get ("bottomcolor", "0", CVAR_ARCHIVE | CVAR_USERINFO,
Cvar_Info, "Players color on bottom"); Cvar_Info, "Players color on bottom");
} }
/*
CL_NewTranslation
*/
void void
CL_NewTranslation (int slot) CL_NewTranslation (int slot)
{ {

View file

@ -75,6 +75,7 @@ qboolean Minimized = false;
void MaskExceptions (void); void MaskExceptions (void);
#endif #endif
void void
Sys_DebugLog (char *file, char *fmt, ...) Sys_DebugLog (char *file, char *fmt, ...)
{ {
@ -90,13 +91,12 @@ Sys_DebugLog (char *file, char *fmt, ...)
close (fd); close (fd);
}; };
/* /*
SYSTEM IO SYSTEM IO
*/ */
/*
Sys_MakeCodeWriteable
*/
void void
Sys_MakeCodeWriteable (unsigned long startaddr, unsigned long length) Sys_MakeCodeWriteable (unsigned long startaddr, unsigned long length)
{ {
@ -126,17 +126,12 @@ Sys_MakeCodeWriteable (unsigned long startaddr, unsigned long length)
} }
/*
Sys_Init
*/
void void
Sys_Init (void) Sys_Init (void)
{ {
#ifdef WIN32 #ifdef WIN32
OSVERSIONINFO vinfo; OSVERSIONINFO vinfo;
#endif #endif
#ifdef USE_INTEL_ASM #ifdef USE_INTEL_ASM
#ifdef _WIN32 #ifdef _WIN32
MaskExceptions (); MaskExceptions ();
@ -185,6 +180,7 @@ Sys_Error (char *error, ...)
exit (1); exit (1);
} }
void void
Sys_Quit (void) Sys_Quit (void)
{ {
@ -192,12 +188,14 @@ Sys_Quit (void)
exit (0); exit (0);
} }
char *
char *
Sys_ConsoleInput (void) Sys_ConsoleInput (void)
{ {
return NULL; return NULL;
} }
void void
Sys_Sleep (void) Sys_Sleep (void)
{ {
@ -208,20 +206,18 @@ void
Sys_Init_Cvars (void) Sys_Init_Cvars (void)
{ {
sys_nostdout = Cvar_Get ("sys_nostdout", "0", CVAR_NONE, NULL, sys_nostdout = Cvar_Get ("sys_nostdout", "0", CVAR_NONE, NULL,
"Set to disable std out"); "Set to disable std out");
if (COM_CheckParm ("-nostdout")) if (COM_CheckParm ("-nostdout"))
Cvar_Set (sys_nostdout, "1"); Cvar_Set (sys_nostdout, "1");
} }
C_LINKAGE int C_LINKAGE int
SDL_main (int c, char **v) SDL_main (int c, char **v)
{ {
double time, oldtime, newtime; double time, oldtime, newtime;
int j; int j, t;
static char cwd[1024]; static char cwd[1024];
int t;
#ifndef WIN32 #ifndef WIN32
signal (SIGFPE, SIG_IGN); signal (SIGFPE, SIG_IGN);
@ -261,5 +257,4 @@ SDL_main (int c, char **v)
Host_Frame (time); Host_Frame (time);
oldtime = newtime; oldtime = newtime;
} }
} }

View file

@ -57,9 +57,8 @@ char *svs_info;
void Net_LogStop (void); void Net_LogStop (void);
#endif #endif
// ======================================================================= // General routines ======================================================
// General routines
// =======================================================================
void void
Sys_Quit (void) Sys_Quit (void)
@ -74,6 +73,7 @@ Sys_Quit (void)
exit (0); exit (0);
} }
void void
Sys_Init_Cvars (void) Sys_Init_Cvars (void)
{ {
@ -83,6 +83,7 @@ Sys_Init_Cvars (void)
Cvar_Set (sys_nostdout, "1"); Cvar_Set (sys_nostdout, "1");
} }
void void
Sys_Init (void) Sys_Init (void)
{ {
@ -91,6 +92,7 @@ Sys_Init (void)
#endif #endif
} }
void void
Sys_Error (const char *error, ...) Sys_Error (const char *error, ...)
{ {
@ -110,6 +112,7 @@ Sys_Error (const char *error, ...)
} }
void void
Sys_Warn (char *warning, ...) Sys_Warn (char *warning, ...)
{ {
@ -122,6 +125,7 @@ Sys_Warn (char *warning, ...)
fprintf (stderr, "Warning: %s", string); fprintf (stderr, "Warning: %s", string);
} }
void void
Sys_DebugLog (char *file, char *fmt, ...) Sys_DebugLog (char *file, char *fmt, ...)
{ {
@ -138,6 +142,7 @@ Sys_DebugLog (char *file, char *fmt, ...)
close (fd); close (fd);
} }
void void
floating_point_exception_handler (int whatever) floating_point_exception_handler (int whatever)
{ {
@ -145,7 +150,8 @@ floating_point_exception_handler (int whatever)
signal (SIGFPE, floating_point_exception_handler); signal (SIGFPE, floating_point_exception_handler);
} }
char *
char *
Sys_ConsoleInput (void) Sys_ConsoleInput (void)
{ {
#if 0 #if 0
@ -164,29 +170,33 @@ Sys_ConsoleInput (void)
return NULL; return NULL;
} }
#ifndef USE_INTEL_ASM #ifndef USE_INTEL_ASM
void void
Sys_HighFPPrecision (void) Sys_HighFPPrecision (void)
{ {
} }
void void
Sys_LowFPPrecision (void) Sys_LowFPPrecision (void)
{ {
} }
#endif #endif
int skipframes; int skipframes;
int int
main (int c, char **v) main (int c, char **v)
{ {
double time, oldtime, newtime; double time, oldtime, newtime;
int j; int j;
// static char cwd[1024]; // static char cwd[1024];
// signal(SIGFPE, floating_point_exception_handler); // signal(SIGFPE, floating_point_exception_handler);
signal (SIGFPE, SIG_IGN); signal (SIGFPE, SIG_IGN);
memset (&host_parms, 0, sizeof (host_parms)); memset (&host_parms, 0, sizeof (host_parms));
@ -224,9 +234,6 @@ main (int c, char **v)
} }
/*
Sys_MakeCodeWriteable
*/
void void
Sys_MakeCodeWriteable (unsigned long startaddr, unsigned long length) Sys_MakeCodeWriteable (unsigned long startaddr, unsigned long length)
{ {

View file

@ -79,6 +79,7 @@ void MaskExceptions (void);
void Sys_PopFPCW (void); void Sys_PopFPCW (void);
void Sys_PushFPCW_SetHigh (void); void Sys_PushFPCW_SetHigh (void);
void void
Sys_DebugLog (char *file, char *fmt, ...) Sys_DebugLog (char *file, char *fmt, ...)
{ {
@ -94,13 +95,12 @@ Sys_DebugLog (char *file, char *fmt, ...)
close (fd); close (fd);
}; };
/* /*
FILE IO FILE IO
*/ */
/*
wfilelength
*/
int int
wfilelength (QFile *f) wfilelength (QFile *f)
{ {
@ -120,9 +120,7 @@ wfilelength (QFile *f)
SYSTEM IO SYSTEM IO
*/ */
/*
Sys_MakeCodeWriteable
*/
void void
Sys_MakeCodeWriteable (unsigned long startaddr, unsigned long length) Sys_MakeCodeWriteable (unsigned long startaddr, unsigned long length)
{ {
@ -139,13 +137,15 @@ Sys_MakeCodeWriteable (unsigned long startaddr, unsigned long length)
Sys_Init Sys_Init
*/ */
void void
Sys_Init_Cvars (void) Sys_Init_Cvars (void)
{ {
sys_nostdout = Cvar_Get ("sys_nostdout", "1", CVAR_NONE, NULL, sys_nostdout = Cvar_Get ("sys_nostdout", "1", CVAR_NONE, NULL,
"unset to enable std out - windows does NOT support this"); "unset to enable std out - windows does NOT support this");
} }
void void
Sys_Init (void) Sys_Init (void)
{ {
@ -215,6 +215,7 @@ Sys_Error (const char *error, ...)
exit (1); exit (1);
} }
void void
Sys_Quit (void) Sys_Quit (void)
{ {
@ -236,8 +237,7 @@ Sys_Quit (void)
} }
char *
char *
Sys_ConsoleInput (void) Sys_ConsoleInput (void)
{ {
static char text[256]; static char text[256];
@ -342,10 +342,10 @@ Sys_ConsoleInput (void)
} }
} }
} }
return NULL; return NULL;
} }
void void
Sys_Sleep (void) Sys_Sleep (void)
{ {
@ -356,9 +356,7 @@ Sys_Sleep (void)
WINDOWS CRAP WINDOWS CRAP
*/ */
/*
WinMain
*/
void void
SleepUntilInput (int time) SleepUntilInput (int time)
{ {
@ -367,10 +365,6 @@ SleepUntilInput (int time)
} }
/*
WinMain
*/
HINSTANCE global_hInstance; HINSTANCE global_hInstance;
int global_nCmdShow; int global_nCmdShow;
char *argv[MAX_NUM_ARGVS]; char *argv[MAX_NUM_ARGVS];
@ -381,7 +375,7 @@ int WINAPI
WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine,
int nCmdShow) int nCmdShow)
{ {
// MSG msg; // MSG msg;
double time, oldtime, newtime; double time, oldtime, newtime;
MEMORYSTATUS lpBuffer; MEMORYSTATUS lpBuffer;
static char cwd[1024]; static char cwd[1024];
@ -424,7 +418,6 @@ WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine,
*lpCmdLine = 0; *lpCmdLine = 0;
lpCmdLine++; lpCmdLine++;
} }
} }
} }
@ -485,7 +478,7 @@ WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine,
if (!tevent) if (!tevent)
Sys_Error ("Couldn't create event"); Sys_Error ("Couldn't create event");
// because sound is off until we become active // because sound is off until we become active
S_BlockSound (); S_BlockSound ();
Sys_Printf ("Host_Init\n"); Sys_Printf ("Host_Init\n");

View file

@ -345,7 +345,7 @@ CL_ParseTEnt (void)
} }
entity_t ** entity_t **
CL_NewTempEntity (void) CL_NewTempEntity (void)
{ {