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
@description@
camera support
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");
}
void
Chase_Reset (void)
{
// for respawning and teleporting
// start position 12 units behind head
// start position 12 units behind head
}
void
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);
}
void
Chase_Update (void)
{

View file

@ -50,8 +50,6 @@
void CL_FinishTimeDemo (void);
/*
==============================================================================
DEMO CODE
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
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
CL_StopPlayback (void)
@ -84,12 +80,11 @@ CL_StopPlayback (void)
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
CL_WriteDemoMessage (void)
@ -109,12 +104,11 @@ CL_WriteDemoMessage (void)
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
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
CL_Stop_f (void)
@ -211,12 +203,11 @@ CL_Stop_f (void)
Con_Printf ("Completed demo\n");
}
/*
====================
CL_Record_f
record <demoname> <map> [cd track]
====================
/*
CL_Record_f
record <demoname> <map> [cd track]
*/
void
CL_Record_f (void)
@ -253,13 +244,11 @@ CL_Record_f (void)
snprintf (name, sizeof (name), "%s/%s", com_gamedir, Cmd_Argv (1));
//
// start the map up
//
if (c > 2)
Cmd_ExecuteString (va ("map %s", Cmd_Argv (2)), src_command);
//
// open the demo file
//
COM_DefaultExtension (name, ".dem");
@ -279,11 +268,9 @@ CL_Record_f (void)
/*
====================
CL_PlayDemo_f
CL_PlayDemo_f
play [demoname]
====================
play [demoname]
*/
void
CL_PlayDemo_f (void)
@ -299,12 +286,11 @@ CL_PlayDemo_f (void)
Con_Printf ("play <demoname> : plays a demo\n");
return;
}
//
// disconnect from server
//
CL_Disconnect ();
//
// open the demo file
//
strcpy (name, Cmd_Argv (1));
@ -343,7 +329,7 @@ CL_FinishTimeDemo (void)
cls.timedemo = false;
// the first frame didn't count
// the first frame didn't count
frames = (host_framecount - cls.td_startframe) - 1;
time = realtime - cls.td_starttime;
if (!time)
@ -352,12 +338,11 @@ CL_FinishTimeDemo (void)
frames / time);
}
/*
====================
CL_TimeDemo_f
timedemo [demoname]
====================
/*
CL_TimeDemo_f
timedemo [demoname]
*/
void
CL_TimeDemo_f (void)
@ -372,8 +357,8 @@ CL_TimeDemo_f (void)
CL_PlayDemo_f ();
// cls.td_starttime will be grabbed at the second frame of the demo, so
// all the loading time doesn't get counted
// cls.td_starttime will be grabbed at the second frame of the demo, so
// all the loading time doesn't get counted
cls.timedemo = true;
cls.td_startframe = host_framecount;

View file

@ -47,8 +47,6 @@
#include "host.h"
/*
===============================================================================
KEY BUTTONS
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 1 is edge triggered on the up to down 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
}
void
IN_KLookDown (void)
{
KeyDown (&in_klook);
}
void
IN_KLookUp (void)
{
KeyUp (&in_klook);
}
void
IN_MLookDown (void)
{
KeyDown (&in_mlook);
}
void
IN_MLookUp (void)
{
@ -170,42 +170,49 @@ IN_MLookUp (void)
V_StartPitchDrift ();
}
void
IN_UpDown (void)
{
KeyDown (&in_up);
}
void
IN_UpUp (void)
{
KeyUp (&in_up);
}
void
IN_DownDown (void)
{
KeyDown (&in_down);
}
void
IN_DownUp (void)
{
KeyUp (&in_down);
}
void
IN_LeftDown (void)
{
KeyDown (&in_left);
}
void
IN_LeftUp (void)
{
KeyUp (&in_left);
}
void
IN_RightDown (void)
{
@ -218,138 +225,161 @@ IN_RightUp (void)
KeyUp (&in_right);
}
void
IN_ForwardDown (void)
{
KeyDown (&in_forward);
}
void
IN_ForwardUp (void)
{
KeyUp (&in_forward);
}
void
IN_BackDown (void)
{
KeyDown (&in_back);
}
void
IN_BackUp (void)
{
KeyUp (&in_back);
}
void
IN_LookupDown (void)
{
KeyDown (&in_lookup);
}
void
IN_LookupUp (void)
{
KeyUp (&in_lookup);
}
void
IN_LookdownDown (void)
{
KeyDown (&in_lookdown);
}
void
IN_LookdownUp (void)
{
KeyUp (&in_lookdown);
}
void
IN_MoveleftDown (void)
{
KeyDown (&in_moveleft);
}
void
IN_MoveleftUp (void)
{
KeyUp (&in_moveleft);
}
void
IN_MoverightDown (void)
{
KeyDown (&in_moveright);
}
void
IN_MoverightUp (void)
{
KeyUp (&in_moveright);
}
void
IN_SpeedDown (void)
{
KeyDown (&in_speed);
}
void
IN_SpeedUp (void)
{
KeyUp (&in_speed);
}
void
IN_StrafeDown (void)
{
KeyDown (&in_strafe);
}
void
IN_StrafeUp (void)
{
KeyUp (&in_strafe);
}
void
IN_AttackDown (void)
{
KeyDown (&in_attack);
}
void
IN_AttackUp (void)
{
KeyUp (&in_attack);
}
void
IN_UseDown (void)
{
KeyDown (&in_use);
}
void
IN_UseUp (void)
{
KeyUp (&in_use);
}
void
IN_JumpDown (void)
{
KeyDown (&in_jump);
}
void
IN_JumpUp (void)
{
KeyUp (&in_jump);
}
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,
0.5 if it was pressed and held
0 if held then released, and
1.0 if held for the entire time
===============
Returns 0.25 if a key was pressed and released during the frame,
0.5 if it was pressed and held
0 if held then released, and
1.0 if held for the entire time
*/
float
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_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
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
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_backspeed->value * CL_KeyState (&in_back);
}
//
// adjust for speed key
//
if (in_speed.state & 1) {
@ -544,11 +563,6 @@ CL_BaseMove (usercmd_t *cmd)
}
/*
==============
CL_SendMove
==============
*/
void
CL_SendMove (usercmd_t *cmd)
{
@ -563,7 +577,6 @@ CL_SendMove (usercmd_t *cmd)
cl.cmd = *cmd;
//
// send the movement message
//
MSG_WriteByte (&buf, clc_move);
@ -577,7 +590,6 @@ CL_SendMove (usercmd_t *cmd)
MSG_WriteShort (&buf, cmd->sidemove);
MSG_WriteShort (&buf, cmd->upmove);
//
// send button bits
//
bits = 0;
@ -596,22 +608,18 @@ CL_SendMove (usercmd_t *cmd)
in_impulse = 0;
#ifdef QUAKE2
//
// light level
//
MSG_WriteByte (&buf, cmd->lightlevel);
#endif
//
// deliver the message
//
if (cls.demoplayback)
return;
//
// always dump the first two message, because it may contain leftover inputs
// from the last level
//
if (++cl.movemessages <= 2)
return;

View file

@ -97,18 +97,11 @@ entity_t *cl_visedicts[MAX_VISEDICTS];
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,
"Show bonus flash on item pickup");
cl_cshift_contents = Cvar_Get ("cl_cshift_content", "1", CVAR_ARCHIVE, NULL,
"Shift view colors for contents (water, slime, etc)");
cl_cshift_contents = Cvar_Get ("cl_cshift_content", "1", CVAR_ARCHIVE,
NULL, "Shift view colors for contents "
"(water, slime, etc)");
cl_cshift_damage = Cvar_Get ("cl_cshift_damage", "1", CVAR_ARCHIVE, NULL,
"Shift view colors on damage");
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");
cl_color = Cvar_Get ("_cl_color", "0", CVAR_ARCHIVE, NULL,
"Player color");
cl_upspeed = Cvar_Get ("cl_upspeed", "200", CVAR_NONE, NULL,
"swim/fly up/down speed");
cl_forwardspeed = Cvar_Get ("cl_forwardspeed", "200", CVAR_ARCHIVE, NULL,
"forward speed");
cl_anglespeedkey = Cvar_Get ("cl_anglespeedkey", "1.5", CVAR_NONE, NULL,
"turn `run' speed multiplier");
cl_backspeed = Cvar_Get ("cl_backspeed", "200", CVAR_ARCHIVE, NULL,
"backward speed");
cl_sidespeed = Cvar_Get ("cl_sidespeed", "350", CVAR_NONE, NULL,
"strafe speed");
cl_forwardspeed = Cvar_Get ("cl_forwardspeed", "200", CVAR_ARCHIVE, NULL,
"forward speed");
cl_movespeedkey = Cvar_Get ("cl_movespeedkey", "2.0", CVAR_NONE, NULL,
"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,
"look up/down speed");
cl_anglespeedkey = Cvar_Get ("cl_anglespeedkey", "1.5", CVAR_NONE,
NULL, "turn `run' speed multiplier");
cl_sidespeed = Cvar_Get ("cl_sidespeed", "350", CVAR_NONE, NULL,
"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,
"show network packets. 0=off, 1=basic, 2=verbose");
cl_nolerp = Cvar_Get ("cl_nolerp", "0", CVAR_NONE, NULL,
@ -142,9 +135,8 @@ CL_InitCvars (void)
"status bar mode");
cl_hudswap = Cvar_Get ("cl_hudswap", "0", CVAR_ARCHIVE, NULL,
"new HUD on left side?");
lookspring =
Cvar_Get ("lookspring", "0", CVAR_ARCHIVE, NULL,
"Snap view to center when moving and no mlook/klook");
lookspring = Cvar_Get ("lookspring", "0", CVAR_ARCHIVE, NULL, "Snap view "
"to center when moving and no mlook/klook");
m_pitch = Cvar_Get ("m_pitch", "0.022", CVAR_ARCHIVE, NULL,
"mouse pitch (up/down) multipier");
m_yaw = Cvar_Get ("m_yaw", "0.022", CVAR_ARCHIVE, NULL,
@ -153,6 +145,12 @@ CL_InitCvars (void)
"mouse forward/back speed");
m_side = Cvar_Get ("m_side", "0.8", CVAR_ARCHIVE, NULL,
"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"
};
//=============================================================================
/*
===============
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 *
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
so the server doesn't disconnect.
==================
When the client is taking a long time to load stuff, send keepalive
messages so the server doesn't disconnect.
*/
void
CL_KeepaliveMessage (void)
@ -239,12 +233,12 @@ CL_ParseServerInfo (void)
char sound_precache[MAX_SOUNDS][MAX_QPATH];
Con_DPrintf ("Serverinfo packet received.\n");
//
// wipe the client_state_t struct
//
CL_ClearState ();
// parse protocol version number
// parse protocol version number
i = MSG_ReadLong (net_message);
if (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");
Con_Printf ("%c%s\n", 2, str);
//
// 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
// needlessly purge it
//
// precache models
memset (cl.model_precache, 0, sizeof (cl.model_precache));
@ -304,9 +296,7 @@ CL_ParseServerInfo (void)
S_TouchSound (str);
}
//
// now we try to load everything else until a cache allocation fails
//
for (i = 1; i < nummodels; i++) {
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];
/*
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
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
CL_ParseClientdata (int bits)
@ -696,7 +683,6 @@ CL_ParseServerMessage (void)
int cmd;
int i;
//
// if recording demos, copy the message out
//
if (cl_shownet->int_val == 1)
@ -705,7 +691,7 @@ CL_ParseServerMessage (void)
Con_Printf ("------------------\n");
cl.onground = false; // unless the server says otherwise
//
// parse the 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 autocam = CAM_NONE;
static void
vectoangles (vec3_t vec, vec3_t ang)
{
@ -105,12 +106,14 @@ vectoangles (vec3_t vec, vec3_t ang)
ang[2] = 0;
}
static float
vlen (vec3_t v)
{
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
qboolean
Cam_DrawViewModel (void)
@ -123,6 +126,7 @@ Cam_DrawViewModel (void)
return false;
}
// returns true if we should draw this player, we don't if we are chase camming
qboolean
Cam_DrawPlayer (int playernum)
@ -133,6 +137,7 @@ Cam_DrawPlayer (int playernum)
return true;
}
void
Cam_Unlock (void)
{
@ -145,6 +150,7 @@ Cam_Unlock (void)
}
}
void
Cam_Lock (int playernum)
{
@ -159,6 +165,7 @@ Cam_Lock (int playernum)
Sbar_Changed ();
}
pmtrace_t
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);
}
// Returns distance or 9999 if invalid for some reason
static float
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;
}
// Is player visible?
static qboolean
Cam_IsVisible (player_state_t * player, vec3_t vec)
@ -228,6 +237,7 @@ Cam_IsVisible (player_state_t * player, vec3_t vec)
return true;
}
static qboolean
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;
}
static void
Cam_CheckHighTarget (void)
{
@ -339,6 +350,7 @@ Cam_CheckHighTarget (void)
Cam_Unlock ();
}
// ZOID
//
// Take over the user controls and track a player.
@ -425,6 +437,7 @@ Cam_Track (usercmd_t *cmd)
}
}
#if 0
static float
adjustang (float current, float ideal, float speed)
@ -458,6 +471,7 @@ adjustang (float current, float ideal, float speed)
}
#endif
#if 0
void
Cam_SetView (void)
@ -494,6 +508,7 @@ Cam_SetView (void)
}
#endif
void
Cam_FinishMove (usercmd_t *cmd)
{
@ -593,6 +608,7 @@ Cam_FinishMove (usercmd_t *cmd)
autocam = locked = false;
}
void
Cam_Reset (void)
{
@ -600,13 +616,18 @@ Cam_Reset (void)
spec_track = 0;
}
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_chasecam = Cvar_Get ("cl_chasecam", "0", CVAR_NONE, NULL, "get first 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");
cl_hightrack = Cvar_Get ("cl_hightrack", "0", CVAR_NONE, NULL, "view the "
"player who has the most frags while you are in "
"spectator mode.");
cl_chasecam = Cvar_Get ("cl_chasecam", "0", CVAR_NONE, NULL, "get first "
"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/teamplay.h"
/*
Cmd_ForwardToServer
@ -86,6 +87,7 @@ Cmd_ForwardToServer (void)
}
}
// don't forward the first argument
void
Cmd_ForwardToServer_f (void)
@ -109,22 +111,19 @@ Cmd_ForwardToServer_f (void)
}
}
/*
cl_Cmd_Init
*/
void
cl_Cmd_Init (void)
{
//
// register our commands
//
Cmd_AddCommand ("cmd", Cmd_ForwardToServer_f, "Send a command to the server.\n"
"Commands:\n"
"download - Same as the command.\n"
"kill - Same as the command.\n"
"msg (value) - Same as the command.\n"
"prespawn (entity) (spot) - Find a spawn spot for the player entity.\n"
"spawn (entity) - Spawn the player entity.\n"
"setinfo - Same as the command.\n"
"serverinfo - Same as the command.");
"Commands:\n"
"download - Same as the command.\n"
"kill - Same as the command.\n"
"msg (value) - Same as the command.\n"
"prespawn (entity) (spot) - Find a spawn spot for the"
" player entity.\n"
"spawn (entity) - Spawn the player entity.\n"
"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.
*/
/*
CL_StopPlayback
@ -82,10 +83,12 @@ CL_StopPlayback (void)
CL_FinishTimeDemo ();
}
#define dem_cmd 0
#define dem_read 1
#define dem_set 2
/*
CL_WriteDemoCmd
@ -99,7 +102,7 @@ CL_WriteDemoCmd (usercmd_t *pcmd)
byte c;
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);
Qwrite (cls.demofile, &fl, sizeof (fl));
@ -126,6 +129,7 @@ CL_WriteDemoCmd (usercmd_t *pcmd)
Qflush (cls.demofile);
}
/*
CL_WriteDemoMessage
@ -138,7 +142,7 @@ CL_WriteDemoMessage (sizebuf_t *msg)
float fl;
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)
return;
@ -156,11 +160,7 @@ CL_WriteDemoMessage (sizebuf_t *msg)
Qflush (cls.demofile);
}
/*
CL_GetDemoMessage
FIXME...
*/
qboolean
CL_GetDemoMessage (void)
{
@ -180,7 +180,7 @@ CL_GetDemoMessage (void)
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.td_lastframe < 0)
cls.td_lastframe = demotime;
@ -250,9 +250,9 @@ CL_GetDemoMessage (void)
// get the next message
Qread (cls.demofile, &net_message->message->cursize, 4);
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)
// Sys_Error ("Demo message > MAX_MSGLEN");
// Sys_Error ("Demo message > MAX_MSGLEN");
Host_EndGame ("Demo message > MAX_MSGLEN");
r = Qread (cls.demofile, net_message->message->data, net_message->message->cursize);
if (r != net_message->message->cursize) {
@ -277,6 +277,7 @@ CL_GetDemoMessage (void)
return 1;
}
/*
CL_GetMessage
@ -337,7 +338,7 @@ CL_WriteRecordDemoMessage (sizebuf_t *msg, int seq)
float fl;
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)
return;
@ -388,8 +389,6 @@ CL_WriteSetDemoMessage (void)
}
/*
CL_Record_f
@ -426,7 +425,6 @@ CL_Record_f (void)
snprintf (name, sizeof (name), "%s/%s", com_gamedir, Cmd_Argv (1));
//
// open the demo file
//
COM_DefaultExtension (name, ".qwd");
@ -676,6 +674,7 @@ CL_Record_f (void)
// done
}
/*
CL_ReRecord_f
@ -703,7 +702,6 @@ CL_ReRecord_f (void)
snprintf (name, sizeof (name), "%s/%s", com_gamedir, Cmd_Argv (1));
//
// open the demo file
//
COM_DefaultExtension (name, ".qwd");
@ -736,14 +734,11 @@ CL_PlayDemo_f (void)
Con_Printf ("play <demoname> : plays a demo\n");
return;
}
//
// disconnect from server
//
// disconnect from server
CL_Disconnect ();
//
// open the demo file
//
// open the demo file
strcpy (name, Cmd_Argv (1));
COM_DefaultExtension (name, ".qwd");
@ -761,9 +756,7 @@ CL_PlayDemo_f (void)
realtime = 0;
}
/*
CL_FinishTimeDemo
*/
void
CL_FinishTimeDemo (void)
{
@ -772,7 +765,7 @@ CL_FinishTimeDemo (void)
cls.timedemo = false;
// the first frame didn't count
// the first frame didn't count
frames = (host_framecount - cls.td_startframe) - 1;
time = Sys_DoubleTime () - cls.td_starttime;
if (!time)
@ -781,6 +774,7 @@ CL_FinishTimeDemo (void)
frames / time);
}
/*
CL_TimeDemo_f
@ -799,8 +793,8 @@ CL_TimeDemo_f (void)
if (cls.state != ca_demostart)
return;
// cls.td_starttime will be grabbed at the second frame of the demo, so
// all the loading time doesn't get counted
// cls.td_starttime will be grabbed at the second frame of the demo, so
// all the loading time doesn't get counted
cls.timedemo = true;
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_player_ents[MAX_CLIENTS];
//============================================================
/*
CL_ClearEnts
*/
void
CL_ClearEnts ()
{
@ -87,9 +83,7 @@ CL_ClearEnts ()
CL_Init_Entity (&cl_player_ents[i]);
}
/*
CL_AllocDlight
*/
dlight_t *
CL_AllocDlight (int key)
{
@ -125,9 +119,7 @@ CL_AllocDlight (int key)
return dl;
}
/*
CL_NewDlight
*/
void
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
CL_DecayLights (void)
{
@ -193,6 +182,7 @@ CL_DecayLights (void)
PACKET ENTITY PARSING / LINKING
*/
/*
CL_ParseDelta
@ -285,20 +275,22 @@ CL_ParseDelta (entity_state_t *from, entity_state_t *to, int bits)
if (bits & U_SOLID) {
// FIXME
}
/*
if ((!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],
ent->colormod[2], s1->alpha, s1->colormod); } */
/*
if ((!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],
ent->colormod[2], s1->alpha, s1->colormod);
}
*/
}
/*
FlushEntityPacket
*/
void
FlushEntityPacket (void)
{
@ -315,7 +307,7 @@ FlushEntityPacket (void)
// read it all, but ignore it
while (1) {
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");
return;
}
@ -327,6 +319,7 @@ FlushEntityPacket (void)
}
}
/*
CL_ParsePacketEntities
@ -456,9 +449,6 @@ CL_ParsePacketEntities (qboolean delta)
}
/*
CL_LinkPacketEntities
*/
void
CL_LinkPacketEntities (void)
{
@ -602,12 +592,14 @@ int cl_num_projectiles;
extern int cl_spikeindex;
void
CL_ClearProjectiles (void)
{
cl_num_projectiles = 0;
}
/*
CL_ParseProjectiles
@ -640,9 +632,7 @@ CL_ParseProjectiles (void)
}
}
/*
CL_LinkProjectiles
*/
void
CL_LinkProjectiles (void)
{
@ -674,13 +664,12 @@ CL_LinkProjectiles (void)
}
}
//========================================
extern int cl_spikeindex, cl_playerindex, cl_flagindex;
/*
CL_ParsePlayerinfo
*/
extern int parsecountmod;
extern double parsecounttime;
void
@ -824,6 +813,7 @@ CL_AddFlagModels (entity_t *ent, int team)
(*newent)->angles[2] -= 45;
}
/*
CL_LinkPlayers
@ -933,8 +923,10 @@ CL_LinkPlayers (void)
}
}
//======================================================================
/*
CL_SetSolid
@ -974,6 +966,7 @@ CL_SetSolidEntities (void)
}
/*
Calculate the new position of players, without other player clipping
@ -1038,6 +1031,7 @@ CL_SetUpPlayerPrediction (qboolean dopred)
}
}
/*
CL_SetSolid
@ -1105,6 +1099,7 @@ CL_EmitEntities (void)
CL_UpdateTEnts ();
}
void
CL_Ents_Init (void)
{

View file

@ -146,24 +146,28 @@ KeyUp (kbutton_t *b)
b->state |= 4; // impulse up
}
void
IN_KLookDown (void)
{
KeyDown (&in_klook);
}
void
IN_KLookUp (void)
{
KeyUp (&in_klook);
}
void
IN_MLookDown (void)
{
KeyDown (&in_mlook);
}
void
IN_MLookUp (void)
{
@ -172,186 +176,217 @@ IN_MLookUp (void)
V_StartPitchDrift ();
}
void
IN_UpDown (void)
{
KeyDown (&in_up);
}
void
IN_UpUp (void)
{
KeyUp (&in_up);
}
void
IN_DownDown (void)
{
KeyDown (&in_down);
}
void
IN_DownUp (void)
{
KeyUp (&in_down);
}
void
IN_LeftDown (void)
{
KeyDown (&in_left);
}
void
IN_LeftUp (void)
{
KeyUp (&in_left);
}
void
IN_RightDown (void)
{
KeyDown (&in_right);
}
void
IN_RightUp (void)
{
KeyUp (&in_right);
}
void
IN_ForwardDown (void)
{
KeyDown (&in_forward);
}
void
IN_ForwardUp (void)
{
KeyUp (&in_forward);
}
void
IN_BackDown (void)
{
KeyDown (&in_back);
}
void
IN_BackUp (void)
{
KeyUp (&in_back);
}
void
IN_LookupDown (void)
{
KeyDown (&in_lookup);
}
void
IN_LookupUp (void)
{
KeyUp (&in_lookup);
}
void
IN_LookdownDown (void)
{
KeyDown (&in_lookdown);
}
void
IN_LookdownUp (void)
{
KeyUp (&in_lookdown);
}
void
IN_MoveleftDown (void)
{
KeyDown (&in_moveleft);
}
void
IN_MoveleftUp (void)
{
KeyUp (&in_moveleft);
}
void
IN_MoverightDown (void)
{
KeyDown (&in_moveright);
}
void
IN_MoverightUp (void)
{
KeyUp (&in_moveright);
}
void
IN_SpeedDown (void)
{
KeyDown (&in_speed);
}
void
IN_SpeedUp (void)
{
KeyUp (&in_speed);
}
void
IN_StrafeDown (void)
{
KeyDown (&in_strafe);
}
void
IN_StrafeUp (void)
{
KeyUp (&in_strafe);
}
void
IN_AttackDown (void)
{
KeyDown (&in_attack);
}
void
IN_AttackUp (void)
{
KeyUp (&in_attack);
}
void
IN_UseDown (void)
{
KeyDown (&in_use);
}
void
IN_UseUp (void)
{
KeyUp (&in_use);
}
void
IN_JumpDown (void)
{
KeyDown (&in_jump);
}
void
IN_JumpUp (void)
{
KeyUp (&in_jump);
}
void
IN_Impulse (void)
{
@ -362,6 +397,7 @@ IN_Impulse (void)
Team_BestWeaponImpulse (); // HACK HACK HACK
}
/*
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_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
@ -509,7 +541,7 @@ CL_BaseMove (usercmd_t *cmd)
cmd->forwardmove += cl_forwardspeed->value * CL_KeyState (&in_forward);
cmd->forwardmove -= cl_backspeed->value * CL_KeyState (&in_back);
}
//
// adjust for speed key
//
if (in_speed.state & 1) {
@ -538,6 +570,7 @@ CL_BaseMove (usercmd_t *cmd)
}
}
int
MakeChar (int i)
{
@ -549,22 +582,18 @@ MakeChar (int i)
return i;
}
/*
CL_FinishMove
*/
void
CL_FinishMove (usercmd_t *cmd)
{
int i;
int ms;
//
// always dump the first two message, because it may contain leftover inputs
// from the last level
//
if (++cl.movemessages <= 2)
return;
//
// figure button bits
//
if (in_attack.state & 3)
@ -592,8 +621,6 @@ CL_FinishMove (usercmd_t *cmd)
cmd->impulse = in_impulse;
in_impulse = 0;
//
// chop down so no extra bits are kept that the server wouldn't get
//
cmd->forwardmove = MakeChar (cmd->forwardmove);
@ -606,9 +633,7 @@ CL_FinishMove (usercmd_t *cmd)
65536.0);
}
/*
CL_SendCmd
*/
void
CL_SendCmd (void)
{
@ -629,7 +654,7 @@ CL_SendCmd (void)
cl.frames[i].senttime = realtime;
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;
// get basic movement from keyboard
@ -698,61 +723,93 @@ CL_SendCmd (void)
if (cls.demorecording)
CL_WriteDemoCmd (cmd);
//
// deliver the message
//
Netchan_Transmit (&cls.netchan, buf.cursize, buf.data);
}
/*
CL_InitInput
*/
void
CL_Input_Init (void)
{
Cmd_AddCommand ("+moveup", IN_UpDown, "When active the player is swimming up in a liquid");
Cmd_AddCommand ("-moveup", IN_UpUp, "When active the player is not swimming up in a liquid");
Cmd_AddCommand ("+movedown", IN_DownDown, "When active the player is swimming down in a liquid");
Cmd_AddCommand ("-movedown", IN_DownUp, "When active the player is not swimming down in a liquid");
Cmd_AddCommand ("+left", IN_LeftDown, "When active the player is turning left");
Cmd_AddCommand ("-left", IN_LeftUp, "When active the player is not turning left");
Cmd_AddCommand ("+right", IN_RightDown, "When active the player is turning right");
Cmd_AddCommand ("-right", IN_RightUp, "When active the player is not turning right");
Cmd_AddCommand ("+forward", IN_ForwardDown, "When active the player is moving forward");
Cmd_AddCommand ("-forward", IN_ForwardUp, "When active the player is not moving forward");
Cmd_AddCommand ("+back", IN_BackDown, "When active the player is moving backwards");
Cmd_AddCommand ("-back", IN_BackUp, "When active the player is not moving backwards");
Cmd_AddCommand ("+lookup", IN_LookupDown, "When active the player's view is looking up");
Cmd_AddCommand ("-lookup", IN_LookupUp, "When active the player's view is 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 ("+moveup", IN_UpDown, "When active the player is swimming "
"up in a liquid");
Cmd_AddCommand ("-moveup", IN_UpUp, "When active the player is not "
"swimming up in a liquid");
Cmd_AddCommand ("+movedown", IN_DownDown, "When active the player is "
"swimming down in a liquid");
Cmd_AddCommand ("-movedown", IN_DownUp, "When active the player is not "
"swimming down in a liquid");
Cmd_AddCommand ("+left", IN_LeftDown, "When active the player is turning "
"left");
Cmd_AddCommand ("-left", IN_LeftUp, "When active the player is not turning"
" left");
Cmd_AddCommand ("+right", IN_RightDown, "When active the player is "
"turning right");
Cmd_AddCommand ("-right", IN_RightUp, "When active the player is not "
"turning right");
Cmd_AddCommand ("+forward", IN_ForwardDown, "When active the player is "
"moving forward");
Cmd_AddCommand ("-forward", IN_ForwardUp, "When active the player is not "
"moving forward");
Cmd_AddCommand ("+back", IN_BackDown, "When active the player is moving "
"backwards");
Cmd_AddCommand ("-back", IN_BackUp, "When active the player is not "
"moving backwards");
Cmd_AddCommand ("+lookup", IN_LookupDown, "When active the player's view "
"is looking up");
Cmd_AddCommand ("-lookup", IN_LookupUp, "When active the player's view is "
"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_JumpUp, "When active the player is not jumping");
Cmd_AddCommand ("impulse", IN_Impulse, "Call a game function or QuakeC function.");
Cmd_AddCommand ("+klook", IN_KLookDown, "When active, +forward and +back 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");
Cmd_AddCommand ("-jump", IN_JumpUp, "When active the player is not "
"jumping");
Cmd_AddCommand ("impulse", IN_Impulse, "Call a game function or QuakeC "
"function.");
Cmd_AddCommand ("+klook", IN_KLookDown, "When active, +forward and +back "
"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
CL_Input_Init_Cvars (void)
{
cl_nodelta = Cvar_Get ("cl_nodelta", "0", CVAR_NONE, NULL,
"disable player delta compression. "
"set to 1 if you have a poor ISP and get a lot of U_REMOVE warnings.");
"Disable player delta compression. Set to 1 if you "
"have a poor ISP and get many U_REMOVE warnings.");
}

View file

@ -1045,9 +1045,8 @@ CL_ReadPackets (void)
#ifdef PACKET_LOGGING
if (cls.demoplayback) Log_Incoming_Packet(net_message->message->data,net_message->message->cursize);
#endif
//
// remote command packet
//
if (*(int *) net_message->message->data == -1) {
CL_ConnectionlessPacket ();
continue;
@ -1061,9 +1060,8 @@ CL_ReadPackets (void)
Con_Printf ("%s: Runt packet\n", NET_AdrToString (net_from));
continue;
}
//
// packet from server
//
if (!cls.demoplayback &&
!NET_CompareAdr (net_from, cls.netchan.remote_address)) {
Con_DPrintf ("%s:sequenced packet without connection\n",
@ -1091,9 +1089,6 @@ CL_ReadPackets (void)
}
//=============================================================================
void
CL_Download_f (void)
{
@ -1154,78 +1149,72 @@ CL_Init (void)
SList_Init ();
//
// register our commands
//
Cmd_AddCommand ("version", CL_Version_f, "Report version information");
Cmd_AddCommand ("changing", CL_Changing_f, "Used when maps are changing");
Cmd_AddCommand ("disconnect", CL_Disconnect_f, "Disconnect from server");
Cmd_AddCommand ("record", CL_Record_f, "Record a demo 'record filename server'");
Cmd_AddCommand ("rerecord", CL_ReRecord_f, "Rerecord a demo on the same server");
Cmd_AddCommand ("record", CL_Record_f, "Record a demo 'record filename "
"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 ("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 ("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
//
Cmd_AddCommand ("kill", Cmd_ForwardToServer, "Suicide :)");
Cmd_AddCommand ("pause", Cmd_ForwardToServer, "Pause the game");
Cmd_AddCommand ("say", Cmd_ForwardToServer, "Say something to all other players");
Cmd_AddCommand ("say_team", Cmd_ForwardToServer, "Say something only to people on your team");
Cmd_AddCommand ("serverinfo", Cmd_ForwardToServer, "Report the current server info");
Cmd_AddCommand ("say", Cmd_ForwardToServer, "Say something to all other "
"players");
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
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 command");
confirm_quit = 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,
"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,
"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,
"Show bonus flash on item pickup");
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,
"mouse forward/back speed");
m_side = Cvar_Get ("m_side", "0.8", CVAR_NONE, NULL, "mouse strafe speed");
rcon_password = Cvar_Get ("rcon_password", "", CVAR_NONE, NULL,
"remote control password");
rcon_address = Cvar_Get ("rcon_address", "", CVAR_NONE, NULL,
"server IP address when client not connected - for sending rcon commands");
rcon_address = Cvar_Get ("rcon_address", "", CVAR_NONE, NULL, "server IP "
"address when client not connected - for "
"sending rcon commands");
cl_writecfg = Cvar_Get ("cl_writecfg", "1", CVAR_NONE, NULL,
"write config files?");
cl_predict_players2 = Cvar_Get ("cl_predict_players2", "1", CVAR_NONE, NULL,
"If this and cl_predict_players is 0, no player prediction is done");
"write config files?");
cl_predict_players2 = Cvar_Get ("cl_predict_players2", "1", CVAR_NONE,
NULL, "If this and cl_predict_players are "
"0, no player prediction is done");
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,
"Are players solid? If off, you can walk through them with difficulty");
localid = Cvar_Get ("localid", "", CVAR_NONE, NULL,
"FIXME: This has something to do with client authentication. No Description");
"Are players solid? If off, you can walk "
"through them with difficulty");
localid = Cvar_Get ("localid", "", CVAR_NONE, NULL, "FIXME: This has "
"something to do with client authentication.");
//
// info mirrors
@ -1398,9 +1387,6 @@ Host_WriteConfiguration (void)
}
//============================================================================
/*
Host_SimulationTime
@ -1523,9 +1509,6 @@ Host_Frame (float time)
}
//============================================================================
static int
check_quakerc (void)
{

View file

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

View file

@ -45,23 +45,21 @@ cvar_t *cl_nostatpred;
extern frame_t *view_frame;
/*
CL_PredictUsercmd
*/
void
CL_PredictUsercmd (player_state_t * from, player_state_t * to, usercmd_t *u,
qboolean spectator)
{
// Dabb: if there is no movement to start with, don't predict...
if(cl_nostatpred->int_val && !from->velocity[0]
&& !from->velocity[1]
&& !from->velocity[2]) {
VectorCopy (from->origin, to->origin);
VectorCopy (u->angles, to->viewangles);
VectorCopy (from->velocity, to->velocity);
if(cl_nostatpred->int_val && !from->velocity[0]
&& !from->velocity[1]
&& !from->velocity[2]) {
VectorCopy (from->origin, to->origin);
VectorCopy (u->angles, to->viewangles);
VectorCopy (from->velocity, to->velocity);
return;
}
}
// split up very long moves
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->viewangles, pmove.angles);
// VectorCopy (from->viewangles, pmove.angles);
VectorCopy (u->angles, pmove.angles);
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;
PlayerMove ();
//for (i=0 ; i<3 ; i++)
//pmove.origin[i] = ((int)(pmove.origin[i]*8))*0.125;
// for (i=0 ; i<3 ; i++)
// pmove.origin[i] = ((int)(pmove.origin[i]*8))*0.125;
to->waterjumptime = pmove.waterjumptime;
to->oldbuttons = pmove.oldbuttons; // Tonik
// to->oldbuttons = pmove.cmd.buttons;
// to->oldbuttons = pmove.cmd.buttons;
VectorCopy (pmove.origin, to->origin);
VectorCopy (pmove.angles, to->viewangles);
VectorCopy (pmove.velocity, to->velocity);
to->onground = onground;
to->weaponframe = from->weaponframe;
}
/*
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...
if(cl_nostatpred->int_val && !from->playerstate[cl.playernum].velocity[0]
&& !from->playerstate[cl.playernum].velocity[1]
&& !from->playerstate[cl.playernum].velocity[2]) {
if(cl_nostatpred->int_val && !from->playerstate[cl.playernum].velocity[0]
&& !from->playerstate[cl.playernum].velocity[1]
&& !from->playerstate[cl.playernum].velocity[2]) {
VectorCopy (from->playerstate[cl.playernum].velocity, cl.simvel);
VectorCopy (from->playerstate[cl.playernum].origin, cl.simorg);
return;
}
}
// predict forward until cl.time <= to->senttime
// predict forward until cl.time <= to->senttime
oldphysent = pmove.numphysent;
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 <
cls.netchan.outgoing_sequence; i++) {
@ -205,9 +198,8 @@ CL_PredictMove (void)
for (i = 0; i < 3; i++)
if (fabs
(from->playerstate[cl.playernum].origin[i] -
to->playerstate[cl.playernum].origin[i]) > 128) { // teleported,
// so don't
// lerp
to->playerstate[cl.playernum].origin[i]) > 128) {
// teleported, so don't lerp
VectorCopy (to->playerstate[cl.playernum].velocity, cl.simvel);
VectorCopy (to->playerstate[cl.playernum].origin, cl.simorg);
return;
@ -224,18 +216,13 @@ CL_PredictMove (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,
"How much prediction should the client make");
cl_nopred = Cvar_Get ("cl_nopred", "0", CVAR_NONE, NULL,
"Set to turn off client prediction");
cl_nostatpred = Cvar_Get ("cl_nostatpred", "0", CVAR_NONE, NULL,
"Set to turn off static player prediction");
"Set to turn off client prediction");
cl_nostatpred = Cvar_Get ("cl_nostatpred", "0", CVAR_NONE, NULL,
"Set to turn off static player prediction");
}

View file

@ -55,9 +55,7 @@ cvar_t *bottomcolor;
char allskins[128];
/*
Skin_NextDownload
*/
void
Skin_NextDownload (void)
{
@ -128,6 +126,7 @@ CL_AllSkins_f (void)
CL_Skins_f ();
}
void
CL_Color_f (void)
{
@ -163,15 +162,21 @@ CL_Color_f (void)
Cvar_Set (bottomcolor, num);
}
void
CL_Skin_Init (void)
{
Skin_Init ();
Cmd_AddCommand ("skins", CL_Skins_f, "Download all skins that are currently in use");
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");
Cmd_AddCommand ("skins", CL_Skins_f, "Download all skins that are "
"currently in use");
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
CL_Skin_Init_Cvars (void)
{
@ -179,16 +184,14 @@ CL_Skin_Init_Cvars (void)
noskins = Cvar_Get ("noskins", "0", CVAR_NONE, NULL, //XXX FIXME
"set to 1 to not download new skins");
skin = Cvar_Get ("skin", "", CVAR_ARCHIVE | CVAR_USERINFO, Cvar_Info,
"Players skin");
"Players skin");
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,
Cvar_Info, "Players color on bottom");
Cvar_Info, "Players color on bottom");
}
/*
CL_NewTranslation
*/
void
CL_NewTranslation (int slot)
{

View file

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

View file

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

View file

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

View file

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