DarkPlaces
Game engine based on the Quake 1 engine by id Software, developed by LadyHavoc
 
client.h File Reference
#include "matrixlib.h"
#include "snd_main.h"
#include "view.h"
#include "cap.h"
#include "cl_parse.h"
#include "cl_particles.h"
#include "r_stats.h"
#include "cl_screen.h"
+ Include dependency graph for client.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  beam_t
 
struct  cl_clientmovement_state_t
 
struct  cl_downloadack_t
 
struct  cl_effect_t
 
struct  cl_locnode_t
 
struct  cl_soundstats_t
 
struct  client_state_t
 
struct  client_static_t
 
struct  cshift_t
 
struct  csqc_vidvars_t
 
struct  decalsystem_t
 
struct  dlight_t
 
struct  entity_persistent_t
 
struct  entity_render_t
 
struct  entity_t
 
struct  frameblend_t
 
struct  kbutton_t
 
struct  lightstyle_t
 
struct  rtlight_particle_t
 
struct  rtlight_t
 
struct  scoreboard_t
 
struct  showlmp_t
 
struct  tridecal_t
 

Macros

#define CL_MAX_DOWNLOADACKS   4
 
#define CL_Mesh_Scene()
 
#define CL_Mesh_UI()
 
#define CSHIFT_BONUS   2
 
#define CSHIFT_CONTENTS   0
 
#define CSHIFT_DAMAGE   1
 
#define CSHIFT_POWERUP   3
 
#define CSHIFT_VCSHIFT   4
 
#define LATESTFRAMENUMS   32
 
#define LIGHTFLAG_NORMALMODE   1
 
#define LIGHTFLAG_REALTIMEMODE   2
 
#define MAX_FRAMEBLENDS   (MAX_FRAMEGROUPBLENDS * 2)
 
#define MAX_RCONS   16
 
#define NAME_LENGTH   64
 
#define NUM_CSHIFTS   5
 
#define NUM_TS_ERRORS   32
 
#define SIGNONS   4
 

Enumerations

enum  cactive_t { ca_uninitialized , ca_dedicated , ca_disconnected , ca_connected }
 
enum  cl_parsingtextmode_t {
  CL_PARSETEXTMODE_NONE , CL_PARSETEXTMODE_PING , CL_PARSETEXTMODE_STATUS , CL_PARSETEXTMODE_STATUS_PLAYERID ,
  CL_PARSETEXTMODE_STATUS_PLAYERIP
}
 
enum  meshname_t { MESH_SCENE , MESH_UI , NUM_MESHENTITIES }
 
enum  qw_downloadtype_t {
  dl_none , dl_single , dl_skin , dl_model ,
  dl_sound
}
 
enum  waterlevel_t { WATERLEVEL_NONE , WATERLEVEL_WETFEET , WATERLEVEL_SWIMMING , WATERLEVEL_SUBMERGED }
 

Functions

void CL_AllocLightFlash (entity_render_t *ent, matrix4x4_t *matrix, float radius, float red, float green, float blue, float decay, float lifetime, char *cubemapname, int style, int shadowenable, vec_t corona, vec_t coronasizescale, vec_t ambientscale, vec_t diffusescale, vec_t specularscale, int flags)
 
void CL_Beam_AddPolygons (const beam_t *b)
 
void CL_Beam_CalculatePositions (const beam_t *b, vec3_t start, vec3_t end)
 
void CL_ClearState (void)
 
void CL_ClearTempEntities (void)
 
void CL_ClientMovement_PlayerMove_Frame (cl_clientmovement_state_t *s)
 
void CL_ClientMovement_Replay (void)
 
void CL_CutDemo (unsigned char **buf, fs_offset_t *filesize)
 
void CL_Demo_Init (void)
 
void CL_Disconnect (void)
 
void CL_Disconnect_f (cmd_state_t *cmd)
 
void CL_DisconnectEx (qbool kicked, const char *reason,...)
 
void CL_Effect (vec3_t org, model_t *model, int startframe, int framecount, float framerate)
 
void CL_EstablishConnection (const char *host, int firstarg)
 
void CL_ExpandCSQCRenderEntities (int num)
 
void CL_ExpandEntities (int num)
 
void CL_FindNonSolidLocation (const vec3_t in, vec3_t out, vec_t radius)
 
void CL_ForwardToServer (const char *s)
 adds the string as a clc_stringcmd to the client message.
 
void CL_ForwardToServer_f (cmd_state_t *cmd)
 adds the current command line as a clc_stringcmd to the client message.
 
double CL_Frame (double time)
 
void CL_Init (void)
 
void CL_InitCommands (void)
 
void CL_InitInput (void)
 
void CL_Input (void)
 
float CL_KeyState (kbutton_t *key)
 
void CL_LerpUpdate (entity_t *e)
 
void CL_Locs_FindLocationName (char *buffer, size_t buffersize, vec3_t point)
 
cl_locnode_tCL_Locs_FindNearest (const vec3_t point)
 
void CL_Locs_Reload_f (cmd_state_t *cmd)
 
void CL_MeshEntities_Init (void)
 
void CL_MeshEntities_Scene_AddRenderEntity (void)
 
void CL_MeshEntities_Scene_Clear (void)
 
void CL_MeshEntities_Scene_FinalizeRenderEntity (void)
 
void CL_MoveLerpEntityStates (entity_t *ent)
 
void CL_NewBeam (int ent, vec3_t start, vec3_t end, model_t *m, int lightning)
 
void CL_NewFrameReceived (int num)
 
entity_render_tCL_NewTempEntity (double shadertime)
 
void CL_NextDemo (void)
 
void CL_ParseEntityLump (char *entitystring)
 
void CL_ParseTEnt (void)
 
void CL_PasteDemo (unsigned char **buf, fs_offset_t *filesize)
 
void CL_PlayDemo (const char *demo)
 
void CL_PlayDemo_f (cmd_state_t *cmd)
 
void CL_ReadDemoMessage (void)
 
void CL_Record_f (cmd_state_t *cmd)
 
void CL_RelinkBeams (void)
 
void CL_RelinkLightFlashes (void)
 
void CL_RotateMoves (const matrix4x4_t *m)
 
void CL_SendMove (void)
 
void CL_SetEntityColormapColors (entity_render_t *ent, int colormap)
 
void CL_SetInfo (const char *key, const char *value, qbool send, qbool allowstarkey, qbool allowmodel, qbool quiet)
 
void CL_Shutdown (void)
 
void CL_StartVideo (void)
 
void CL_Stop_f (cmd_state_t *cmd)
 
void CL_StopPlayback (void)
 
void CL_TimeDemo_f (cmd_state_t *cmd)
 
void CL_UpdateEntityShading (void)
 
void CL_UpdateMoveVars (void)
 
void CL_UpdateRenderEntity (entity_render_t *ent)
 
void CL_UpdateViewEntities (void)
 
void CL_UpdateWorld (void)
 
void CL_ValidateState (entity_state_t *s)
 
void CL_WriteDemoMessage (sizebuf_t *mesage)
 
void CL_WriteToServer (void)
 

Variables

client_state_t cl
 
cvar_t cl_anglespeedkey
 
cvar_t cl_areagrid_link_SOLID_NOT
 
cvar_t cl_autodemo
 
cvar_t cl_autodemo_delete
 
cvar_t cl_autodemo_nameformat
 
cvar_t cl_autofire
 
cvar_t cl_backspeed
 
cvar_t cl_color
 
cvar_t cl_explosions_alpha_end
 
cvar_t cl_explosions_alpha_start
 
cvar_t cl_explosions_lifetime
 
cvar_t cl_explosions_size_end
 
cvar_t cl_explosions_size_start
 
cvar_t cl_forwardspeed
 
int cl_ignoremousemoves
 
cvar_t cl_locs_enable
 
entity_t cl_meshentities [NUM_MESHENTITIES]
 
model_t cl_meshentitymodels [NUM_MESHENTITIES]
 
const char * cl_meshentitynames [NUM_MESHENTITIES]
 
cvar_t cl_movespeedkey
 
cvar_t cl_name
 User-visible names of these CF_USERINFO cvars must be matched in CL_SetInfo()!
 
cvar_t cl_nettimesyncboundmode
 
cvar_t cl_nettimesyncboundtolerance
 
cvar_t cl_nettimesyncfactor
 
cvar_t cl_pitchdriftspeed
 
cvar_t cl_pitchspeed
 
cvar_t cl_playermodel
 
cvar_t cl_playerskin
 
cvar_t cl_pmodel
 
cvar_t cl_prydoncursor
 
cvar_t cl_prydoncursor_notrace
 
cvar_t cl_rate
 
cvar_t cl_rate_burstsize
 
cvar_t cl_shownet
 
cvar_t cl_sidespeed
 
cvar_t cl_stainmaps
 
cvar_t cl_stainmaps_clearonload
 
cvar_t cl_startdemos
 
cvar_t cl_upspeed
 
cvar_t cl_yawspeed
 
client_static_t cls
 
cvar_t freelook
 
kbutton_t in_klook
 
kbutton_t in_mlook
 
kbutton_t in_speed
 
kbutton_t in_strafe
 
cvar_t lookspring
 
cvar_t lookstrafe
 
cvar_t m_forward
 
cvar_t m_pitch
 
cvar_t m_side
 
cvar_t m_yaw
 
cvar_t r_draweffects
 
cvar_t rcon_address
 
cvar_t rcon_password
 
qbool sb_showscores
 
cvar_t sensitivity
 

Macro Definition Documentation

◆ CL_MAX_DOWNLOADACKS

#define CL_MAX_DOWNLOADACKS   4

Definition at line 546 of file client.h.

Referenced by CL_ParseDownload(), and CL_SendMove().

◆ CL_Mesh_Scene

#define CL_Mesh_Scene ( )
Value:
model_t cl_meshentitymodels[NUM_MESHENTITIES]
Definition cl_main.c:2514
@ MESH_SCENE
Definition client.h:1364

Definition at line 1371 of file client.h.

Referenced by CL_Beam_AddPolygons(), CL_MeshEntities_Scene_Clear(), and VM_CL_R_PolygonBegin().

◆ CL_Mesh_UI

#define CL_Mesh_UI ( )

◆ CSHIFT_BONUS

#define CSHIFT_BONUS   2

Definition at line 513 of file client.h.

Referenced by V_BonusFlash_f(), and V_FadeViewFlashs().

◆ CSHIFT_CONTENTS

#define CSHIFT_CONTENTS   0

Definition at line 511 of file client.h.

Referenced by V_CalcViewBlend().

◆ CSHIFT_DAMAGE

#define CSHIFT_DAMAGE   1

Definition at line 512 of file client.h.

Referenced by R_MotionBlurView(), V_FadeViewFlashs(), and V_ParseDamage().

◆ CSHIFT_POWERUP

#define CSHIFT_POWERUP   3

Definition at line 514 of file client.h.

Referenced by V_CalcViewBlend().

◆ CSHIFT_VCSHIFT

#define CSHIFT_VCSHIFT   4

Definition at line 515 of file client.h.

Referenced by V_CalcViewBlend().

◆ LATESTFRAMENUMS

#define LATESTFRAMENUMS   32

Definition at line 959 of file client.h.

Referenced by CL_NewFrameReceived(), and CL_SendMove().

◆ LIGHTFLAG_NORMALMODE

◆ LIGHTFLAG_REALTIMEMODE

◆ MAX_FRAMEBLENDS

◆ MAX_RCONS

#define MAX_RCONS   16

Definition at line 619 of file client.h.

Referenced by CL_Rcon_f(), NetConn_ClientParsePacket(), and NetConn_UpdateSockets().

◆ NAME_LENGTH

#define NAME_LENGTH   64

Definition at line 518 of file client.h.

◆ NUM_CSHIFTS

#define NUM_CSHIFTS   5

Definition at line 516 of file client.h.

Referenced by V_CalcViewBlend().

◆ NUM_TS_ERRORS

#define NUM_TS_ERRORS   32

Definition at line 874 of file client.h.

Referenced by CL_NetworkTimeReceived().

◆ SIGNONS

Enumeration Type Documentation

◆ cactive_t

enum cactive_t
Enumerator
ca_uninitialized 
ca_dedicated 
ca_disconnected 
ca_connected 

Definition at line 527 of file client.h.

528{
529 ca_uninitialized, // during early startup
530 ca_dedicated, // a dedicated server with no ability to start a client
531 ca_disconnected, // full screen console with no connection
532 ca_connected // valid netcon, talking to a server
533}
@ ca_dedicated
Definition client.h:530
@ ca_connected
Definition client.h:532
@ ca_uninitialized
Definition client.h:529
@ ca_disconnected
Definition client.h:531

◆ cl_parsingtextmode_t

Enumerator
CL_PARSETEXTMODE_NONE 
CL_PARSETEXTMODE_PING 
CL_PARSETEXTMODE_STATUS 
CL_PARSETEXTMODE_STATUS_PLAYERID 
CL_PARSETEXTMODE_STATUS_PLAYERIP 

Definition at line 711 of file client.h.

712{
718}
@ CL_PARSETEXTMODE_STATUS_PLAYERIP
Definition client.h:717
@ CL_PARSETEXTMODE_PING
Definition client.h:714
@ CL_PARSETEXTMODE_STATUS_PLAYERID
Definition client.h:716
@ CL_PARSETEXTMODE_NONE
Definition client.h:713
@ CL_PARSETEXTMODE_STATUS
Definition client.h:715

◆ meshname_t

enum meshname_t
Enumerator
MESH_SCENE 
MESH_UI 
NUM_MESHENTITIES 

Definition at line 1363 of file client.h.

1363 {
1364 MESH_SCENE, // CSQC R_PolygonBegin, potentially also engine particles and debug stuff
1365 MESH_UI,
1367} meshname_t;
meshname_t
Definition client.h:1363
@ NUM_MESHENTITIES
Definition client.h:1366

◆ qw_downloadtype_t

Enumerator
dl_none 
dl_single 
dl_skin 
dl_model 
dl_sound 

Definition at line 536 of file client.h.

537{
538 dl_none,
539 dl_single,
540 dl_skin,
541 dl_model,
543}
@ dl_sound
Definition client.h:542
@ dl_none
Definition client.h:538
@ dl_single
Definition client.h:539
@ dl_model
Definition client.h:541
@ dl_skin
Definition client.h:540

◆ waterlevel_t

Enumerator
WATERLEVEL_NONE 
WATERLEVEL_WETFEET 
WATERLEVEL_SWIMMING 
WATERLEVEL_SUBMERGED 

Definition at line 1323 of file client.h.

1324{
1329}
@ WATERLEVEL_WETFEET
Definition client.h:1326
@ WATERLEVEL_SUBMERGED
Definition client.h:1328
@ WATERLEVEL_SWIMMING
Definition client.h:1327
@ WATERLEVEL_NONE
Definition client.h:1325

Function Documentation

◆ CL_AllocLightFlash()

void CL_AllocLightFlash ( entity_render_t * ent,
matrix4x4_t * matrix,
float radius,
float red,
float green,
float blue,
float decay,
float lifetime,
char * cubemapname,
int style,
int shadowenable,
vec_t corona,
vec_t coronasizescale,
vec_t ambientscale,
vec_t diffusescale,
vec_t specularscale,
int flags )
extern

Definition at line 852 of file cl_main.c.

853{
854 int i;
855 dlight_t *dl;
856
857// then look for anything else
858 dl = cl.dlights;
859 for (i = 0;i < cl.max_dlights;i++, dl++)
860 if (!dl->radius)
861 break;
862
863 // unable to find one
864 if (i == cl.max_dlights)
865 return;
866
867 //Con_Printf("dlight %i : %f %f %f : %f %f %f\n", i, org[0], org[1], org[2], red * radius, green * radius, blue * radius);
868 memset (dl, 0, sizeof(*dl));
870 Matrix4x4_Normalize(&dl->matrix, matrix);
871 dl->ent = ent;
874 Matrix4x4_SetOrigin(&dl->matrix, dl->origin[0], dl->origin[1], dl->origin[2]);
875 dl->radius = radius;
876 dl->color[0] = red;
877 dl->color[1] = green;
878 dl->color[2] = blue;
879 dl->initialradius = radius;
880 dl->initialcolor[0] = red;
881 dl->initialcolor[1] = green;
882 dl->initialcolor[2] = blue;
883 dl->decay = decay / radius; // changed decay to be a percentage decrease
884 dl->intensity = 1; // this is what gets decayed
885 if (lifetime)
886 dl->die = cl.time + lifetime;
887 else
888 dl->die = 0;
889 dl->cubemapname[0] = 0;
890 if (cubemapname && cubemapname[0])
891 dp_strlcpy(dl->cubemapname, cubemapname, sizeof(dl->cubemapname));
892 dl->style = style;
893 dl->shadow = shadowenable;
894 dl->corona = corona;
895 dl->flags = flags;
896 dl->coronasizescale = coronasizescale;
897 dl->ambientscale = ambientscale;
898 dl->diffusescale = diffusescale;
899 dl->specularscale = specularscale;
900}
void CL_FindNonSolidLocation(const vec3_t in, vec3_t out, vec_t radius)
client_state_t cl
Definition cl_main.c:117
#define dp_strlcpy(dst, src, dsize)
Definition common.h:303
float flags
float style
GLclampf GLclampf blue
Definition glquake.h:642
GLclampf green
Definition glquake.h:642
#define max(A, B)
Definition mathlib.h:38
void Matrix4x4_SetOrigin(matrix4x4_t *out, double x, double y, double z)
Definition matrixlib.c:1811
void Matrix4x4_Normalize(matrix4x4_t *out, matrix4x4_t *in1)
Definition matrixlib.c:499
void Matrix4x4_OriginFromMatrix(const matrix4x4_t *in, float *out)
Definition matrixlib.c:1792
int i
double time
Definition client.h:868
int max_dlights
Definition client.h:985
dlight_t * dlights
Definition client.h:997
vec_t decay
Definition client.h:264
struct entity_render_s * ent
Definition client.h:239
int flags
Definition client.h:295
vec_t coronasizescale
Definition client.h:283
matrix4x4_t matrix
Definition client.h:249
vec3_t origin
Definition client.h:242
int style
Definition client.h:274
vec_t corona
Definition client.h:280
int shadow
Definition client.h:277
vec3_t color
Definition client.h:252
vec3_t initialcolor
Definition client.h:271
vec_t die
Definition client.h:236
vec_t ambientscale
Definition client.h:286
char cubemapname[64]
Definition client.h:255
vec_t diffusescale
Definition client.h:289
vec_t initialradius
Definition client.h:270
vec_t specularscale
Definition client.h:292
vec_t intensity
Definition client.h:267
vec_t radius
Definition client.h:261

References dlight_t::ambientscale, blue, cl, CL_FindNonSolidLocation(), dlight_t::color, dlight_t::corona, dlight_t::coronasizescale, dlight_t::cubemapname, dlight_t::decay, dlight_t::die, dlight_t::diffusescale, client_state_t::dlights, dp_strlcpy, dlight_t::ent, dlight_t::flags, flags, green, i, dlight_t::initialcolor, dlight_t::initialradius, dlight_t::intensity, dlight_t::matrix, Matrix4x4_Normalize(), Matrix4x4_OriginFromMatrix(), Matrix4x4_SetOrigin(), max, client_state_t::max_dlights, client_state_t::num_dlights, dlight_t::origin, dlight_t::radius, dlight_t::shadow, dlight_t::specularscale, dlight_t::style, style, and client_state_t::time.

Referenced by CL_NewParticlesFromEffectinfo(), CL_ParseTempEntity(), CL_ParticleEffect_Fallback(), VM_CL_te_customflash(), VM_CL_te_explosion2(), and VM_CL_te_explosionrgb().

◆ CL_Beam_AddPolygons()

void CL_Beam_AddPolygons ( const beam_t * b)

Definition at line 129 of file r_lightning.c.

130{
131 vec3_t beamdir, right, up, offset, start, end;
133 vec_t beamrepeatscale = 1.0f / r_lightningbeam_repeatdistance.value;
134 float length, t1, t2;
135 model_t *mod;
136 msurface_t *surf;
137
142
143 // calculate beam direction (beamdir) vector and beam length
144 // get difference vector
145 CL_Beam_CalculatePositions(b, start, end);
146 VectorSubtract(end, start, beamdir);
147 // find length of difference vector
148 length = sqrt(DotProduct(beamdir, beamdir));
149 // calculate scale to make beamdir a unit vector (normalized)
150 t1 = 1.0f / length;
151 // scale beamdir so it is now normalized
152 VectorScale(beamdir, t1, beamdir);
153
154 // calculate up vector such that it points toward viewer, and rotates around the beamdir
155 // get direction from start of beam to viewer
157 // remove the portion of the vector that moves along the beam
158 // (this leaves only a vector pointing directly away from the beam)
159 t1 = -DotProduct(up, beamdir);
160 VectorMA(up, t1, beamdir, up);
161 // generate right vector from forward and up, the result is unnormalized
162 CrossProduct(beamdir, up, right);
163 // now normalize the right vector and up vector
166
167 // calculate T coordinate scrolling (start and end texcoord along the beam)
168 t1 = beamscroll;
169 t1 = t1 - (int)t1;
170 t2 = t1 + beamrepeatscale * length;
171
172 // the beam is 3 polygons in this configuration:
173 // * 2
174 // * *
175 // 1*****
176 // * *
177 // * 3
178 // they are showing different portions of the beam texture, creating an
179 // illusion of a beam that appears to curl around in 3D space
180 // (and realize that the whole polygon assembly orients itself to face
181 // the viewer)
182
183 mod = CL_Mesh_Scene();
185 // polygon 1
187 CL_Beam_AddQuad(mod, surf, start, end, offset, t1, t2);
188 // polygon 2
190 CL_Beam_AddQuad(mod, surf, start, end, offset, t1 + 0.33f, t2 + 0.33f);
191 // polygon 3
193 CL_Beam_AddQuad(mod, surf, start, end, offset, t1 + 0.66f, t2 + 0.66f);
194}
void CL_Beam_CalculatePositions(const beam_t *b, vec3_t start, vec3_t end)
Definition cl_main.c:1851
#define CL_Mesh_Scene()
Definition client.h:1371
float mod(float dividend, float divisor)
static int(ZEXPORT *qz_inflate)(z_stream *strm
r_refdef_t r_refdef
Definition gl_rmain.c:57
GLenum GLuint GLenum GLsizei length
Definition glquake.h:657
GLuint GLuint GLintptr offset
Definition glquake.h:632
#define VectorNormalize(v)
Definition mathlib.h:104
#define VectorSubtract(a, b, out)
Definition mathlib.h:99
#define CrossProduct(a, b, out)
Definition mathlib.h:103
#define DotProduct(a, b)
Definition mathlib.h:98
#define VectorScale(in, scale, out)
Definition mathlib.h:111
#define VectorMAM(scale1, b1, scale2, b2, out)
Definition mathlib.h:116
#define VectorMA(a, scale, b, out)
Definition mathlib.h:114
#define VectorM(scale1, b1, out)
Definition mathlib.h:115
float sqrt(float f)
msurface_t * Mod_Mesh_AddSurface(model_t *mod, texture_t *tex, qbool batchwithprevioussurface)
#define NULL
Definition qtypes.h:12
float vec_t
Definition qtypes.h:68
vec_t vec3_t[3]
Definition qtypes.h:71
cvar_t r_lightningbeam_scroll
Definition r_lightning.c:6
cvar_t r_lightningbeam_repeatdistance
Definition r_lightning.c:7
static void CL_Beams_SetupBuiltinTexture(void)
Definition r_lightning.c:28
static texture_t cl_beams_builtintexture
Definition r_lightning.c:14
cvar_t r_lightningbeam_thickness
Definition r_lightning.c:5
static void CL_Beam_AddQuad(model_t *mod, msurface_t *surf, const vec3_t start, const vec3_t end, const vec3_t offset, float t1, float t2)
cvar_t r_lightningbeam_qmbtexture
Definition r_lightning.c:11
static texture_t cl_beams_externaltexture
Definition r_lightning.c:13
static void CL_Beams_SetupExternalTexture(void)
Definition r_lightning.c:22
dp_FragColor b
float value
Definition cvar.h:74
int integer
Definition cvar.h:73
describes the textures to use on a range of triangles in the model, and mins/maxs (AABB) for culling.
double time
(client gameworld) time for rendering time based effects
Definition render.h:352
r_refdef_view_t view
Definition render.h:406
r_refdef_scene_t scene
Definition render.h:418
vec3_t origin
Definition render.h:267
struct skinframe_s * currentskinframe
static vec3_t right
Definition sv_user.c:305
static vec3_t up
Definition sv_user.c:305

References b, CL_Beam_AddQuad(), CL_Beam_CalculatePositions(), cl_beams_builtintexture, cl_beams_externaltexture, CL_Beams_SetupBuiltinTexture(), CL_Beams_SetupExternalTexture(), CL_Mesh_Scene, CrossProduct, texture_t::currentskinframe, DotProduct, int(), cvar_t::integer, length, mod(), Mod_Mesh_AddSurface(), NULL, offset, r_refdef_view_t::origin, r_lightningbeam_qmbtexture, r_lightningbeam_repeatdistance, r_lightningbeam_scroll, r_lightningbeam_thickness, r_refdef, right, r_refdef_t::scene, sqrt(), r_refdef_scene_t::time, up, cvar_t::value, VectorM, VectorMA, VectorMAM, VectorNormalize, VectorScale, VectorSubtract, and r_refdef_t::view.

Referenced by CL_RelinkBeams().

◆ CL_Beam_CalculatePositions()

void CL_Beam_CalculatePositions ( const beam_t * b,
vec3_t start,
vec3_t end )

Definition at line 1851 of file cl_main.c.

1852{
1853 VectorCopy(b->start, start);
1854 VectorCopy(b->end, end);
1855
1856 // if coming from the player, update the start position
1857 if (b->entity == cl.viewentity)
1858 {
1860 {
1861 // LadyHavoc: this is a stupid hack from Quake that makes your
1862 // lightning appear to come from your waist and cover less of your
1863 // view
1864 // in Quake this hack was applied to all players (causing the
1865 // infamous crotch-lightning), but in darkplaces and QuakeWorld it
1866 // only applies to your own lightning, and only in first person
1868 }
1870 {
1871 vec3_t dir, localend;
1872 vec_t len;
1873 // LadyHavoc: this updates the beam direction to match your
1874 // viewangles
1875 VectorSubtract(end, start, dir);
1876 len = VectorLength(dir);
1878 VectorSet(localend, len, 0, 0);
1879 Matrix4x4_Transform(&r_refdef.view.matrix, localend, end);
1880 }
1881 }
1882}
cvar_t cl_beams_instantaimhack
Definition cl_main.c:80
cvar_t cl_beams_quakepositionhack
Definition cl_main.c:79
#define VectorLength(a)
Definition mathlib.h:109
#define VectorSet(vec, x, y, z)
Definition mathlib.h:96
#define VectorCopy(in, out)
Definition mathlib.h:101
void Matrix4x4_Transform(const matrix4x4_t *in, const float v[3], float out[3])
Definition matrixlib.c:1657
cvar_t chase_active
Definition view.c:132
vec2 dir
entity_t * entities
Definition client.h:991
matrix4x4_t matrix
Definition client.h:332
entity_render_t render
Definition client.h:477
matrix4x4_t matrix
Definition render.h:266

References b, chase_active, cl, cl_beams_instantaimhack, cl_beams_quakepositionhack, dir, client_state_t::entities, cvar_t::integer, entity_render_t::matrix, r_refdef_view_t::matrix, Matrix4x4_OriginFromMatrix(), Matrix4x4_Transform(), r_refdef, entity_t::render, VectorCopy, VectorLength, VectorNormalize, VectorSet, VectorSubtract, r_refdef_t::view, and client_state_t::viewentity.

Referenced by CL_Beam_AddPolygons(), and CL_RelinkBeams().

◆ CL_ClearState()

void CL_ClearState ( void )

Definition at line 125 of file cl_main.c.

126{
127 int i;
128 entity_t *ent;
129
131
132// wipe the entire cl structure
134 memset (&cl, 0, sizeof(cl));
135
137
138 // reset the view zoom interpolation
139 cl.mviewzoom[0] = cl.mviewzoom[1] = 1;
140 cl.sensitivityscale = 1.0f;
141
142 // enable rendering of the world and such
146
147 // set up the float version of the stats array for easier access to float stats
148 cl.statsf = (float *)cl.stats;
149
150 cl.num_entities = 0;
153
154 // tweak these if the game runs out
163 cl.max_particles = MAX_PARTICLES_INITIAL; // grows dynamically
164 cl.max_showlmps = 0;
165
166 cl.num_dlights = 0;
167 cl.num_effects = 0;
168 cl.num_beams = 0;
169
172 cl.entities_active = (unsigned char *)Mem_Alloc(cls.levelmempool, cl.max_brushmodel_entities * sizeof(unsigned char));
180 cl.showlmps = NULL;
181
182 // LadyHavoc: have to set up the baseline info for alpha and other stuff
183 for (i = 0;i < cl.max_entities;i++)
184 {
188 }
189
191 {
192 VectorSet(cl.playerstandmins, -16, -16, -24);
193 VectorSet(cl.playerstandmaxs, 16, 16, 45);
194 VectorSet(cl.playercrouchmins, -16, -16, -24);
195 VectorSet(cl.playercrouchmaxs, 16, 16, 25);
196 }
197 else
198 {
199 VectorSet(cl.playerstandmins, -16, -16, -24);
200 VectorSet(cl.playerstandmaxs, 16, 16, 24);
201 VectorSet(cl.playercrouchmins, -16, -16, -24);
202 VectorSet(cl.playercrouchmaxs, 16, 16, 24);
203 }
204
205 // disable until we get textures for it
207
208 ent = &cl.entities[0];
209 // entire entity array was cleared, so just fill in a few fields
210 ent->state_current.active = true;
211 ent->render.model = cl.worldmodel = NULL; // no world model yet
212 ent->render.alpha = 1;
214 Matrix4x4_CreateFromQuakeEntity(&ent->render.matrix, 0, 0, 0, 0, 0, 0, 1);
215 ent->render.allowdecals = true;
217
218 // noclip is turned off at start
219 noclip_anglehack = false;
220
221 // mark all frames invalid for delta
222 memset(cl.qw_deltasequence, -1, sizeof(cl.qw_deltasequence));
223
224 // set bestweapon data back to Quake data
226
228}
void IN_BestWeapon_ResetData(void)
call before each map so QC can start from a clean state
Definition cl_input.c:226
void CL_UpdateRenderEntity(entity_render_t *ent)
Definition cl_main.c:702
client_static_t cls
Definition cl_main.c:116
void CL_Screen_NewMap(void)
Definition cl_screen.c:2346
gamemode_t gamemode
Definition com_game.c:26
#define IS_NEXUIZ_DERIVED(g)
Definition com_game.h:71
void CL_VM_ShutDown(void)
Definition csprogs.c:1154
cvar_t r_drawworld
Definition gl_rmain.c:98
void Matrix4x4_CreateFromQuakeEntity(matrix4x4_t *out, double x, double y, double z, double pitch, double yaw, double roll, double scale)
Definition matrixlib.c:715
entity_state_t defaultstate
Definition protocol.c:4
#define RENDER_SHADOW
Definition protocol.h:365
#define RENDER_LIGHT
Definition protocol.h:366
#define MAX_PARTICLES_INITIAL
initial allocation for cl.particles
Definition qdefs.h:153
#define MAX_EFFECTS
limit on size of cl.effects
Definition qdefs.h:157
#define MAX_EDICTS
max number of objects in game world at once (32768 protocol limit)
Definition qdefs.h:105
#define MAX_STATICENTITIES
limit on size of cl.static_entities
Definition qdefs.h:156
#define MAX_LIGHTSTYLES
max flickering light styles in level (note: affects savegame format)
Definition qdefs.h:108
#define MAX_BEAMS
limit on size of cl.beams
Definition qdefs.h:158
#define MAX_DLIGHTS
max number of dynamic lights (rocket flashes, etc) in scene at once
Definition qdefs.h:132
#define MAX_ENTITIES_INITIAL
initial size of cl.entities
Definition qdefs.h:155
qbool noclip_anglehack
Definition sv_ccmds.c:190
void R_ResetSkyBox(void)
Definition r_sky.c:440
void S_StopAllSounds(void)
Definition snd_main.c:1710
int max_showlmps
Definition client.h:989
lightstyle_t * lightstyle
Definition client.h:998
int max_static_entities
Definition client.h:982
int max_lightstyle
Definition client.h:986
vec3_t playerstandmins
Definition client.h:972
int num_brushmodel_entities
Definition client.h:1005
float sensitivityscale
Definition client.h:833
unsigned char * entities_active
Definition client.h:993
beam_t * beams
Definition client.h:996
int max_csqcrenderentities
Definition client.h:981
int max_brushmodel_entities
Definition client.h:987
particle_t * particles
Definition client.h:1000
vec3_t playerstandmaxs
Definition client.h:973
int * brushmodel_entities
Definition client.h:999
float * statsf
Definition client.h:759
vec3_t playercrouchmaxs
Definition client.h:975
struct model_s * worldmodel
Definition client.h:934
cl_effect_t * effects
Definition client.h:995
vec3_t playercrouchmins
Definition client.h:974
int max_effects
Definition client.h:983
showlmp_t * showlmps
Definition client.h:1001
int max_entities
Definition client.h:980
entity_render_t * csqcrenderentities
Definition client.h:992
entity_t * static_entities
Definition client.h:994
int max_particles
Definition client.h:988
int stats[MAX_CL_STATS]
Definition client.h:758
unsigned int qw_deltasequence[QW_UPDATE_BACKUP]
Definition client.h:1106
csqc_vidvars_t csqc_vidvars
Definition client.h:834
int num_static_entities
Definition client.h:1004
vec_t mviewzoom[2]
Definition client.h:794
mempool_t * levelmempool
Definition client.h:571
qbool drawenginesbar
Definition client.h:707
qbool drawworld
Definition client.h:706
qbool drawcrosshair
Definition client.h:708
model_t * model
Definition client.h:343
unsigned char active
Definition protocol.h:459
entity_state_t state_baseline
Definition client.h:467
entity_state_t state_current
Definition client.h:471
entity_state_t state_previous
Definition client.h:469
#define Mem_Alloc(pool, size)
Definition zone.h:92
#define Mem_EmptyPool(pool)
Definition zone.h:106

References entity_state_t::active, entity_render_t::allowdecals, entity_render_t::alpha, client_state_t::beams, client_state_t::brushmodel_entities, cl, CL_Screen_NewMap(), CL_UpdateRenderEntity(), CL_VM_ShutDown(), cls, client_state_t::csqc_vidvars, client_state_t::csqcrenderentities, defaultstate, client_state_t::dlights, csqc_vidvars_t::drawcrosshair, csqc_vidvars_t::drawenginesbar, csqc_vidvars_t::drawworld, client_state_t::effects, client_state_t::entities, client_state_t::entities_active, entity_render_t::flags, gamemode, i, IN_BestWeapon_ResetData(), cvar_t::integer, IS_NEXUIZ_DERIVED, client_static_t::levelmempool, client_state_t::lightstyle, entity_render_t::matrix, Matrix4x4_CreateFromQuakeEntity(), MAX_BEAMS, client_state_t::max_beams, client_state_t::max_brushmodel_entities, client_state_t::max_csqcrenderentities, MAX_DLIGHTS, client_state_t::max_dlights, MAX_EDICTS, MAX_EFFECTS, client_state_t::max_effects, client_state_t::max_entities, MAX_ENTITIES_INITIAL, client_state_t::max_lightstyle, MAX_LIGHTSTYLES, client_state_t::max_particles, MAX_PARTICLES_INITIAL, client_state_t::max_showlmps, client_state_t::max_static_entities, MAX_STATICENTITIES, Mem_Alloc, Mem_EmptyPool, entity_render_t::model, client_state_t::mviewzoom, noclip_anglehack, NULL, client_state_t::num_beams, client_state_t::num_brushmodel_entities, client_state_t::num_dlights, client_state_t::num_effects, client_state_t::num_entities, client_state_t::num_static_entities, client_state_t::particles, client_state_t::playercrouchmaxs, client_state_t::playercrouchmins, client_state_t::playerstandmaxs, client_state_t::playerstandmins, client_state_t::qw_deltasequence, r_drawworld, R_ResetSkyBox(), entity_t::render, RENDER_LIGHT, RENDER_SHADOW, S_StopAllSounds(), client_state_t::sensitivityscale, client_state_t::showlmps, entity_t::state_baseline, entity_t::state_current, entity_t::state_previous, client_state_t::static_entities, client_state_t::stats, client_state_t::statsf, VectorSet, and client_state_t::worldmodel.

Referenced by CL_ParseServerInfo().

◆ CL_ClearTempEntities()

void CL_ClearTempEntities ( void )

Definition at line 781 of file cl_main.c.

782{
784 // grow tempentities buffer on request
786 {
787 Con_Printf("CL_NewTempEntity: grow maxtempentities from %i to %i\n", r_refdef.scene.maxtempentities, r_refdef.scene.maxtempentities * 2);
791 }
792}
void Con_Printf(const char *fmt,...)
Prints to all appropriate console targets.
Definition console.c:1514
mempool_t * permanentmempool
Definition client.h:572
int maxtempentities
Definition render.h:368
entity_render_t * tempentities
field of temporary entities that is reset each (client) frame
Definition render.h:366
int numtempentities
Definition render.h:367
qbool expandtempentities
Definition render.h:369
#define Mem_Realloc(pool, data, size)
Definition zone.h:94

References cls, Con_Printf(), r_refdef_scene_t::expandtempentities, r_refdef_scene_t::maxtempentities, Mem_Realloc, r_refdef_scene_t::numtempentities, client_static_t::permanentmempool, r_refdef, r_refdef_t::scene, and r_refdef_scene_t::tempentities.

Referenced by CL_UpdateWorld().

◆ CL_ClientMovement_PlayerMove_Frame()

void CL_ClientMovement_PlayerMove_Frame ( cl_clientmovement_state_t * s)

Definition at line 1586 of file cl_input.c.

1587{
1588 // if a move is more than 50ms, do it as two moves (matching qwsv)
1589 //Con_Printf("%i ", s.cmd.msec);
1590 if(s->cmd.frametime > 0.0005)
1591 {
1592 if (s->cmd.frametime > 0.05)
1593 {
1594 s->cmd.frametime /= 2;
1596 }
1598 }
1599 else
1600 {
1601 // we REALLY need this handling to happen, even if the move is not executed
1602 if (!s->cmd.jump)
1603 s->cmd.canjump = true;
1604 }
1605}
static void CL_ClientMovement_PlayerMove(cl_clientmovement_state_t *s)
Definition cl_input.c:1481
qbool jump
Definition protocol.h:404
qbool canjump
Definition protocol.h:403
double frametime
Definition protocol.h:402

References usercmd_t::canjump, CL_ClientMovement_PlayerMove(), cl_clientmovement_state_t::cmd, usercmd_t::frametime, and usercmd_t::jump.

Referenced by CL_ClientMovement_Replay(), and VM_CL_runplayerphysics().

◆ CL_ClientMovement_Replay()

void CL_ClientMovement_Replay ( void )

Definition at line 1607 of file cl_input.c.

1608{
1609 int i;
1610 double totalmovemsec;
1612
1614
1616 return;
1617
1619 return;
1620
1621 // set up starting state for the series of moves
1622 memset(&s, 0, sizeof(s));
1625 s.crouched = true; // will be updated on first move
1626 //Con_Printf("movement replay starting org %f %f %f vel %f %f %f\n", s.origin[0], s.origin[1], s.origin[2], s.velocity[0], s.velocity[1], s.velocity[2]);
1627
1628 totalmovemsec = 0;
1629 for (i = 0;i < CL_MAX_USERCMDS;i++)
1631 totalmovemsec += cl.movecmd[i].msec;
1633 //Con_Printf("%i = %.0f >= %.0f && %u && (%i && %i && %i == %i && %i > 0 && %i\n", cl.movement_predicted, totalmovemsec, cl_movement_minping.value, cls.servermovesequence, cl_movement.integer, !cls.demoplayback, cls.signon, SIGNONS, cl.stats[STAT_HEALTH], !cl.intermission);
1635 {
1636 //Con_Printf("%ims\n", cl.movecmd[0].msec);
1637
1638 // replay the input queue to predict current location
1639 // note: this relies on the fact there's always one queue item at the end
1640
1641 // find how many are still valid
1642 for (i = 0;i < CL_MAX_USERCMDS;i++)
1644 break;
1645 // now walk them in oldest to newest order
1646 for (i--;i >= 0;i--)
1647 {
1648 s.cmd = cl.movecmd[i];
1649 if (i < CL_MAX_USERCMDS - 1)
1650 s.cmd.canjump = cl.movecmd[i+1].canjump;
1651
1653
1655 }
1656 //Con_Printf("\n");
1658 }
1659 else
1660 {
1661 // get the first movement queue entry to know whether to crouch and such
1662 s.cmd = cl.movecmd[0];
1663 }
1664
1665 if (!cls.demoplayback) // for bob, speedometer
1666 {
1667 cl.movement_replay = false;
1668 // update the interpolation target position and velocity
1671 }
1672
1673 // update the onground flag if appropriate
1675 {
1676 // when predicted we simply set the flag according to the UpdateStatus
1677 cl.onground = s.onground;
1678 }
1679 else
1680 {
1681 // when not predicted, cl.onground is cleared by cl_parse.c each time
1682 // an update packet is received, but can be forced on here to hide
1683 // server inconsistencies in the onground flag
1684 // (which mostly occur when stepping up stairs at very high framerates
1685 // where after the step up the move continues forward and not
1686 // downward so the ground is not detected)
1687 //
1688 // such onground inconsistencies can cause jittery gun bobbing and
1689 // stair smoothing, so we set onground if UpdateStatus says so
1690 if (s.onground)
1691 cl.onground = true;
1692 }
1693}
cvar_t cl_movement_minping
Definition cl_input.c:380
cvar_t cl_movement_replay
Definition cl_input.c:378
cvar_t cl_movement
Definition cl_input.c:377
static void CL_ClientMovement_UpdateStatus(cl_clientmovement_state_t *s)
Definition cl_input.c:878
void CL_ClientMovement_PlayerMove_Frame(cl_clientmovement_state_t *s)
Definition cl_input.c:1586
#define SIGNONS
Definition client.h:525
#define CL_MAX_USERCMDS
max number of predicted input packets in queue
Definition qdefs.h:115
#define STAT_HEALTH
Definition qstats.h:8
vec3_t movement_origin
Definition client.h:809
vec3_t movement_velocity
Definition client.h:810
qbool onground
Definition client.h:843
int intermission
Definition client.h:856
usercmd_t movecmd[CL_MAX_USERCMDS]
Definition client.h:754
vec3_t mvelocity[2]
Definition client.h:792
qbool movement_predicted
Definition client.h:805
int playerentity
Definition client.h:910
qbool movement_replay
Definition client.h:807
unsigned int servermovesequence
Definition client.h:637
qbool demoplayback
Definition client.h:587
float origin[3]
Definition protocol.h:444
unsigned char msec
Definition protocol.h:394
unsigned int sequence
Definition protocol.h:397

References usercmd_t::canjump, cl, CL_ClientMovement_PlayerMove_Frame(), CL_ClientMovement_UpdateStatus(), CL_MAX_USERCMDS, cl_movement, cl_movement_minping, cl_movement_replay, cls, cl_clientmovement_state_t::cmd, cl_clientmovement_state_t::crouched, client_static_t::demoplayback, client_state_t::entities, i, cvar_t::integer, client_state_t::intermission, client_state_t::movecmd, client_state_t::movement_origin, client_state_t::movement_predicted, client_state_t::movement_replay, client_state_t::movement_velocity, usercmd_t::msec, client_state_t::mvelocity, cl_clientmovement_state_t::onground, client_state_t::onground, cl_clientmovement_state_t::origin, entity_state_t::origin, client_state_t::playerentity, usercmd_t::sequence, client_static_t::servermovesequence, client_static_t::signon, SIGNONS, STAT_HEALTH, entity_t::state_current, client_state_t::stats, cvar_t::value, VectorCopy, and cl_clientmovement_state_t::velocity.

Referenced by CL_UpdateWorld().

◆ CL_CutDemo()

void CL_CutDemo ( unsigned char ** buf,
fs_offset_t * filesize )

Definition at line 137 of file cl_demo.c.

138{
139 *buf = NULL;
140 *filesize = 0;
141
143 *buf = FS_LoadFile(cls.demoname, tempmempool, false, filesize);
144
145 // restart the demo recording
146 cls.demofile = FS_OpenRealFile(cls.demoname, "wb", false);
147 if(!cls.demofile)
148 Sys_Error("failed to reopen the demo file");
150}
unsigned char * FS_LoadFile(const char *path, mempool_t *pool, qbool quiet, fs_offset_t *filesizepointer)
Definition fs.c:3540
qfile_t * FS_OpenRealFile(const char *filepath, const char *mode, qbool quiet)
Definition fs.c:2901
int FS_Close(qfile_t *file)
Definition fs.c:2970
int FS_Printf(qfile_t *file, const char *format,...)
Definition fs.c:3273
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition glquake.h:657
qfile_t * demofile
Definition client.h:592
char demoname[MAX_QPATH]
Definition client.h:580
void Sys_Error(const char *error,...) DP_FUNC_PRINTF(1) DP_FUNC_NORETURN
Causes the entire program to exit ASAP.
Definition sys_shared.c:724
mempool_t * tempmempool
Definition zone.c:794

References buf, cls, client_static_t::demofile, client_static_t::demoname, client_static_t::forcetrack, FS_Close(), FS_LoadFile(), FS_OpenRealFile(), FS_Printf(), NULL, Sys_Error(), and tempmempool.

Referenced by CL_VM_Init().

◆ CL_Demo_Init()

void CL_Demo_Init ( void )

Definition at line 737 of file cl_demo.c.

738{
739 Cmd_AddCommand(CF_CLIENT, "record", CL_Record_f, "record a demo");
740 Cmd_AddCommand(CF_CLIENT, "stop", CL_Stop_f, "stop recording or playing a demo");
741 Cmd_AddCommand(CF_CLIENT, "playdemo", CL_PlayDemo_f, "watch a demo file");
742 Cmd_AddCommand(CF_CLIENT, "timedemo", CL_TimeDemo_f, "play back a demo as fast as possible and save statistics to benchmark.log");
743 Cmd_AddCommand(CF_CLIENT, "startdemos", CL_Startdemos_f, "start playing back the selected demos sequentially (used at end of startup script)");
744 Cmd_AddCommand(CF_CLIENT, "demos", CL_Demos_f, "restart looping demos defined by the last startdemos command");
745 Cmd_AddCommand(CF_CLIENT, "stopdemo", CL_Stopdemo_f, "stop playing or recording demo (like stop command) and return to looping demos");
746 // LadyHavoc: added pausedemo
747 Cmd_AddCommand(CF_CLIENT, "pausedemo", CL_PauseDemo_f, "pause demo playback (can also safely pause demo recording if using QUAKE, QUAKEDP or NEHAHRAMOVIE protocol, useful for making movies)");
752}
void CL_PlayDemo_f(cmd_state_t *cmd)
Definition cl_demo.c:468
void CL_Stop_f(cmd_state_t *cmd)
Definition cl_demo.c:307
static void CL_Demos_f(cmd_state_t *cmd)
Definition cl_demo.c:703
static void CL_PauseDemo_f(cmd_state_t *cmd)
Definition cl_demo.c:728
static void CL_Stopdemo_f(cmd_state_t *cmd)
Definition cl_demo.c:720
static void CL_Startdemos_f(cmd_state_t *cmd)
Definition cl_demo.c:654
void CL_TimeDemo_f(cmd_state_t *cmd)
Definition cl_demo.c:612
void CL_Record_f(cmd_state_t *cmd)
Definition cl_demo.c:346
cvar_t cl_autodemo_delete
Definition cl_main.c:64
cvar_t cl_autodemo
Definition cl_main.c:62
cvar_t cl_autodemo_nameformat
Definition cl_main.c:63
cvar_t cl_startdemos
Definition cl_main.c:65
void Cmd_AddCommand(unsigned flags, const char *cmd_name, xcommand_t function, const char *description)
called by the init functions of other parts of the program to register commands and functions to call...
Definition cmd.c:1661
#define CF_CLIENT
cvar/command that only the client can change/execute
Definition cmd.h:48
void Cvar_RegisterVariable(cvar_t *variable)
registers a cvar that already has the name, string, and optionally the archive elements set.
Definition cvar.c:599

References CF_CLIENT, cl_autodemo, cl_autodemo_delete, cl_autodemo_nameformat, CL_Demos_f(), CL_PauseDemo_f(), CL_PlayDemo_f(), CL_Record_f(), cl_startdemos, CL_Startdemos_f(), CL_Stop_f(), CL_Stopdemo_f(), CL_TimeDemo_f(), Cmd_AddCommand(), and Cvar_RegisterVariable().

Referenced by CL_Init().

◆ CL_Disconnect()

void CL_Disconnect ( void )

Definition at line 478 of file cl_main.c.

479{
480 CL_DisconnectEx(false, NULL);
481}
void CL_DisconnectEx(qbool kicked, const char *fmt,...)
Definition cl_main.c:370

References CL_DisconnectEx(), and NULL.

Referenced by CL_Demos_f(), CL_Disconnect_f(), CL_PlayDemo(), CL_ReadDemoMessage(), CL_Record_f(), CL_Shutdown(), CL_Stopdemo_f(), Curl_Curl_f(), FS_ChangeGameDirs(), and NetConn_ConnectionEstablished().

◆ CL_Disconnect_f()

void CL_Disconnect_f ( cmd_state_t * cmd)

Definition at line 559 of file cl_main.c.

560{
562}
void CL_Disconnect(void)
Definition cl_main.c:478
static int Cmd_Argc(cmd_state_t *cmd)
Definition cmd.h:249
static const char * Cmd_Argv(cmd_state_t *cmd, int arg)
Cmd_Argv(cmd, ) will return an empty string (not a NULL) if arg > argc, so string operations are alwa...
Definition cmd.h:254
const float false
void cmd(string command,...)

References CL_Disconnect(), CL_DisconnectEx(), cmd(), Cmd_Argc(), and Cmd_Argv().

Referenced by CL_Init().

◆ CL_DisconnectEx()

void CL_DisconnectEx ( qbool kicked,
const char * reason,
... )

Definition at line 370 of file cl_main.c.

371{
372 va_list argptr;
373 char reason[512];
374
375 if (cls.state == ca_dedicated)
376 return;
377
378 if(fmt)
379 {
380 va_start(argptr,fmt);
381 dpvsnprintf(reason,sizeof(reason),fmt,argptr);
382 va_end(argptr);
383 }
384 else
385 {
386 dpsnprintf(reason, sizeof(reason), "Disconnect by user");
387 }
388
389 if (Sys_CheckParm("-profilegameonly"))
390 Sys_AllowProfiling(false);
391
393
394 Con_DPrintf("CL_Disconnect\n");
395
399 // stop sounds (especially looping!)
401 // prevent dlcache assets from this server from interfering with the next one
403
404 cl.parsingtextexpectingpingforscores = 0; // just in case no reply has come yet
405
406 // clear contents blends
407 cl.cshifts[0].percent = 0;
408 cl.cshifts[1].percent = 0;
409 cl.cshifts[2].percent = 0;
410 cl.cshifts[3].percent = 0;
411
413
415
416 if (cls.demoplayback)
418 else if (cls.netcon)
419 {
421 unsigned char bufdata[520];
422 if (cls.demorecording)
424
425 if(!kicked)
426 {
427 // send disconnect message 3 times to improve chances of server
428 // receiving it (but it still fails sometimes)
429 memset(&buf, 0, sizeof(buf));
430 buf.data = bufdata;
431 buf.maxsize = sizeof(bufdata);
433 {
434 Con_DPrint("Sending drop command\n");
436 MSG_WriteString(&buf, "drop");
437 }
438 else
439 {
440 Con_DPrint("Sending clc_disconnect\n");
443 MSG_WriteString(&buf, reason);
444 // DP8 TODO: write a simpler func that Sys_HandleCrash() calls
445 // to send a disconnect message indicating we crashed
446 }
450 }
451
453 cls.netcon = NULL;
454
455 // It's possible for a server to disconnect a player with an empty reason
456 // which is checked here rather than above so we don't print "Disconnect by user".
457 if(fmt && reason[0] != '\0')
458 dpsnprintf(cl_connect_status, sizeof(cl_connect_status), "Disconnect: %s", reason);
459 else
460 dp_strlcpy(cl_connect_status, "Disconnected", sizeof(cl_connect_status));
462 }
464 cl.islocalgame = false;
465 cls.signon = 0;
467 Cvar_Callback(&vid_vsync); // might need to re-enable vsync
468
470
471 // If we're dropped mid-connection attempt, it won't clear otherwise.
473
476}
void CL_StopPlayback(void)
Definition cl_demo.c:81
cvar_t csqc_progcrc
Definition cl_main.c:36
cvar_t csqc_progsize
Definition cl_main.c:37
void CL_Parse_ErrorCleanUp(void)
Definition cl_parse.c:4317
void SCR_ClearLoadingScreen(qbool redraw)
Definition cl_screen.c:1918
char cl_connect_status[MAX_QPATH]
User-friendly connection status for the menu and/or loading screen, colours and not supported.
Definition cl_screen.c:1573
cmd_state_t * cmd_local
command interpreter for local commands injected by SVQC, CSQC, MQC, server or client engine code uses...
Definition cmd.c:25
void MSG_WriteString(sizebuf_t *sb, const char *s)
Definition com_msg.c:173
void MSG_WriteByte(sizebuf_t *sb, int c)
Definition com_msg.c:130
int dpvsnprintf(char *buffer, size_t buffersize, const char *format, va_list args)
Returns the number of printed characters, excluding the final '\0' or returns -1 if the buffer isn't ...
Definition common.c:1010
int dpsnprintf(char *buffer, size_t buffersize, const char *format,...)
Returns the number of printed characters, excluding the final '\0' or returns -1 if the buffer isn't ...
Definition common.c:997
@ PROTOCOL_DARKPLACES8
added parting messages. WIP
Definition common.h:134
@ PROTOCOL_QUAKEWORLD
quakeworld protocol
Definition common.h:145
void Con_DPrintf(const char *fmt,...)
A Con_Printf that only shows up if the "developer" cvar is set.
Definition console.c:1544
void Con_DPrint(const char *msg)
A Con_Print that only shows up if the "developer" cvar is set.
Definition console.c:1531
void Cvar_SetValueQuick(cvar_t *var, float value)
Definition cvar.c:473
void Cvar_Callback(cvar_t *var)
Definition cvar.c:372
void FS_UnloadPacks_dlcache(void)
Definition fs.c:1485
host_static_t host
Definition host.c:41
void Curl_Clear_forthismap(void)
Definition libcurl.c:287
void NetConn_Close(netconn_t *conn)
Definition netconn.c:1240
int NetConn_SendUnreliableMessage(netconn_t *conn, sizebuf_t *data, protocolversion_t protocol, int rate, int burstsize, qbool quakesignon_suppressreliables)
Definition netconn.c:844
cvar_t cl_netport
Definition netconn.c:155
#define qw_clc_stringcmd
Definition protocol.h:957
#define clc_disconnect
Definition protocol.h:289
int parsingtextexpectingpingforscores
Definition client.h:955
cshift_t cshifts[NUM_CSHIFTS]
Definition client.h:775
int islocalgame
Definition client.h:746
qbool timedemo
Definition client.h:589
cactive_t state
Definition client.h:568
qbool demorecording
Definition client.h:584
netconn_t * netcon
Definition client.h:630
protocolversion_t protocol
Definition client.h:617
float percent
Definition client.h:507
qbool restless
don't sleep
Definition host.h:49
void(* SV_Shutdown)(void)
Definition host.h:60
struct host_static_t::@12 hook
void Sys_AllowProfiling(qbool enable)
Definition sys_shared.c:65
int Sys_CheckParm(const char *parm)
Definition sys_shared.c:327
cvar_t vid_vsync
Definition vid_shared.c:149

References buf, ca_dedicated, ca_disconnected, cl, cl_connect_status, cl_netport, CL_Parse_ErrorCleanUp(), CL_Stop_f(), CL_StopPlayback(), CL_VM_ShutDown(), clc_disconnect, cls, cmd_local, Con_DPrint(), Con_DPrintf(), Con_Printf(), client_state_t::cshifts, csqc_progcrc, csqc_progsize, Curl_Clear_forthismap(), Cvar_Callback(), Cvar_SetValueQuick(), client_static_t::demoplayback, client_static_t::demorecording, dp_strlcpy, dpsnprintf(), dpvsnprintf(), FS_UnloadPacks_dlcache(), host_static_t::hook, host, client_state_t::islocalgame, MSG_WriteByte(), MSG_WriteString(), client_static_t::netcon, NetConn_Close(), NetConn_SendUnreliableMessage(), NULL, client_state_t::parsingtextexpectingpingforscores, cshift_t::percent, client_static_t::protocol, PROTOCOL_DARKPLACES8, PROTOCOL_QUAKEWORLD, qw_clc_stringcmd, host_static_t::restless, S_StopAllSounds(), SCR_ClearLoadingScreen(), client_static_t::signon, client_static_t::state, host_static_t::SV_Shutdown, Sys_AllowProfiling(), Sys_CheckParm(), client_static_t::timedemo, vid_vsync, and client_state_t::worldmodel.

Referenced by CL_Disconnect(), CL_Disconnect_f(), CL_Init(), CL_ParseServerMessage(), CL_ReadDemoMessage(), CL_SendMove(), CL_VM_Init(), Host_Error(), and NetConn_ClientFrame().

◆ CL_Effect()

void CL_Effect ( vec3_t org,
model_t * model,
int startframe,
int framecount,
float framerate )

Definition at line 816 of file cl_main.c.

817{
818 int i;
819 cl_effect_t *e;
820 if (!model) // sanity check
821 return;
822 if (framerate < 1)
823 {
824 Con_Printf("CL_Effect: framerate %f is < 1\n", framerate);
825 return;
826 }
827 if (framecount < 1)
828 {
829 Con_Printf("CL_Effect: framecount %i is < 1\n", framecount);
830 return;
831 }
832 for (i = 0, e = cl.effects;i < cl.max_effects;i++, e++)
833 {
834 if (e->active)
835 continue;
836 e->active = true;
837 VectorCopy(org, e->origin);
838 e->model = model;
839 e->starttime = cl.time;
840 e->startframe = startframe;
841 e->endframe = startframe + framecount;
842 e->framerate = framerate;
843
844 e->frame = 0;
845 e->frame1time = cl.time;
846 e->frame2time = cl.time;
848 break;
849 }
850}
string model
float framerate
Definition client.h:75
double starttime
Definition client.h:74
double frame2time
Definition client.h:82
double frame1time
Definition client.h:81
vec3_t origin
Definition client.h:73
int active
Definition client.h:72
int frame
Definition client.h:80
int startframe
Definition client.h:77
int endframe
Definition client.h:78
model_t * model
Definition client.h:76

References cl_effect_t::active, cl, Con_Printf(), client_state_t::effects, cl_effect_t::endframe, cl_effect_t::frame, cl_effect_t::frame1time, cl_effect_t::frame2time, cl_effect_t::framerate, i, max, client_state_t::max_effects, cl_effect_t::model, model, client_state_t::num_effects, cl_effect_t::origin, cl_effect_t::startframe, cl_effect_t::starttime, client_state_t::time, and VectorCopy.

Referenced by CL_ParseEffect(), CL_ParseEffect2(), CL_ParseTempEntity(), and VM_CL_effect().

◆ CL_EstablishConnection()

void CL_EstablishConnection ( const char * host,
int firstarg )

Definition at line 574 of file cl_main.c.

575{
576 if (cls.state == ca_dedicated)
577 return;
578
579 // don't connect to a server if we're benchmarking a demo
580 if (Sys_CheckParm("-benchmark"))
581 return;
582
583 // make sure the client ports are open before attempting to connect
585
587 {
588 cls.connect_trying = true;
591
592 // only NOW, set connect_userinfo
593 if(firstarg >= 0)
594 {
595 int i;
597 for(i = firstarg; i+2 <= Cmd_Argc(cmd_local); i += 2)
599 }
600 else if(firstarg < -1)
601 {
602 // -1: keep as is (reconnect)
603 // -2: clear
605 }
606
607 dp_strlcpy(cl_connect_status, "Connect: pending...", sizeof(cl_connect_status));
609 }
610 else
611 {
612 Con_Printf(CON_ERROR "Connect: failed, unable to find a network socket suitable to reach %s\n", address);
613 dp_strlcpy(cl_connect_status, "Connect: failed, no network", sizeof(cl_connect_status));
614 }
615}
void SCR_BeginLoadingPlaque(qbool startup)
Definition cl_screen.c:1838
void InfoString_SetValue(char *buffer, size_t bufferlength, const char *key, const char *value)
#define CON_ERROR
Definition console.h:102
int LHNETADDRESS_FromString(lhnetaddress_t *vaddress, const char *string, int defaultport)
Definition lhnet.c:204
lhnetsocket_t * NetConn_ChooseClientSocketForAddress(lhnetaddress_t *address)
Definition netconn.c:1198
void NetConn_UpdateSockets(void)
Definition netconn.c:1306
char connect_userinfo[MAX_USERINFO_STRING]
Definition client.h:672
qbool connect_trying
Definition client.h:609
int connect_remainingtries
Definition client.h:610
double connect_nextsendtime
Definition client.h:611
lhnetaddress_t connect_address
Definition client.h:613
lhnetsocket_t * connect_mysocket
Definition client.h:612

References ca_dedicated, cl_connect_status, cls, Cmd_Argc(), Cmd_Argv(), cmd_local, CON_ERROR, Con_Printf(), client_static_t::connect_address, client_static_t::connect_mysocket, client_static_t::connect_nextsendtime, client_static_t::connect_remainingtries, client_static_t::connect_trying, client_static_t::connect_userinfo, dp_strlcpy, i, InfoString_SetValue(), LHNETADDRESS_FromString(), NetConn_ChooseClientSocketForAddress(), NetConn_UpdateSockets(), SCR_BeginLoadingPlaque(), client_static_t::state, and Sys_CheckParm().

Referenced by CL_Connect_f(), CL_EstablishConnection_Local(), and CL_Reconnect_f().

◆ CL_ExpandCSQCRenderEntities()

void CL_ExpandCSQCRenderEntities ( int num)

Definition at line 325 of file cl_main.c.

326{
327 int i;
328 int oldmaxcsqcrenderentities;
329 entity_render_t *oldcsqcrenderentities;
330 if (num >= cl.max_csqcrenderentities)
331 {
332 if (num >= MAX_EDICTS)
333 Host_Error("CL_ExpandEntities: num %i >= %i", num, MAX_EDICTS);
334 oldmaxcsqcrenderentities = cl.max_csqcrenderentities;
335 oldcsqcrenderentities = cl.csqcrenderentities;
336 cl.max_csqcrenderentities = (num & ~255) + 256;
338 if (oldcsqcrenderentities)
339 {
340 memcpy(cl.csqcrenderentities, oldcsqcrenderentities, oldmaxcsqcrenderentities * sizeof(entity_render_t));
341 for (i = 0;i < r_refdef.scene.numentities;i++)
342 if(r_refdef.scene.entities[i] >= oldcsqcrenderentities && r_refdef.scene.entities[i] < (oldcsqcrenderentities + oldmaxcsqcrenderentities))
343 r_refdef.scene.entities[i] = cl.csqcrenderentities + (r_refdef.scene.entities[i] - oldcsqcrenderentities);
344 Mem_Free(oldcsqcrenderentities);
345 }
346 }
347}
void Host_Error(const char *error,...)
Definition host.c:85
entity_render_t ** entities
renderable entities (excluding world)
Definition render.h:361
#define Mem_Free(mem)
Definition zone.h:96

References cl, cls, client_state_t::csqcrenderentities, r_refdef_scene_t::entities, Host_Error(), i, client_static_t::levelmempool, client_state_t::max_csqcrenderentities, MAX_EDICTS, Mem_Alloc, Mem_Free, r_refdef_scene_t::numentities, r_refdef, and r_refdef_t::scene.

Referenced by CLVM_init_edict().

◆ CL_ExpandEntities()

void CL_ExpandEntities ( int num)

Definition at line 300 of file cl_main.c.

301{
302 int i, oldmaxentities;
303 entity_t *oldentities;
304 if (num >= cl.max_entities)
305 {
306 if (!cl.entities)
307 Sys_Error("CL_ExpandEntities: cl.entities not initialized");
308 if (num >= MAX_EDICTS)
309 Host_Error("CL_ExpandEntities: num %i >= %i", num, MAX_EDICTS);
310 oldmaxentities = cl.max_entities;
311 oldentities = cl.entities;
312 cl.max_entities = (num & ~255) + 256;
314 memcpy(cl.entities, oldentities, oldmaxentities * sizeof(entity_t));
315 Mem_Free(oldentities);
316 for (i = oldmaxentities;i < cl.max_entities;i++)
317 {
321 }
322 }
323}

References cl, cls, defaultstate, client_state_t::entities, Host_Error(), i, client_static_t::levelmempool, MAX_EDICTS, client_state_t::max_entities, Mem_Alloc, Mem_Free, entity_t::state_baseline, entity_t::state_current, entity_t::state_previous, and Sys_Error().

Referenced by CL_NewBeam(), CL_ParseServerMessage(), CL_ParseStartSoundPacket(), CL_ParseTrailParticles(), EntityFrame4_CL_ReadFrame(), EntityFrame5_CL_ReadFrame(), EntityFrame_CL_ReadFrame(), EntityFrameQuake_ReadEntity(), and EntityFrameQW_CL_ReadFrame().

◆ CL_FindNonSolidLocation()

◆ CL_ForwardToServer()

void CL_ForwardToServer ( const char * s)

adds the string as a clc_stringcmd to the client message.

(used when there is no reason to generate a local command to do it)

Definition at line 54 of file cl_cmd.c.

55{
56 char temp[128];
57 if (cls.state != ca_connected)
58 {
59 Con_Printf("Can't \"%s\", not connected\n", s);
60 return;
61 }
62
63 if (!cls.netcon)
64 return;
65
66 // LadyHavoc: thanks to Fuh for bringing the pure evil of SZ_Print to my
67 // attention, it has been eradicated from here, its only (former) use in
68 // all of darkplaces.
71 else
73 if ((!strncmp(s, "say ", 4) || !strncmp(s, "say_team ", 9)) && cl_locs_enable.integer)
74 {
75 // say/say_team commands can replace % character codes with status info
76 while (*s)
77 {
78 if (*s == '%' && s[1])
79 {
80 // handle proquake message macros
81 temp[0] = 0;
82 switch (s[1])
83 {
84 case 'l': // current location
85 CL_Locs_FindLocationName(temp, sizeof(temp), cl.movement_origin);
86 break;
87 case 'h': // current health
88 dpsnprintf(temp, sizeof(temp), "%i", cl.stats[STAT_HEALTH]);
89 break;
90 case 'a': // current armor
91 dpsnprintf(temp, sizeof(temp), "%i", cl.stats[STAT_ARMOR]);
92 break;
93 case 'x': // current rockets
94 dpsnprintf(temp, sizeof(temp), "%i", cl.stats[STAT_ROCKETS]);
95 break;
96 case 'c': // current cells
97 dpsnprintf(temp, sizeof(temp), "%i", cl.stats[STAT_CELLS]);
98 break;
99 // silly proquake macros
100 case 'd': // loc at last death
101 CL_Locs_FindLocationName(temp, sizeof(temp), cl.lastdeathorigin);
102 break;
103 case 't': // current time
104 dpsnprintf(temp, sizeof(temp), "%.0f:%.0f", floor(cl.time / 60), cl.time - floor(cl.time / 60) * 60);
105 break;
106 case 'r': // rocket launcher status ("I have RL", "I need rockets", "I need RL")
108 dpsnprintf(temp, sizeof(temp), "I need RL");
109 else if (!cl.stats[STAT_ROCKETS])
110 dpsnprintf(temp, sizeof(temp), "I need rockets");
111 else
112 dpsnprintf(temp, sizeof(temp), "I have RL");
113 break;
114 case 'p': // powerup status (outputs "quad" "pent" and "eyes" according to status)
115 if (cl.stats[STAT_ITEMS] & IT_QUAD)
116 {
117 if (temp[0])
118 dp_strlcat(temp, " ", sizeof(temp));
119 dp_strlcat(temp, "quad", sizeof(temp));
120 }
122 {
123 if (temp[0])
124 dp_strlcat(temp, " ", sizeof(temp));
125 dp_strlcat(temp, "pent", sizeof(temp));
126 }
128 {
129 if (temp[0])
130 dp_strlcat(temp, " ", sizeof(temp));
131 dp_strlcat(temp, "eyes", sizeof(temp));
132 }
133 break;
134 case 'w': // weapon status (outputs "SSG:NG:SNG:GL:RL:LG" with the text between : characters omitted if you lack the weapon)
136 dp_strlcat(temp, "SSG", sizeof(temp));
137 dp_strlcat(temp, ":", sizeof(temp));
139 dp_strlcat(temp, "NG", sizeof(temp));
140 dp_strlcat(temp, ":", sizeof(temp));
142 dp_strlcat(temp, "SNG", sizeof(temp));
143 dp_strlcat(temp, ":", sizeof(temp));
145 dp_strlcat(temp, "GL", sizeof(temp));
146 dp_strlcat(temp, ":", sizeof(temp));
148 dp_strlcat(temp, "RL", sizeof(temp));
149 dp_strlcat(temp, ":", sizeof(temp));
151 dp_strlcat(temp, "LG", sizeof(temp));
152 break;
153 default:
154 // not a recognized macro, print it as-is...
155 temp[0] = s[0];
156 temp[1] = s[1];
157 temp[2] = 0;
158 break;
159 }
160 // write the resulting text
161 SZ_Write(&cls.netcon->message, (unsigned char *)temp, (int)strlen(temp));
162 s += 2;
163 continue;
164 }
166 s++;
167 }
169 }
170 else // any other command is passed on as-is
171 SZ_Write(&cls.netcon->message, (const unsigned char *)s, (int)strlen(s) + 1);
172}
void CL_Locs_FindLocationName(char *buffer, size_t buffersize, vec3_t point)
Definition cl_main.c:2218
cvar_t cl_locs_enable
Definition cl_main.c:97
void SZ_Write(sizebuf_t *buf, const unsigned char *data, int length)
Definition common.c:72
#define dp_strlcat(dst, src, dsize)
Definition common.h:304
float strlen(string s)
float floor(float f)
#define clc_stringcmd
Definition protocol.h:291
#define STAT_CELLS
Definition qstats.h:17
#define STAT_ARMOR
Definition qstats.h:12
#define STAT_ITEMS
FTE, DP.
Definition qstats.h:23
#define STAT_ROCKETS
Definition qstats.h:16
#define IT_LIGHTNING
Definition quakedef.h:44
#define IT_GRENADE_LAUNCHER
Definition quakedef.h:42
#define IT_SUPER_SHOTGUN
Definition quakedef.h:39
#define IT_NAILGUN
Definition quakedef.h:40
#define IT_INVISIBILITY
Definition quakedef.h:57
#define IT_ROCKET_LAUNCHER
Definition quakedef.h:43
#define IT_INVULNERABILITY
Definition quakedef.h:58
#define IT_SUPER_NAILGUN
Definition quakedef.h:41
#define IT_QUAD
Definition quakedef.h:60
vec3_t lastdeathorigin
Definition client.h:1128
sizebuf_t message
writing buffer to send to peer as the next reliable message can be added to at any time,...
Definition netconn.h:161

References ca_connected, cl, cl_locs_enable, CL_Locs_FindLocationName(), clc_stringcmd, cls, Con_Printf(), dp_strlcat, dpsnprintf(), floor(), cvar_t::integer, IT_GRENADE_LAUNCHER, IT_INVISIBILITY, IT_INVULNERABILITY, IT_LIGHTNING, IT_NAILGUN, IT_QUAD, IT_ROCKET_LAUNCHER, IT_SUPER_NAILGUN, IT_SUPER_SHOTGUN, client_state_t::lastdeathorigin, netconn_t::message, client_state_t::movement_origin, MSG_WriteByte(), client_static_t::netcon, client_static_t::protocol, PROTOCOL_QUAKEWORLD, qw_clc_stringcmd, STAT_ARMOR, STAT_CELLS, STAT_HEALTH, STAT_ITEMS, STAT_ROCKETS, client_static_t::state, client_state_t::stats, strlen(), SZ_Write(), and client_state_t::time.

Referenced by CL_BeginDownloads(), CL_DownloadBegin_f(), CL_ForwardToServer_f(), CL_SendCvar_f(), Key_Message(), and NetConn_ConnectionEstablished().

◆ CL_ForwardToServer_f()

void CL_ForwardToServer_f ( cmd_state_t * cmd)

adds the current command line as a clc_stringcmd to the client message.

things like godmode, noclip, etc, are commands directed to the server, so when they are typed in at the console, they will need to be forwarded.

Definition at line 174 of file cl_cmd.c.

175{
176 const char *s;
177 char vabuf[MAX_INPUTLINE];
178 size_t i;
179 if (!strcasecmp(Cmd_Argv(cmd, 0), "cmd"))
180 {
181 // we want to strip off "cmd", so just send the args
182 s = Cmd_Argc(cmd) > 1 ? Cmd_Args(cmd) : "";
183 }
184 else
185 {
186 // we need to keep the command name, so send Cmd_Argv(cmd, 0), a space and then Cmd_Args(cmd)
187 i = dpsnprintf(vabuf, sizeof(vabuf), "%s", Cmd_Argv(cmd, 0));
188 if(Cmd_Argc(cmd) > 1)
189 // (i + 1) accounts for the added space
190 dpsnprintf(&vabuf[i], sizeof(vabuf) - (i + 1), " %s", Cmd_Args(cmd));
191 s = vabuf;
192 }
193 // don't send an empty forward message if the user tries "cmd" by itself
194 if (!s || !*s)
195 return;
197}
void CL_ForwardToServer(const char *s)
adds the string as a clc_stringcmd to the client message.
Definition cl_cmd.c:54
static const char * Cmd_Args(cmd_state_t *cmd)
Definition cmd.h:260
#define MAX_INPUTLINE
maximum size of console commandline, QuakeC strings, and many other text processing buffers
Definition qdefs.h:94

References CL_ForwardToServer(), cmd(), Cmd_Argc(), Cmd_Args(), Cmd_Argv(), dpsnprintf(), i, and MAX_INPUTLINE.

Referenced by CL_InitCommands(), and Cmd_CL_Callback().

◆ CL_Frame()

double CL_Frame ( double time)

Definition at line 2802 of file cl_main.c.

2803{
2804 static double clframetime;
2805 static double cl_timer = 0;
2806 static double time1 = 0, time2 = 0, time3 = 0;
2807 int pass1, pass2, pass3;
2808 float maxfps;
2809
2811
2812 /*
2813 * If the accumulator hasn't become positive, don't
2814 * run the frame. Everything that happens before this
2815 * point will happen even if we're sleeping this frame.
2816 */
2817
2818 // limit the frametime steps to no more than 100ms each
2819 cl_timer = min(cl_timer + time, 0.1);
2820
2821 // Run at full speed when querying servers, compared to waking up early to parse
2822 // this is simpler and gives pings more representative of what can be expected when playing.
2824
2825 if (cls.state != ca_dedicated && (cl_timer > 0 || host.restless || maxfps <= 0))
2826 {
2827 R_TimeReport("---");
2829 R_TimeReport("photoncache");
2830#ifdef CONFIG_VIDEO_CAPTURE
2831 // decide the simulation time
2832 if (cls.capturevideo.active)
2833 {
2834 if (cls.capturevideo.realtime)
2835 clframetime = cl.realframetime = max(time, 1.0 / cls.capturevideo.framerate);
2836 else
2837 {
2838 clframetime = 1.0 / cls.capturevideo.framerate;
2839 cl.realframetime = max(time, clframetime);
2840 }
2841 }
2842 else
2843#endif
2844 {
2845 if (maxfps <= 0 || cls.timedemo)
2846 clframetime = cl.realframetime = cl_timer;
2847 else
2848 // networking assumes at least 10fps
2849 clframetime = cl.realframetime = bound(cl_timer, 1 / maxfps, 0.1);
2850
2851 // on some legacy systems, we need to sleep to keep input responsive
2854 }
2855
2856 // apply slowmo scaling
2857 clframetime *= cl.movevars_timescale;
2858 // scale playback speed of demos by slowmo cvar
2859 if (cls.demoplayback)
2860 {
2861 clframetime *= host_timescale.value;
2862 // if demo playback is paused, don't advance time at all
2863 if (cls.demopaused)
2864 clframetime = 0;
2865 }
2866 else
2867 {
2868 // host_framerate overrides all else
2870 clframetime = host_framerate.value;
2871
2872 if (cl.paused || host.paused)
2873 clframetime = 0;
2874 }
2875
2876 // deduct the frame time from the accumulator
2877 cl_timer -= cl.realframetime;
2878
2879 cl.oldtime = cl.time;
2880 cl.time += clframetime;
2881
2882 // update video
2883 if (host_speeds.integer)
2884 time1 = Sys_DirtyTime();
2885 R_TimeReport("pre-input");
2886
2887 // Collect input into cmd
2888 CL_Input();
2889
2890 R_TimeReport("input");
2891
2892 // check for new packets
2894
2895 // read a new frame from a demo if needed
2897 R_TimeReport("clientnetwork");
2898
2899 // now that packets have been read, send input to server
2900 CL_SendMove();
2901 R_TimeReport("sendmove");
2902
2903 // update client world (interpolate entities, create trails, etc)
2905 R_TimeReport("lerpworld");
2906
2908
2909 R_TimeReport("client");
2910
2912 R_TimeReport("render");
2913
2914 if (host_speeds.integer)
2915 time2 = Sys_DirtyTime();
2916
2917 // update audio
2919 {
2921 cl.csqc_usecsqclistener = false;
2922 }
2923 else
2925
2927 R_TimeReport("audio");
2928
2929 // reset gathering of mouse input
2930 in_mouse_x = in_mouse_y = 0;
2931
2932 if (host_speeds.integer)
2933 {
2934 pass1 = (int)((time1 - time3)*1000000);
2935 time3 = Sys_DirtyTime();
2936 pass2 = (int)((time2 - time1)*1000000);
2937 pass3 = (int)((time3 - time2)*1000000);
2938 Con_Printf("%6ius total %6ius server %6ius gfx %6ius snd\n",
2939 pass1+pass2+pass3, pass1, pass2, pass3);
2940 }
2941 }
2942 // if there is some time remaining from this frame, reset the timer
2943 return cl_timer >= 0 ? 0 : cl_timer;
2944}
void CDAudio_Update(void)
Definition cd_shared.c:522
void CL_ReadDemoMessage(void)
Definition cl_demo.c:187
void CL_Input(void)
Definition cl_input.c:483
void CL_SendMove(void)
Definition cl_input.c:1771
cvar_t host_timescale
Definition sv_main.c:228
cvar_t host_speeds
Definition host.c:46
void CL_UpdateWorld(void)
Definition cl_main.c:2052
cvar_t host_framerate
Definition host.c:44
cvar_t cl_maxfps
Definition cl_main.c:108
cvar_t cl_maxidlefps
Definition cl_main.c:110
cvar_t cl_maxfps_alwayssleep
Definition cl_main.c:109
uint8_t serverlist_querystage
bitfield because in theory we could be doing QW & DP simultaneously
Definition netconn.c:129
void CL_UpdateScreen(void)
Definition cl_screen.c:2130
void CL_Video_Frame(void)
Definition cl_video.c:355
void Collision_Cache_NewFrame(void)
Definition collision.c:1548
void CL_VM_PreventInformationLeaks(void)
Definition csprogs.c:36
float time
GLsizei const GLfloat * value
Definition glquake.h:740
float in_mouse_y
Definition input.h:33
float in_mouse_x
Definition vid_shared.c:70
#define min(A, B)
Definition mathlib.h:37
#define bound(min, num, max)
Definition mathlib.h:34
void NetConn_ClientFrame(void)
Definition netconn.c:2674
void R_TimeReport(const char *desc)
Definition r_stats.c:193
void S_Update(const matrix4x4_t *listenermatrix)
Definition snd_main.c:2061
float movevars_timescale
Definition client.h:1058
double oldtime
Definition client.h:868
qbool csqc_usecsqclistener
Definition client.h:1116
qbool paused
Definition client.h:842
double realframetime
Definition client.h:871
matrix4x4_t csqc_listenermatrix
Definition client.h:1117
qbool demopaused
Definition client.h:604
qbool paused
global paused state, pauses both client and server
Definition host.h:50
double Sys_DirtyTime(void)
Definition sys_shared.c:417
double Sys_Sleep(double time)
called to yield for a little bit so as not to hog cpu when paused or debugging
Definition sys_shared.c:500
qbool vid_activewindow
Definition vid_shared.c:77

References bound, ca_dedicated, CDAudio_Update(), cl, CL_Input(), cl_maxfps, cl_maxfps_alwayssleep, cl_maxidlefps, CL_ReadDemoMessage(), CL_SendMove(), CL_UpdateScreen(), CL_UpdateWorld(), CL_Video_Frame(), CL_VM_PreventInformationLeaks(), cls, Collision_Cache_NewFrame(), Con_Printf(), client_state_t::csqc_listenermatrix, client_state_t::csqc_usecsqclistener, client_static_t::demopaused, client_static_t::demoplayback, host, host_framerate, host_speeds, host_timescale, in_mouse_x, in_mouse_y, int(), cvar_t::integer, r_refdef_view_t::matrix, max, min, client_state_t::movevars_timescale, NetConn_ClientFrame(), client_state_t::oldtime, client_state_t::paused, host_static_t::paused, r_refdef, R_TimeReport(), client_state_t::realframetime, host_static_t::restless, S_Update(), serverlist_querystage, client_static_t::state, Sys_DirtyTime(), Sys_Sleep(), client_state_t::time, time, client_static_t::timedemo, cvar_t::value, value, vid_activewindow, and r_refdef_t::view.

Referenced by Host_Frame().

◆ CL_Init()

void CL_Init ( void )

Definition at line 2988 of file cl_main.c.

2989{
2990 if (cls.state == ca_dedicated)
2991 {
2992 Cmd_AddCommand(CF_SERVER, "disconnect", CL_Disconnect_f, "disconnect from server (or disconnect all clients if running a server)");
2993 }
2994 else
2995 {
2996 Con_Printf("Initializing client\n");
2997
2999
3001 Palette_Init();
3002#ifdef CONFIG_MENU
3004#endif
3006 VID_Init();
3007 Render_Init();
3008 S_Init();
3009 Key_Init();
3010 V_Init();
3011
3012 cls.levelmempool = Mem_AllocPool("client (per-level memory)", 0, NULL);
3013 cls.permanentmempool = Mem_AllocPool("client (long term memory)", 0, NULL);
3014
3015 memset(&r_refdef, 0, sizeof(r_refdef));
3016 // max entities sent to renderer per frame
3017 r_refdef.scene.maxentities = MAX_EDICTS + 256 + 512;
3019
3020 // max temp entities
3023
3024 CL_InitInput ();
3025
3026 //
3027 // register our commands
3028 //
3030
3049
3054
3057
3058 CL_Demo_Init();
3059
3060 Cmd_AddCommand(CF_CLIENT, "entities", CL_PrintEntities_f, "print information on network entities known to client");
3061 Cmd_AddCommand(CF_CLIENT, "disconnect", CL_Disconnect_f, "disconnect from server (or disconnect all clients if running a server)");
3062 Cmd_AddCommand(CF_CLIENT, "connect", CL_Connect_f, "connect to a server by IP address or hostname");
3063 Cmd_AddCommand(CF_CLIENT | CF_CLIENT_FROM_SERVER, "reconnect", CL_Reconnect_f, "reconnect to the last server you were on, or resets a quakeworld connection (do not use if currently playing on a netquake server)");
3064
3065 // Support Client-side Model Index List
3066 Cmd_AddCommand(CF_CLIENT, "cl_modelindexlist", CL_ModelIndexList_f, "list information on all models in the client modelindex");
3067 // Support Client-side Sound Index List
3068 Cmd_AddCommand(CF_CLIENT, "cl_soundindexlist", CL_SoundIndexList_f, "list all sounds in the client soundindex");
3069
3070 Cmd_AddCommand(CF_CLIENT, "fog", CL_Fog_f, "set global fog parameters (density red green blue [alpha [mindist [maxdist [top [fadedepth]]]]])");
3071 Cmd_AddCommand(CF_CLIENT, "fog_heighttexture", CL_Fog_HeightTexture_f, "set global fog parameters (density red green blue alpha mindist maxdist top depth textures/mapname/fogheight.tga)");
3072
3073 Cmd_AddCommand(CF_CLIENT, "cl_areastats", CL_AreaStats_f, "prints statistics on entity culling during collision traces");
3074
3090
3093
3095
3096 // for QW connections
3098 // multiplying by RAND_MAX necessary for Windows, for which RAND_MAX is only 32767.
3099 Cvar_SetValueQuick(&qport, ((unsigned int)rand() * RAND_MAX + (unsigned int)rand()) & 0xffff);
3100
3101 Cmd_AddCommand(CF_CLIENT, "timerefresh", CL_TimeRefresh_f, "turn quickly and print rendering statistcs");
3102
3105 Cmd_AddCommand(CF_CLIENT, "locs_add", CL_Locs_Add_f, "add a point or box location (usage: x y z[ x y z] \"name\", if two sets of xyz are supplied it is a box, otherwise point)");
3106 Cmd_AddCommand(CF_CLIENT, "locs_removenearest", CL_Locs_RemoveNearest_f, "remove the nearest point or box (note: you need to be very near a box to remove it)");
3107 Cmd_AddCommand(CF_CLIENT, "locs_clear", CL_Locs_Clear_f, "remove all loc points/boxes");
3108 Cmd_AddCommand(CF_CLIENT, "locs_reload", CL_Locs_Reload_f, "reload .loc file for this map");
3109 Cmd_AddCommand(CF_CLIENT, "locs_save", CL_Locs_Save_f, "save .loc file for this map containing currently defined points and boxes");
3110
3113
3125
3128
3129 CL_Parse_Init();
3132
3133 CL_Video_Init();
3134
3136
3140 }
3141}
void CL_InitCommands(void)
Definition cl_cmd.c:742
void CL_Demo_Init(void)
Definition cl_demo.c:737
cvar_t cl_yawspeed
Definition cl_input.c:372
cvar_t cl_backspeed
Definition cl_input.c:366
cvar_t cl_sidespeed
Definition cl_input.c:367
cvar_t cl_pitchspeed
Definition cl_input.c:373
cvar_t cl_upspeed
Definition cl_input.c:364
void CL_InitInput(void)
Definition cl_input.c:2209
cvar_t cl_anglespeedkey
Definition cl_input.c:375
cvar_t cl_movespeedkey
Definition cl_input.c:369
cvar_t cl_forwardspeed
Definition cl_input.c:365
static void CL_Reconnect_f(cmd_state_t *cmd)
Definition cl_main.c:491
static void CL_ToggleMenu_Hook(void)
Definition cl_main.c:349
cvar_t cl_explosions_lifetime
Definition cl_main.c:73
cvar_t cl_noplayershadow
Definition cl_main.c:85
cvar_t cl_minfps_qualitystepmax
Definition cl_main.c:106
static void CL_PrintEntities_f(cmd_state_t *cmd)
Definition cl_main.c:629
cvar_t cl_minfps_qualitymin
Definition cl_main.c:103
cvar_t cl_lerpexcess
Definition cl_main.c:44
static void CL_TimeRefresh_f(cmd_state_t *cmd)
Definition cl_main.c:2171
cvar_t freelook
Definition cl_main.c:60
cvar_t lookspring
Definition cl_main.c:51
cvar_t cl_prydoncursor_notrace
Definition cl_main.c:93
cvar_t cl_minfps
Definition cl_main.c:100
cvar_t qport
Definition cl_main.c:90
void CL_Disconnect_f(cmd_state_t *cmd)
Definition cl_main.c:559
cvar_t cl_stainmaps_clearonload
Definition cl_main.c:76
cvar_t m_side
Definition cl_main.c:58
cvar_t cl_dlights_decaybrightness
Definition cl_main.c:88
cvar_t m_yaw
Definition cl_main.c:56
cvar_t cl_minfps_qualitymax
Definition cl_main.c:102
cvar_t m_forward
Definition cl_main.c:57
static void CL_AreaStats_f(cmd_state_t *cmd)
Definition cl_main.c:2188
cvar_t cl_explosions_size_start
Definition cl_main.c:71
cvar_t cl_lerpanim_maxdelta_server
Definition cl_main.c:45
static void CL_Fog_f(cmd_state_t *cmd)
Definition cl_main.c:2110
cvar_t cl_nolerp
Definition cl_main.c:43
cvar_t cl_explosions_size_end
Definition cl_main.c:72
cvar_t cl_gameplayfix_nudgeoutofsolid_separation
Definition cl_main.c:113
cvar_t cl_itembobspeed
Definition cl_main.c:49
static void CL_Connect_f(cmd_state_t *cmd)
Definition cl_main.c:546
cvar_t cl_stainmaps
Definition cl_main.c:75
cvar_t r_draweffects
Definition cl_main.c:67
static void CL_ModelIndexList_f(cmd_state_t *cmd)
Definition cl_main.c:656
cvar_t csqc_polygons_defaultmaterial_nocullface
Definition cl_main.c:39
cvar_t cl_locs_show
Definition cl_main.c:98
static void CL_Locs_Save_f(cmd_state_t *cmd)
Definition cl_main.c:2301
static void CL_EstablishConnection_Local(void)
Definition cl_main.c:617
cvar_t sensitivity
Definition cl_main.c:53
void CL_Locs_Reload_f(cmd_state_t *cmd)
Definition cl_main.c:2377
cvar_t cl_deathfade
Definition cl_main.c:83
cvar_t cl_beams_polygons
Definition cl_main.c:78
cvar_t cl_deathnoviewmodel
Definition cl_main.c:95
cvar_t csqc_lowres
Definition cl_main.c:40
cvar_t cl_shownet
Definition cl_main.c:42
cvar_t cl_itembobheight
Definition cl_main.c:48
cvar_t cl_explosions_alpha_start
Definition cl_main.c:69
cvar_t cl_lerpanim_maxdelta_framegroups
Definition cl_main.c:46
static void CL_SoundIndexList_f(cmd_state_t *cmd)
Definition cl_main.c:684
cvar_t cl_beams_lightatend
Definition cl_main.c:81
cvar_t cl_minfps_force
Definition cl_main.c:107
cvar_t cl_dlights_decayradius
Definition cl_main.c:87
cvar_t cl_minfps_fade
Definition cl_main.c:101
cvar_t cl_explosions_alpha_end
Definition cl_main.c:70
static void CL_Locs_Clear_f(cmd_state_t *cmd)
Definition cl_main.c:2295
static void CL_Locs_Add_f(cmd_state_t *cmd)
Definition cl_main.c:2263
cvar_t cl_prydoncursor
Definition cl_main.c:92
cvar_t m_pitch
Definition cl_main.c:55
cvar_t cl_minfps_qualityhysteresis
Definition cl_main.c:105
static void CL_Fog_HeightTexture_f(cmd_state_t *cmd)
Definition cl_main.c:2143
cvar_t lookstrafe
Definition cl_main.c:52
cvar_t cl_minfps_qualitymultiply
Definition cl_main.c:104
cvar_t cl_areagrid_link_SOLID_NOT
Definition cl_main.c:112
static void CL_Locs_RemoveNearest_f(cmd_state_t *cmd)
Definition cl_main.c:2285
void CL_Parse_Init(void)
Definition cl_parse.c:4323
void CL_Particles_Init(void)
void CL_Screen_Init(void)
Definition cl_screen.c:804
void CL_Video_Init(void)
Definition cl_video.c:675
#define CF_SERVER
cvar/command that only the server can change/execute
Definition cmd.h:49
#define CF_CLIENT_FROM_SERVER
command that the server is allowed to execute on the client
Definition cmd.h:50
void Render_Init(void)
Definition gl_rmain.c:3420
cvar_t host_isclient
Definition host.c:61
void Key_Init(void)
Definition keys.c:1710
void MR_Init_Commands(void)
Definition menu.c:5533
void Palette_Init(void)
Definition palette.c:366
#define MAX_TEMPENTITIES
max number of temporary models visible per frame (certain sprite effects, certain types of CSQC entit...
Definition qdefs.h:159
void R_Modules_Init(void)
Definition r_modules.c:20
void S_Init(void)
Definition snd_main.c:706
void(* ConnectLocal)(void)
Definition host.h:55
void(* ToggleMenu)(void)
Definition host.h:57
void(* Disconnect)(qbool, const char *,...)
Definition host.h:56
void VID_Shared_Init(void)
void VID_Init(void)
Called at startup.
Definition vid_null.c:36
void V_Init(void)
Definition view.c:1196
#define Mem_AllocPool(name, flags, parent)
Definition zone.h:104

References ca_dedicated, CF_CLIENT, CF_CLIENT_FROM_SERVER, CF_SERVER, cl_anglespeedkey, cl_areagrid_link_SOLID_NOT, CL_AreaStats_f(), cl_backspeed, cl_beams_instantaimhack, cl_beams_lightatend, cl_beams_polygons, cl_beams_quakepositionhack, CL_Connect_f(), cl_deathfade, cl_deathnoviewmodel, CL_Demo_Init(), CL_Disconnect_f(), CL_DisconnectEx(), cl_dlights_decaybrightness, cl_dlights_decayradius, CL_EstablishConnection_Local(), cl_explosions_alpha_end, cl_explosions_alpha_start, cl_explosions_lifetime, cl_explosions_size_end, cl_explosions_size_start, CL_Fog_f(), CL_Fog_HeightTexture_f(), cl_forwardspeed, cl_gameplayfix_nudgeoutofsolid_separation, CL_InitCommands(), CL_InitInput(), cl_itembobheight, cl_itembobspeed, cl_lerpanim_maxdelta_framegroups, cl_lerpanim_maxdelta_server, cl_lerpexcess, CL_Locs_Add_f(), CL_Locs_Clear_f(), cl_locs_enable, CL_Locs_Reload_f(), CL_Locs_RemoveNearest_f(), CL_Locs_Save_f(), cl_locs_show, cl_maxfps, cl_maxfps_alwayssleep, cl_maxidlefps, cl_minfps, cl_minfps_fade, cl_minfps_force, cl_minfps_qualityhysteresis, cl_minfps_qualitymax, cl_minfps_qualitymin, cl_minfps_qualitymultiply, cl_minfps_qualitystepmax, CL_ModelIndexList_f(), cl_movespeedkey, cl_netport, cl_nolerp, cl_noplayershadow, CL_Parse_Init(), CL_Particles_Init(), cl_pitchspeed, CL_PrintEntities_f(), cl_prydoncursor, cl_prydoncursor_notrace, CL_Reconnect_f(), CL_Screen_Init(), cl_shownet, cl_sidespeed, CL_SoundIndexList_f(), cl_stainmaps, cl_stainmaps_clearonload, CL_TimeRefresh_f(), CL_ToggleMenu_Hook(), cl_upspeed, CL_Video_Init(), cl_yawspeed, cls, Cmd_AddCommand(), Con_Printf(), host_static_t::ConnectLocal, csqc_lowres, csqc_polygons_defaultmaterial_nocullface, Cvar_Callback(), Cvar_RegisterVariable(), Cvar_SetValueQuick(), host_static_t::Disconnect, r_refdef_scene_t::entities, freelook, host_static_t::hook, host, host_isclient, Key_Init(), client_static_t::levelmempool, lookspring, lookstrafe, m_forward, m_pitch, m_side, m_yaw, MAX_EDICTS, MAX_TEMPENTITIES, r_refdef_scene_t::maxentities, r_refdef_scene_t::maxtempentities, Mem_Alloc, Mem_AllocPool, MR_Init_Commands(), NULL, Palette_Init(), client_static_t::permanentmempool, qport, r_draweffects, R_Modules_Init(), r_refdef, Render_Init(), S_Init(), r_refdef_t::scene, sensitivity, client_static_t::state, r_refdef_scene_t::tempentities, host_static_t::ToggleMenu, V_Init(), VID_Init(), and VID_Shared_Init().

Referenced by Host_Init().

◆ CL_InitCommands()

void CL_InitCommands ( void )

Definition at line 742 of file cl_cmd.c.

743{
744 dpsnprintf(cls.userinfo, sizeof(cls.userinfo), "\\name\\player\\team\\none\\topcolor\\0\\bottomcolor\\0\\rate\\10000\\msg\\1\\noaim\\1\\*ver\\dp");
745
746 /* In Quake `name` is a command that concatenates its arguments (quotes unnecessary)
747 * which is expected in most DP-based games.
748 * In QuakeWorld it's a cvar which requires quotes if spaces are used.
749 */
751 if ((0)) // TODO: if (gamemode == GAME_QUAKEWORLD)
753 else
754 Cmd_AddCommand(CF_CLIENT, "name", CL_Name_f, "change your player name");
755
757 Cvar_RegisterVirtual(&cl_rate, "_cl_rate");
759 Cvar_RegisterVirtual(&cl_rate_burstsize, "_cl_rate_burstsize");
761 Cvar_RegisterVirtual(&cl_pmodel, "_cl_pmodel");
772
773 Cmd_AddCommand(CF_CLIENT | CF_CLIENT_FROM_SERVER, "cmd", CL_ForwardToServer_f, "send a console commandline to the server (used by some mods)");
774 Cmd_AddCommand(CF_CLIENT, "color", CL_Color_f, "change your player shirt and pants colors");
775 Cmd_AddCommand(CF_CLIENT, "rcon", CL_Rcon_f, "sends a command to the server console (if your rcon_password matches the server's rcon_password), or to the address specified by rcon_address when not connected (again rcon_password must match the server's); note: if rcon_secure is set, client and server clocks must be synced e.g. via NTP");
776 Cmd_AddCommand(CF_CLIENT, "srcon", CL_Rcon_f, "sends a command to the server console (if your rcon_password matches the server's rcon_password), or to the address specified by rcon_address when not connected (again rcon_password must match the server's); this always works as if rcon_secure is set; note: client and server clocks must be synced e.g. via NTP");
777 Cmd_AddCommand(CF_CLIENT, "pqrcon", CL_PQRcon_f, "sends a command to a proquake server console (if your rcon_password matches the server's rcon_password), or to the address specified by rcon_address when not connected (again rcon_password must match the server's)");
778 Cmd_AddCommand(CF_SHARED, "user", CL_User_f, "prints additional information about a player number or name on the scoreboard");
779 Cmd_AddCommand(CF_SHARED, "users", CL_Users_f, "prints additional information about all players on the scoreboard");
780 Cmd_AddCommand(CF_CLIENT, "packet", CL_Packet_f, "send a packet to the specified address:port containing a text string");
781 Cmd_AddCommand(CF_CLIENT, "fullinfo", CL_FullInfo_f, "allows client to modify their userinfo");
782 Cmd_AddCommand(CF_CLIENT, "setinfo", CL_SetInfo_f, "modifies your userinfo");
783 Cmd_AddCommand(CF_CLIENT, "fixtrans", Image_FixTransparentPixels_f, "change alpha-zero pixels in an image file to sensible values, and write out a new TGA (warning: SLOW)");
785
786 // commands that are only sent by server to client for execution
787 Cmd_AddCommand(CF_CLIENT_FROM_SERVER, "pingplreport", CL_PingPLReport_f, "command sent by server containing client ping and packet loss values for scoreboard, triggered by pings command from client (not used by QW servers)");
788 Cmd_AddCommand(CF_CLIENT_FROM_SERVER, "fullserverinfo", CL_FullServerinfo_f, "internal use only, sent by server to client to update client's local copy of serverinfo string");
789}
static void CL_PQRcon_f(cmd_state_t *cmd)
Definition cl_cmd.c:486
static void CL_FullInfo_f(cmd_state_t *cmd)
Definition cl_cmd.c:655
static void CL_SetInfo_f(cmd_state_t *cmd)
Definition cl_cmd.c:709
static void CL_Color_c(cvar_t *var)
Definition cl_cmd.c:255
cvar_t r_fixtrans_auto
Definition cl_cmd.c:42
static void CL_Rcon_f(cmd_state_t *cmd)
Definition cl_cmd.c:544
void CL_ForwardToServer_f(cmd_state_t *cmd)
adds the current command line as a clc_stringcmd to the client message.
Definition cl_cmd.c:174
static void CL_PingPLReport_f(cmd_state_t *cmd)
Definition cl_cmd.c:724
cvar_t cl_color
Definition cl_cmd.c:252
cvar_t cl_rate_burstsize
Definition cl_cmd.c:34
static void CL_SendCvar_f(cmd_state_t *cmd)
Definition cl_cmd.c:199
static void CL_FullServerinfo_f(cmd_state_t *cmd)
Definition cl_cmd.c:633
cvar_t cl_bottomcolor
Definition cl_cmd.c:36
cvar_t cl_rate
Definition cl_cmd.c:33
static void CL_Color_f(cmd_state_t *cmd)
Definition cl_cmd.c:293
cvar_t cl_name
User-visible names of these CF_USERINFO cvars must be matched in CL_SetInfo()!
Definition cl_cmd.c:32
static void CL_Topcolor_c(cvar_t *var)
Definition cl_cmd.c:271
static void CL_Name_f(cmd_state_t *cmd)
Definition cl_cmd.c:228
cvar_t cl_skin
Definition cl_cmd.c:38
cvar_t cl_noaim
Definition cl_cmd.c:39
static void CL_Users_f(cmd_state_t *cmd)
Definition cl_cmd.c:384
cvar_t cl_topcolor
Definition cl_cmd.c:35
cvar_t cl_team
Definition cl_cmd.c:37
static void CL_Bottomcolor_c(cvar_t *var)
Definition cl_cmd.c:282
static void CL_Packet_f(cmd_state_t *cmd)
Definition cl_cmd.c:413
cvar_t cl_pmodel
Definition cl_cmd.c:40
static void CL_User_f(cmd_state_t *cmd)
Definition cl_cmd.c:351
#define CF_SHARED
Definition cmd.h:67
void Cvar_RegisterVirtual(cvar_t *variable, const char *name)
Definition cvar.c:513
void Cvar_RegisterCallback(cvar_t *variable, void(*callback)(cvar_t *))
Definition cvar.c:495
void Image_FixTransparentPixels_f(cmd_state_t *cmd)
Definition image.c:1376
char userinfo[MAX_USERINFO_STRING]
Definition client.h:669
void(* CL_SendCvar)(struct cmd_state_s *)
Definition host.h:58

References CF_CLIENT, CF_CLIENT_FROM_SERVER, CF_SHARED, cl_bottomcolor, CL_Bottomcolor_c(), cl_color, CL_Color_c(), CL_Color_f(), CL_ForwardToServer_f(), CL_FullInfo_f(), CL_FullServerinfo_f(), cl_name, CL_Name_f(), cl_noaim, CL_Packet_f(), CL_PingPLReport_f(), cl_pmodel, CL_PQRcon_f(), cl_rate, cl_rate_burstsize, CL_Rcon_f(), host_static_t::CL_SendCvar, CL_SendCvar_f(), CL_SetInfo_f(), cl_skin, cl_team, cl_topcolor, CL_Topcolor_c(), CL_User_f(), CL_Users_f(), cls, Cmd_AddCommand(), Cvar_RegisterCallback(), Cvar_RegisterVariable(), Cvar_RegisterVirtual(), dpsnprintf(), host_static_t::hook, host, Image_FixTransparentPixels_f(), r_fixtrans_auto, and client_static_t::userinfo.

Referenced by CL_Init().

◆ CL_InitInput()

void CL_InitInput ( void )

Definition at line 2209 of file cl_input.c.

2210{
2211 Cmd_AddCommand(CF_CLIENT, "+moveup",IN_UpDown, "swim upward");
2212 Cmd_AddCommand(CF_CLIENT, "-moveup",IN_UpUp, "stop swimming upward");
2213 Cmd_AddCommand(CF_CLIENT, "+movedown",IN_DownDown, "swim downward");
2214 Cmd_AddCommand(CF_CLIENT, "-movedown",IN_DownUp, "stop swimming downward");
2215 Cmd_AddCommand(CF_CLIENT, "+left",IN_LeftDown, "turn left");
2216 Cmd_AddCommand(CF_CLIENT, "-left",IN_LeftUp, "stop turning left");
2217 Cmd_AddCommand(CF_CLIENT, "+right",IN_RightDown, "turn right");
2218 Cmd_AddCommand(CF_CLIENT, "-right",IN_RightUp, "stop turning right");
2219 Cmd_AddCommand(CF_CLIENT, "+forward",IN_ForwardDown, "move forward");
2220 Cmd_AddCommand(CF_CLIENT, "-forward",IN_ForwardUp, "stop moving forward");
2221 Cmd_AddCommand(CF_CLIENT, "+back",IN_BackDown, "move backward");
2222 Cmd_AddCommand(CF_CLIENT, "-back",IN_BackUp, "stop moving backward");
2223 Cmd_AddCommand(CF_CLIENT, "+lookup", IN_LookupDown, "look upward");
2224 Cmd_AddCommand(CF_CLIENT, "-lookup", IN_LookupUp, "stop looking upward");
2225 Cmd_AddCommand(CF_CLIENT, "+lookdown", IN_LookdownDown, "look downward");
2226 Cmd_AddCommand(CF_CLIENT, "-lookdown", IN_LookdownUp, "stop looking downward");
2227 Cmd_AddCommand(CF_CLIENT, "+strafe", IN_StrafeDown, "activate strafing mode (move instead of turn)");
2228 Cmd_AddCommand(CF_CLIENT, "-strafe", IN_StrafeUp, "deactivate strafing mode");
2229 Cmd_AddCommand(CF_CLIENT, "+moveleft", IN_MoveleftDown, "strafe left");
2230 Cmd_AddCommand(CF_CLIENT, "-moveleft", IN_MoveleftUp, "stop strafing left");
2231 Cmd_AddCommand(CF_CLIENT, "+moveright", IN_MoverightDown, "strafe right");
2232 Cmd_AddCommand(CF_CLIENT, "-moveright", IN_MoverightUp, "stop strafing right");
2233 Cmd_AddCommand(CF_CLIENT, "+speed", IN_SpeedDown, "activate run mode (faster movement and turning)");
2234 Cmd_AddCommand(CF_CLIENT, "-speed", IN_SpeedUp, "deactivate run mode");
2235 Cmd_AddCommand(CF_CLIENT, "+attack", IN_AttackDown, "begin firing");
2236 Cmd_AddCommand(CF_CLIENT, "-attack", IN_AttackUp, "stop firing");
2237 Cmd_AddCommand(CF_CLIENT, "+jump", IN_JumpDown, "jump");
2238 Cmd_AddCommand(CF_CLIENT, "-jump", IN_JumpUp, "end jump (so you can jump again)");
2239 Cmd_AddCommand(CF_CLIENT, "impulse", IN_Impulse, "send an impulse number to server (select weapon, use item, etc)");
2240 Cmd_AddCommand(CF_CLIENT, "+klook", IN_KLookDown, "activate keyboard looking mode, do not recenter view");
2241 Cmd_AddCommand(CF_CLIENT, "-klook", IN_KLookUp, "deactivate keyboard looking mode");
2242 Cmd_AddCommand(CF_CLIENT, "+mlook", IN_MLookDown, "activate mouse looking mode, do not recenter view");
2243 Cmd_AddCommand(CF_CLIENT, "-mlook", IN_MLookUp, "deactivate mouse looking mode");
2244
2245 // LadyHavoc: added lots of buttons
2246 Cmd_AddCommand(CF_CLIENT, "+use", IN_UseDown, "use something (may be used by some mods)");
2247 Cmd_AddCommand(CF_CLIENT, "-use", IN_UseUp, "stop using something");
2248 Cmd_AddCommand(CF_CLIENT, "+button3", IN_Button3Down, "activate button3 (behavior depends on mod)");
2249 Cmd_AddCommand(CF_CLIENT, "-button3", IN_Button3Up, "deactivate button3");
2250 Cmd_AddCommand(CF_CLIENT, "+button4", IN_Button4Down, "activate button4 (behavior depends on mod)");
2251 Cmd_AddCommand(CF_CLIENT, "-button4", IN_Button4Up, "deactivate button4");
2252 Cmd_AddCommand(CF_CLIENT, "+button5", IN_Button5Down, "activate button5 (behavior depends on mod)");
2253 Cmd_AddCommand(CF_CLIENT, "-button5", IN_Button5Up, "deactivate button5");
2254 Cmd_AddCommand(CF_CLIENT, "+button6", IN_Button6Down, "activate button6 (behavior depends on mod)");
2255 Cmd_AddCommand(CF_CLIENT, "-button6", IN_Button6Up, "deactivate button6");
2256 Cmd_AddCommand(CF_CLIENT, "+button7", IN_Button7Down, "activate button7 (behavior depends on mod)");
2257 Cmd_AddCommand(CF_CLIENT, "-button7", IN_Button7Up, "deactivate button7");
2258 Cmd_AddCommand(CF_CLIENT, "+button8", IN_Button8Down, "activate button8 (behavior depends on mod)");
2259 Cmd_AddCommand(CF_CLIENT, "-button8", IN_Button8Up, "deactivate button8");
2260 Cmd_AddCommand(CF_CLIENT, "+button9", IN_Button9Down, "activate button9 (behavior depends on mod)");
2261 Cmd_AddCommand(CF_CLIENT, "-button9", IN_Button9Up, "deactivate button9");
2262 Cmd_AddCommand(CF_CLIENT, "+button10", IN_Button10Down, "activate button10 (behavior depends on mod)");
2263 Cmd_AddCommand(CF_CLIENT, "-button10", IN_Button10Up, "deactivate button10");
2264 Cmd_AddCommand(CF_CLIENT, "+button11", IN_Button11Down, "activate button11 (behavior depends on mod)");
2265 Cmd_AddCommand(CF_CLIENT, "-button11", IN_Button11Up, "deactivate button11");
2266 Cmd_AddCommand(CF_CLIENT, "+button12", IN_Button12Down, "activate button12 (behavior depends on mod)");
2267 Cmd_AddCommand(CF_CLIENT, "-button12", IN_Button12Up, "deactivate button12");
2268 Cmd_AddCommand(CF_CLIENT, "+button13", IN_Button13Down, "activate button13 (behavior depends on mod)");
2269 Cmd_AddCommand(CF_CLIENT, "-button13", IN_Button13Up, "deactivate button13");
2270 Cmd_AddCommand(CF_CLIENT, "+button14", IN_Button14Down, "activate button14 (behavior depends on mod)");
2271 Cmd_AddCommand(CF_CLIENT, "-button14", IN_Button14Up, "deactivate button14");
2272 Cmd_AddCommand(CF_CLIENT, "+button15", IN_Button15Down, "activate button15 (behavior depends on mod)");
2273 Cmd_AddCommand(CF_CLIENT, "-button15", IN_Button15Up, "deactivate button15");
2274 Cmd_AddCommand(CF_CLIENT, "+button16", IN_Button16Down, "activate button16 (behavior depends on mod)");
2275 Cmd_AddCommand(CF_CLIENT, "-button16", IN_Button16Up, "deactivate button16");
2276
2277 // LadyHavoc: added bestweapon command
2278 Cmd_AddCommand(CF_CLIENT, "bestweapon", IN_BestWeapon_f, "send an impulse number to server to select the first usable weapon out of several (example: 8 7 6 5 4 3 2 1)");
2279 Cmd_AddCommand(CF_CLIENT, "register_bestweapon", IN_BestWeapon_Register_f, "(for QC usage only) change weapon parameters to be used by bestweapon; stuffcmd this in ClientConnect");
2280
2302
2317
2321
2323
2325}
cvar_t cl_csqc_generatemousemoveevents
Definition cl_input.c:420
static void IN_Button3Down(cmd_state_t *cmd)
Definition cl_input.c:166
static void IN_Button7Down(cmd_state_t *cmd)
Definition cl_input.c:174
static void IN_Button12Down(cmd_state_t *cmd)
Definition cl_input.c:185
static void IN_Button10Up(cmd_state_t *cmd)
Definition cl_input.c:182
cvar_t cl_movement_edgefriction
Definition cl_input.c:388
cvar_t cl_movement_stopspeed
Definition cl_input.c:384
static void IN_JumpDown(cmd_state_t *cmd)
Definition cl_input.c:196
static void IN_Button8Down(cmd_state_t *cmd)
Definition cl_input.c:176
static void IN_LeftDown(cmd_state_t *cmd)
Definition cl_input.c:137
static void IN_Button6Up(cmd_state_t *cmd)
Definition cl_input.c:173
static void IN_Button15Up(cmd_state_t *cmd)
Definition cl_input.c:192
static void IN_AttackUp(cmd_state_t *cmd)
Definition cl_input.c:160
static void IN_ForwardDown(cmd_state_t *cmd)
Definition cl_input.c:141
cvar_t cl_movement_nettimeout
Definition cl_input.c:379
cvar_t cl_netrepeatinput
Definition cl_input.c:415
static void IN_Impulse(cmd_state_t *cmd)
Definition cl_input.c:199
static void IN_MoveleftUp(cmd_state_t *cmd)
Definition cl_input.c:150
cvar_t cl_movement_accelerate
Definition cl_input.c:390
static void IN_SpeedDown(cmd_state_t *cmd)
Definition cl_input.c:154
static void IN_Button10Down(cmd_state_t *cmd)
Definition cl_input.c:181
cvar_t m_accelerate
Definition cl_input.c:402
cvar_t cl_movement_maxspeed
Definition cl_input.c:382
static void IN_UpUp(cmd_state_t *cmd)
Definition cl_input.c:134
static void IN_Button14Up(cmd_state_t *cmd)
Definition cl_input.c:190
static void IN_Button13Up(cmd_state_t *cmd)
Definition cl_input.c:188
static void IN_Button3Up(cmd_state_t *cmd)
Definition cl_input.c:167
static void IN_UseUp(cmd_state_t *cmd)
Definition cl_input.c:163
static void IN_MoverightUp(cmd_state_t *cmd)
Definition cl_input.c:152
static void IN_KLookDown(cmd_state_t *cmd)
Definition cl_input.c:124
static void IN_Button15Down(cmd_state_t *cmd)
Definition cl_input.c:191
static void IN_LeftUp(cmd_state_t *cmd)
Definition cl_input.c:138
static void IN_StrafeDown(cmd_state_t *cmd)
Definition cl_input.c:156
cvar_t cl_movement_wateraccelerate
Definition cl_input.c:392
static void IN_Button9Up(cmd_state_t *cmd)
Definition cl_input.c:180
cvar_t m_accelerate_maxspeed
Definition cl_input.c:404
static void IN_KLookUp(cmd_state_t *cmd)
Definition cl_input.c:125
static void IN_AttackDown(cmd_state_t *cmd)
Definition cl_input.c:159
static void IN_SpeedUp(cmd_state_t *cmd)
Definition cl_input.c:155
static void IN_Button12Up(cmd_state_t *cmd)
Definition cl_input.c:186
static void IN_UseDown(cmd_state_t *cmd)
Definition cl_input.c:162
cvar_t m_accelerate_power_offset
Definition cl_input.c:406
cvar_t m_accelerate_power_strength
Definition cl_input.c:409
cvar_t cl_movement_waterfriction
Definition cl_input.c:387
cvar_t cl_movement_jumpvelocity
Definition cl_input.c:393
cvar_t m_accelerate_natural_strength
Definition cl_input.c:410
static void IN_Button11Up(cmd_state_t *cmd)
Definition cl_input.c:184
cvar_t m_filter
Definition cl_input.c:401
static void IN_BestWeapon_Register_f(cmd_state_t *cmd)
Definition cl_input.c:244
static void IN_MLookDown(cmd_state_t *cmd)
Definition cl_input.c:126
cvar_t m_accelerate_natural_offset
Definition cl_input.c:412
static void IN_Button5Up(cmd_state_t *cmd)
Definition cl_input.c:171
static void IN_LookdownUp(cmd_state_t *cmd)
Definition cl_input.c:148
static void IN_ForwardUp(cmd_state_t *cmd)
Definition cl_input.c:142
static void IN_Button4Up(cmd_state_t *cmd)
Definition cl_input.c:169
cvar_t m_accelerate_power_senscap
Definition cl_input.c:408
static void IN_MoverightDown(cmd_state_t *cmd)
Definition cl_input.c:151
cvar_t in_pitch_min
Definition cl_input.c:398
cvar_t cl_movement_stepheight
Definition cl_input.c:389
cvar_t cl_movement_friction
Definition cl_input.c:385
cvar_t cl_movement_maxairspeed
Definition cl_input.c:383
cvar_t cl_movement_airaccelerate
Definition cl_input.c:391
static void IN_Button13Down(cmd_state_t *cmd)
Definition cl_input.c:187
cvar_t in_pitch_max
Definition cl_input.c:399
cvar_t cl_netfps
Definition cl_input.c:414
static void IN_Button4Down(cmd_state_t *cmd)
Definition cl_input.c:168
cvar_t m_accelerate_minspeed
Definition cl_input.c:403
cvar_t m_accelerate_power
Definition cl_input.c:407
static void IN_Button6Down(cmd_state_t *cmd)
Definition cl_input.c:172
static void IN_BackDown(cmd_state_t *cmd)
Definition cl_input.c:143
static void IN_Button9Down(cmd_state_t *cmd)
Definition cl_input.c:179
static void IN_MLookUp(cmd_state_t *cmd)
Definition cl_input.c:127
static void IN_Button16Down(cmd_state_t *cmd)
Definition cl_input.c:193
static void IN_DownDown(cmd_state_t *cmd)
Definition cl_input.c:135
cvar_t cl_nopred
Definition cl_input.c:396
static void IN_UpDown(cmd_state_t *cmd)
Definition cl_input.c:133
cvar_t cl_movement_airaccel_sideways_friction
Definition cl_input.c:395
static void IN_Button8Up(cmd_state_t *cmd)
Definition cl_input.c:177
static void IN_Button11Down(cmd_state_t *cmd)
Definition cl_input.c:183
static void IN_Button16Up(cmd_state_t *cmd)
Definition cl_input.c:194
static void IN_DownUp(cmd_state_t *cmd)
Definition cl_input.c:136
static void IN_Button5Down(cmd_state_t *cmd)
Definition cl_input.c:170
static void IN_LookdownDown(cmd_state_t *cmd)
Definition cl_input.c:147
cvar_t m_accelerate_filter
Definition cl_input.c:405
cvar_t m_accelerate_natural_accelsenscap
Definition cl_input.c:411
static void IN_Button7Up(cmd_state_t *cmd)
Definition cl_input.c:175
cvar_t cl_nodelta
Definition cl_input.c:418
static void IN_LookupDown(cmd_state_t *cmd)
Definition cl_input.c:145
cvar_t cl_netimmediatebuttons
Definition cl_input.c:416
static void IN_BestWeapon_f(cmd_state_t *cmd)
Definition cl_input.c:271
static void IN_BackUp(cmd_state_t *cmd)
Definition cl_input.c:144
static void IN_JumpUp(cmd_state_t *cmd)
Definition cl_input.c:197
static void IN_MoveleftDown(cmd_state_t *cmd)
Definition cl_input.c:149
static void IN_LookupUp(cmd_state_t *cmd)
Definition cl_input.c:146
static void IN_RightUp(cmd_state_t *cmd)
Definition cl_input.c:140
static void IN_Button14Down(cmd_state_t *cmd)
Definition cl_input.c:189
cvar_t cl_movement_wallfriction
Definition cl_input.c:386
static void IN_RightDown(cmd_state_t *cmd)
Definition cl_input.c:139
cvar_t cl_movecliptokeyboard
Definition cl_input.c:370
cvar_t cl_movement_airaccel_qw
Definition cl_input.c:394
static void IN_StrafeUp(cmd_state_t *cmd)
Definition cl_input.c:157
cvar_t cl_movement_track_canjump
Definition cl_input.c:381

References CF_CLIENT, cl_csqc_generatemousemoveevents, cl_movecliptokeyboard, cl_movement, cl_movement_accelerate, cl_movement_airaccel_qw, cl_movement_airaccel_sideways_friction, cl_movement_airaccelerate, cl_movement_edgefriction, cl_movement_friction, cl_movement_jumpvelocity, cl_movement_maxairspeed, cl_movement_maxspeed, cl_movement_minping, cl_movement_nettimeout, cl_movement_replay, cl_movement_stepheight, cl_movement_stopspeed, cl_movement_track_canjump, cl_movement_wallfriction, cl_movement_wateraccelerate, cl_movement_waterfriction, cl_netfps, cl_netimmediatebuttons, cl_netrepeatinput, cl_nodelta, cl_nopred, Cmd_AddCommand(), Cvar_RegisterVariable(), IN_AttackDown(), IN_AttackUp(), IN_BackDown(), IN_BackUp(), IN_BestWeapon_f(), IN_BestWeapon_Register_f(), IN_Button10Down(), IN_Button10Up(), IN_Button11Down(), IN_Button11Up(), IN_Button12Down(), IN_Button12Up(), IN_Button13Down(), IN_Button13Up(), IN_Button14Down(), IN_Button14Up(), IN_Button15Down(), IN_Button15Up(), IN_Button16Down(), IN_Button16Up(), IN_Button3Down(), IN_Button3Up(), IN_Button4Down(), IN_Button4Up(), IN_Button5Down(), IN_Button5Up(), IN_Button6Down(), IN_Button6Up(), IN_Button7Down(), IN_Button7Up(), IN_Button8Down(), IN_Button8Up(), IN_Button9Down(), IN_Button9Up(), IN_DownDown(), IN_DownUp(), IN_ForwardDown(), IN_ForwardUp(), IN_Impulse(), IN_JumpDown(), IN_JumpUp(), IN_KLookDown(), IN_KLookUp(), IN_LeftDown(), IN_LeftUp(), IN_LookdownDown(), IN_LookdownUp(), IN_LookupDown(), IN_LookupUp(), IN_MLookDown(), IN_MLookUp(), IN_MoveleftDown(), IN_MoveleftUp(), IN_MoverightDown(), IN_MoverightUp(), in_pitch_max, in_pitch_min, IN_RightDown(), IN_RightUp(), IN_SpeedDown(), IN_SpeedUp(), IN_StrafeDown(), IN_StrafeUp(), IN_UpDown(), IN_UpUp(), IN_UseDown(), IN_UseUp(), m_accelerate, m_accelerate_filter, m_accelerate_maxspeed, m_accelerate_minspeed, m_accelerate_natural_accelsenscap, m_accelerate_natural_offset, m_accelerate_natural_strength, m_accelerate_power, m_accelerate_power_offset, m_accelerate_power_senscap, m_accelerate_power_strength, and m_filter.

Referenced by CL_Init().

◆ CL_Input()

void CL_Input ( void )

Definition at line 483 of file cl_input.c.

484{
485 float mx, my;
486 static float old_mouse_x = 0, old_mouse_y = 0;
487
488 // clamp before the move to prevent starting with bad angles
490
493
494 // reset some of the command fields
495 cl.cmd.forwardmove = 0;
496 cl.cmd.sidemove = 0;
497 cl.cmd.upmove = 0;
498
499 // get basic movement from keyboard
500 if (in_strafe.state & 1)
501 {
504 }
505
508
511
512 if (! (in_klook.state & 1) )
513 {
516 }
517
518 // adjust for speed key
519 if (in_speed.state & 1)
520 {
524 }
525
526 // allow mice or other external controllers to add to the move
527 IN_Move ();
528
529 // send mouse move to csqc
531 {
533 {
534 // event type 3 is a DP_CSQC thing
535 static int oldwindowmouse[2];
536 if (oldwindowmouse[0] != in_windowmouse_x || oldwindowmouse[1] != in_windowmouse_y)
537 {
539 oldwindowmouse[0] = in_windowmouse_x;
540 oldwindowmouse[1] = in_windowmouse_y;
541 }
542 }
543 else
544 {
545 if (in_mouse_x || in_mouse_y)
547 }
548 }
549
550 // apply m_accelerate if it is on
551 if(m_accelerate.value > 0)
552 {
553 float mouse_deltadist = sqrtf(in_mouse_x * in_mouse_x + in_mouse_y * in_mouse_y);
554 float speed = mouse_deltadist / cl.realframetime;
555 static float averagespeed = 0;
556 float f, mi, ma;
559 else
560 f = 1;
561 averagespeed = speed * f + averagespeed * (1 - f);
562
563 // Note: this check is technically unnecessary, as everything in here cancels out if it is zero.
564 if (m_accelerate.value != 1.0f)
565 {
566 // First do linear slope acceleration which was ripped "in
567 // spirit" from many classic mouse driver implementations.
568 // If m_accelerate.value == 1, this code does nothing at all.
569
572
573 if(averagespeed <= mi)
574 {
575 f = 1;
576 }
577 else if(averagespeed >= ma)
578 {
580 }
581 else
582 {
583 f = averagespeed;
584 f = (f - mi) / (ma - mi) * (m_accelerate.value - 1) + 1;
585 }
586 in_mouse_x *= f;
587 in_mouse_y *= f;
588 }
589
590 // Note: this check is technically unnecessary, as everything in here cancels out if it is zero.
592 {
593 // Then do Quake Live-style power acceleration.
594 // Note that this behavior REPLACES the usual
595 // sensitivity, so we apply it but then divide by
596 // sensitivity.value so that the later multiplication
597 // restores it again.
598 float accelsens = 1.0f;
599 float adjusted_speed_pxms = (averagespeed * 0.001f - m_accelerate_power_offset.value) * m_accelerate_power_strength.value;
600 float inv_sensitivity = 1.0f / sensitivity.value;
601 if (adjusted_speed_pxms > 0)
602 {
603 if (m_accelerate_power.value > 1.0f)
604 {
605 // TODO: How does this interact with sensitivity changes? Is this intended?
606 // Currently: more sensitivity = less acceleration at same pixel speed.
607 accelsens += expf((m_accelerate_power.value - 1.0f) * logf(adjusted_speed_pxms)) * inv_sensitivity;
608 }
609 else
610 {
611 // The limit of the then-branch for m_accelerate_power -> 1.
612 accelsens += inv_sensitivity;
613 // Note: QL had just accelsens = 1.0f.
614 // This is mathematically wrong though.
615 }
616 }
617 else
618 {
619 // The limit of the then-branch for adjusted_speed -> 0.
620 // accelsens += 0.0f;
621 }
622 if (m_accelerate_power_senscap.value > 0.0f && accelsens > m_accelerate_power_senscap.value * inv_sensitivity)
623 {
624 // TODO: How does this interact with sensitivity changes? Is this intended?
625 // Currently: senscap is in absolute sensitivity units, so if senscap < sensitivity, it overrides.
626 accelsens = m_accelerate_power_senscap.value * inv_sensitivity;
627 }
628
629 in_mouse_x *= accelsens;
630 in_mouse_y *= accelsens;
631 }
632
634 {
635 float accelsens = 1.0f;
636 float adjusted_speed_pxms = (averagespeed * 0.001f - m_accelerate_natural_offset.value);
637
638 if (adjusted_speed_pxms > 0 && m_accelerate_natural_accelsenscap.value != 1.0f)
639 {
640 float adjusted_accelsenscap = m_accelerate_natural_accelsenscap.value - 1.0f;
641 // This equation is made to multiply the sensitivity for a factor between 1 and m_accelerate_natural_accelsenscap
642 // this means there is no need to divide it for the sensitivity.value as the whole
643 // expression needs to be multiplied by the sensitivity at the end instead of only having the sens multiplied
644 accelsens += (adjusted_accelsenscap - adjusted_accelsenscap * exp( - ((adjusted_speed_pxms * m_accelerate_natural_strength.value) / fabs(adjusted_accelsenscap) )));
645 }
646
647 in_mouse_x *= accelsens;
648 in_mouse_y *= accelsens;
649 }
650 }
651
652 // apply m_filter if it is on
653 mx = in_mouse_x;
654 my = in_mouse_y;
655 if (m_filter.integer)
656 {
657 in_mouse_x = (mx + old_mouse_x) * 0.5;
658 in_mouse_y = (my + old_mouse_y) * 0.5;
659 }
660 old_mouse_x = mx;
661 old_mouse_y = my;
662
663 // ignore a mouse move if mouse was activated/deactivated this frame
665 {
667 in_mouse_x = old_mouse_x = 0;
668 in_mouse_y = old_mouse_y = 0;
669 }
670
671 // if not in menu, apply mouse move to viewangles/movement
673 {
674 float modulatedsensitivity = sensitivity.value * cl.sensitivityscale;
675 if (in_strafe.state & 1)
676 {
677 // strafing mode, all looking is movement
679 cl.cmd.sidemove += m_side.value * in_mouse_x * modulatedsensitivity;
681 cl.cmd.upmove -= m_forward.value * in_mouse_y * modulatedsensitivity;
682 else
683 cl.cmd.forwardmove -= m_forward.value * in_mouse_y * modulatedsensitivity;
684 }
685 else if ((in_mlook.state & 1) || freelook.integer)
686 {
687 // mouselook, lookstrafe causes turning to become strafing
690 cl.cmd.sidemove += m_side.value * in_mouse_x * modulatedsensitivity;
691 else
692 cl.viewangles[YAW] -= m_yaw.value * in_mouse_x * modulatedsensitivity * cl.viewzoom;
693 cl.viewangles[PITCH] += m_pitch.value * in_mouse_y * modulatedsensitivity * cl.viewzoom;
694 }
695 else
696 {
697 // non-mouselook, yaw turning and forward/back movement
698 cl.viewangles[YAW] -= m_yaw.value * in_mouse_x * modulatedsensitivity * cl.viewzoom;
699 cl.cmd.forwardmove -= m_forward.value * in_mouse_y * modulatedsensitivity;
700 }
701 }
702 else // don't pitch drift when csqc is controlling the mouse
703 {
704 // mouse interacting with the scene, mostly stationary view
706 // update prydon cursor
707 cl.cmd.cursor_screen[0] = in_windowmouse_x * 2.0 / vid.mode.width - 1.0;
709 }
710
712 {
715 }
716
717 // clamp after the move to prevent rendering with bad angles
719
721 {
722 vec_t f = 1;
723 if (in_speed.state & 1)
726 {
727 // digital direction, analog amount
728 vec_t wishvel_x, wishvel_y;
729 wishvel_x = fabs(cl.cmd.forwardmove);
730 wishvel_y = fabs(cl.cmd.sidemove);
731 if(wishvel_x != 0 && wishvel_y != 0 && wishvel_x != wishvel_y)
732 {
733 vec_t wishspeed = sqrt(wishvel_x * wishvel_x + wishvel_y * wishvel_y);
734 if(wishvel_x >= 2 * wishvel_y)
735 {
736 // pure X motion
737 if(cl.cmd.forwardmove > 0)
739 else
741 cl.cmd.sidemove = 0;
742 }
743 else if(wishvel_y >= 2 * wishvel_x)
744 {
745 // pure Y motion
746 cl.cmd.forwardmove = 0;
747 if(cl.cmd.sidemove > 0)
749 else
751 }
752 else
753 {
754 // diagonal
755 if(cl.cmd.forwardmove > 0)
756 cl.cmd.forwardmove = 0.70710678118654752440 * wishspeed;
757 else
758 cl.cmd.forwardmove = -0.70710678118654752440 * wishspeed;
759 if(cl.cmd.sidemove > 0)
760 cl.cmd.sidemove = 0.70710678118654752440 * wishspeed;
761 else
762 cl.cmd.sidemove = -0.70710678118654752440 * wishspeed;
763 }
764 }
765 }
767 {
768 // digital direction, digital amount
769 if(cl.cmd.sidemove >= cl_sidespeed.value * f * 0.5)
771 else if(cl.cmd.sidemove <= -cl_sidespeed.value * f * 0.5)
773 else
774 cl.cmd.sidemove = 0;
775 if(cl.cmd.forwardmove >= cl_forwardspeed.value * f * 0.5)
777 else if(cl.cmd.forwardmove <= -cl_backspeed.value * f * 0.5)
779 else
780 cl.cmd.forwardmove = 0;
781 }
782 }
783}
kbutton_t in_right
Definition cl_input.c:52
kbutton_t in_klook
Definition cl_input.c:51
cvar_t v_flipped
Definition gl_backend.c:20
kbutton_t in_forward
Definition cl_input.c:52
static void CL_AdjustAngles(void)
Definition cl_input.c:431
int cl_ignoremousemoves
Definition cl_input.c:474
kbutton_t in_speed
Definition cl_input.c:54
kbutton_t in_strafe
Definition cl_input.c:54
kbutton_t in_back
Definition cl_input.c:52
kbutton_t in_down
Definition cl_input.c:55
kbutton_t in_moveleft
Definition cl_input.c:53
kbutton_t in_left
Definition cl_input.c:52
kbutton_t in_moveright
Definition cl_input.c:53
float CL_KeyState(kbutton_t *key)
Definition cl_input.c:315
kbutton_t in_up
Definition cl_input.c:55
kbutton_t in_mlook
Definition cl_input.c:51
cvar_t vid_conheight
Definition cl_screen.c:57
cvar_t vid_conwidth
Definition cl_screen.c:56
qbool CL_VM_InputEvent(int eventtype, float x, float y)
Definition csprogs.c:459
float in_windowmouse_y
Definition input.h:32
float in_windowmouse_x
Definition vid_shared.c:71
void IN_Move(void)
Definition vid_null.c:58
keydest_t key_dest
Definition keys.c:37
int key_consoleactive
Definition keys.c:38
@ key_game
Definition keys.h:372
float fabs(float f)
#define CLVM_prog
Definition progsvm.h:767
#define YAW
Definition qtypes.h:19
#define PITCH
Definition qtypes.h:16
float f
vec3_t viewangles
Definition client.h:786
qbool csqc_wantsmousemove
Definition client.h:835
vec_t viewzoom
Definition client.h:794
usercmd_t cmd
Definition client.h:752
int state
Definition client.h:1246
vec3_t cursor_screen
Definition protocol.h:384
float forwardmove
Definition protocol.h:380
float upmove
Definition protocol.h:382
float sidemove
Definition protocol.h:381
int width
Definition vid.h:60
int height
Definition vid.h:61
viddef_mode_t mode
currently active video mode
Definition vid.h:73
static float wishspeed
Definition sv_user.c:306
viddef_t vid
global video state
Definition vid_shared.c:64
void V_StopPitchDrift(void)
Definition view.c:169

References bound, cl, CL_AdjustAngles(), cl_backspeed, cl_csqc_generatemousemoveevents, cl_forwardspeed, cl_ignoremousemoves, CL_KeyState(), cl_movecliptokeyboard, cl_movespeedkey, cl_prydoncursor, cl_sidespeed, cl_upspeed, CL_VM_InputEvent(), CLVM_prog, client_state_t::cmd, client_state_t::csqc_wantsmousemove, usercmd_t::cursor_screen, f, fabs(), usercmd_t::forwardmove, freelook, viddef_mode_t::height, in_back, in_down, in_forward, in_klook, in_left, in_mlook, in_mouse_x, in_mouse_y, IN_Move(), in_moveleft, in_moveright, in_right, in_speed, in_strafe, in_up, in_windowmouse_x, in_windowmouse_y, cvar_t::integer, key_consoleactive, key_dest, key_game, lookstrafe, m_accelerate, m_accelerate_filter, m_accelerate_maxspeed, m_accelerate_minspeed, m_accelerate_natural_accelsenscap, m_accelerate_natural_offset, m_accelerate_natural_strength, m_accelerate_power, m_accelerate_power_offset, m_accelerate_power_senscap, m_accelerate_power_strength, m_filter, m_forward, m_pitch, m_side, m_yaw, max, viddef_t::mode, noclip_anglehack, PITCH, client_state_t::realframetime, sensitivity, client_state_t::sensitivityscale, usercmd_t::sidemove, sqrt(), kbutton_t::state, usercmd_t::upmove, v_flipped, V_StopPitchDrift(), cvar_t::value, vid, vid_conheight, vid_conwidth, client_state_t::viewangles, client_state_t::viewzoom, viddef_mode_t::width, wishspeed, and YAW.

Referenced by CL_Frame().

◆ CL_KeyState()

float CL_KeyState ( kbutton_t * key)

Definition at line 315 of file cl_input.c.

316{
317 float val;
318 qbool impulsedown, impulseup, down;
319
320 impulsedown = (key->state & 2) != 0;
321 impulseup = (key->state & 4) != 0;
322 down = (key->state & 1) != 0;
323 val = 0;
324
325 if (impulsedown && !impulseup)
326 {
327 if (down)
328 val = 0.5; // pressed and held this frame
329 else
330 val = 0; // I_Error ();
331 }
332 if (impulseup && !impulsedown)
333 {
334 if (down)
335 val = 0; // I_Error ();
336 else
337 val = 0; // released this frame
338 }
339 if (!impulsedown && !impulseup)
340 {
341 if (down)
342 val = 1.0; // held the entire frame
343 else
344 val = 0; // up the entire frame
345 }
346 if (impulsedown && impulseup)
347 {
348 if (down)
349 val = 0.75; // released and re-pressed this frame
350 else
351 val = 0.25; // pressed and released this frame
352 }
353
354 key->state &= 1; // clear impulses
355
356 return val;
357}
bool qbool
Definition qtypes.h:9

References kbutton_t::state.

Referenced by CL_AdjustAngles(), and CL_Input().

◆ CL_LerpUpdate()

void CL_LerpUpdate ( entity_t * e)

◆ CL_Locs_FindLocationName()

void CL_Locs_FindLocationName ( char * buffer,
size_t buffersize,
vec3_t point )

Definition at line 2218 of file cl_main.c.

2219{
2220 cl_locnode_t *loc;
2221 loc = CL_Locs_FindNearest(point);
2222 if (loc)
2223 dp_strlcpy(buffer, loc->name, buffersize);
2224 else
2225 dpsnprintf(buffer, buffersize, "LOC=%.0f:%.0f:%.0f", point[0], point[1], point[2]);
2226}
cl_locnode_t * CL_Locs_FindNearest(const vec3_t point)
Definition cl_main.c:2193
GLuint buffer
Definition glquake.h:630
char * name
Definition client.h:724

References buffer, CL_Locs_FindNearest(), dp_strlcpy, dpsnprintf(), and cl_locnode_t::name.

Referenced by CL_ForwardToServer().

◆ CL_Locs_FindNearest()

cl_locnode_t * CL_Locs_FindNearest ( const vec3_t point)

Definition at line 2193 of file cl_main.c.

2194{
2195 int i;
2196 cl_locnode_t *loc;
2197 cl_locnode_t *best;
2198 vec3_t nearestpoint;
2199 vec_t dist, bestdist;
2200 best = NULL;
2201 bestdist = 0;
2202 for (loc = cl.locnodes;loc;loc = loc->next)
2203 {
2204 for (i = 0;i < 3;i++)
2205 nearestpoint[i] = bound(loc->mins[i], point[i], loc->maxs[i]);
2206 dist = VectorDistance2(nearestpoint, point);
2207 if (bestdist > dist || !best)
2208 {
2209 bestdist = dist;
2210 best = loc;
2211 if (bestdist < 1)
2212 break;
2213 }
2214 }
2215 return best;
2216}
#define VectorDistance2(a, b)
Definition mathlib.h:107
vec3_t mins
Definition client.h:725
struct cl_locnode_s * next
Definition client.h:723
vec3_t maxs
Definition client.h:725
cl_locnode_t * locnodes
Definition client.h:1125

References bound, cl, i, client_state_t::locnodes, cl_locnode_t::maxs, cl_locnode_t::mins, cl_locnode_t::next, NULL, and VectorDistance2.

Referenced by CL_Locs_FindLocationName(), CL_Locs_RemoveNearest_f(), R_DrawLocs(), and R_TimeReport_EndFrame().

◆ CL_Locs_Reload_f()

void CL_Locs_Reload_f ( cmd_state_t * cmd)

Definition at line 2377 of file cl_main.c.

2378{
2379 int i, linenumber, limit, len;
2380 const char *s;
2381 char *filedata, *text, *textend, *linestart, *linetext, *lineend;
2382 fs_offset_t filesize;
2383 vec3_t mins, maxs;
2384 char locfilename[MAX_QPATH];
2385 char name[MAX_INPUTLINE];
2386
2387 if (cls.state != ca_connected || !cl.worldmodel)
2388 {
2389 Con_Printf("No level loaded!\n");
2390 return;
2391 }
2392
2394
2395 // try maps/something.loc first (LadyHavoc: where I think they should be)
2396 dpsnprintf(locfilename, sizeof(locfilename), "%s.loc", cl.worldnamenoextension);
2397 filedata = (char *)FS_LoadFile(locfilename, cls.levelmempool, false, &filesize);
2398 if (!filedata)
2399 {
2400 // try proquake name as well (LadyHavoc: I hate path mangling)
2401 dpsnprintf(locfilename, sizeof(locfilename), "locs/%s.loc", cl.worldbasename);
2402 filedata = (char *)FS_LoadFile(locfilename, cls.levelmempool, false, &filesize);
2403 if (!filedata)
2404 return;
2405 }
2406 text = filedata;
2407 textend = filedata + filesize;
2408 for (linenumber = 1;text < textend;linenumber++)
2409 {
2410 linestart = text;
2411 for (;text < textend && *text != '\r' && *text != '\n';text++)
2412 ;
2413 lineend = text;
2414 if (text + 1 < textend && *text == '\r' && text[1] == '\n')
2415 text++;
2416 if (text < textend)
2417 text++;
2418 // trim trailing whitespace
2419 while (lineend > linestart && ISWHITESPACE(lineend[-1]))
2420 lineend--;
2421 // trim leading whitespace
2422 while (linestart < lineend && ISWHITESPACE(*linestart))
2423 linestart++;
2424 // check if this is a comment
2425 if (linestart + 2 <= lineend && !strncmp(linestart, "//", 2))
2426 continue;
2427 linetext = linestart;
2428 limit = 3;
2429 for (i = 0;i < limit;i++)
2430 {
2431 if (linetext >= lineend)
2432 break;
2433 // note: a missing number is interpreted as 0
2434 if (i < 3)
2435 mins[i] = atof(linetext);
2436 else
2437 maxs[i - 3] = atof(linetext);
2438 // now advance past the number
2439 while (linetext < lineend && !ISWHITESPACE(*linetext) && *linetext != ',')
2440 linetext++;
2441 // advance through whitespace
2442 if (linetext < lineend)
2443 {
2444 if (*linetext == ',')
2445 {
2446 linetext++;
2447 limit = 6;
2448 // note: comma can be followed by whitespace
2449 }
2450 if (ISWHITESPACE(*linetext))
2451 {
2452 // skip whitespace
2453 while (linetext < lineend && ISWHITESPACE(*linetext))
2454 linetext++;
2455 }
2456 }
2457 }
2458 // if this is a quoted name, remove the quotes
2459 if (i == 6)
2460 {
2461 if (linetext >= lineend || *linetext != '"')
2462 continue; // proquake location names are always quoted
2463 lineend--;
2464 linetext++;
2465 len = min(lineend - linetext, (int)sizeof(name) - 1);
2466 memcpy(name, linetext, len);
2467 name[len] = 0;
2468 // add the box to the list
2470 }
2471 // if a point was parsed, it needs to be scaled down by 8 (since
2472 // point-based loc files were invented by a proxy which dealt
2473 // directly with quake protocol coordinates, which are *8), turn
2474 // it into a box
2475 else if (i == 3)
2476 {
2477 // interpret silly fuhquake macros
2478 for (len = 0;len < (int)sizeof(name) - 1 && linetext < lineend;)
2479 {
2480 if (*linetext == '$')
2481 {
2482 if (linetext + 18 <= lineend && !strncmp(linetext, "$loc_name_separator", 19)) {s = " ";linetext += 19;}
2483 else if (linetext + 13 <= lineend && !strncmp(linetext, "$loc_name_ssg", 13)) {s = "SSG";linetext += 13;}
2484 else if (linetext + 12 <= lineend && !strncmp(linetext, "$loc_name_ng", 12)) {s = "NG";linetext += 12;}
2485 else if (linetext + 13 <= lineend && !strncmp(linetext, "$loc_name_sng", 13)) {s = "SNG";linetext += 13;}
2486 else if (linetext + 12 <= lineend && !strncmp(linetext, "$loc_name_gl", 12)) {s = "GL";linetext += 12;}
2487 else if (linetext + 12 <= lineend && !strncmp(linetext, "$loc_name_rl", 12)) {s = "RL";linetext += 12;}
2488 else if (linetext + 12 <= lineend && !strncmp(linetext, "$loc_name_lg", 12)) {s = "LG";linetext += 12;}
2489 else if (linetext + 12 <= lineend && !strncmp(linetext, "$loc_name_ga", 12)) {s = "GA";linetext += 12;}
2490 else if (linetext + 12 <= lineend && !strncmp(linetext, "$loc_name_ya", 12)) {s = "YA";linetext += 12;}
2491 else if (linetext + 12 <= lineend && !strncmp(linetext, "$loc_name_ra", 12)) {s = "RA";linetext += 12;}
2492 else if (linetext + 12 <= lineend && !strncmp(linetext, "$loc_name_mh", 12)) {s = "MEGA";linetext += 12;}
2493 else s = NULL;
2494 if (s)
2495 {
2496 while (len < (int)sizeof(name) - 1 && *s)
2497 name[len++] = *s++;
2498 continue;
2499 }
2500 }
2501 name[len++] = *linetext++;
2502 }
2503 name[len] = 0;
2504 // add the point to the list
2505 VectorScale(mins, (1.0 / 8.0), mins);
2507 }
2508 else
2509 continue;
2510 }
2511}
static void CL_Locs_AddNode(vec3_t mins, vec3_t maxs, const char *name)
Definition cl_main.c:2244
vector mins
vector maxs
int64_t fs_offset_t
Definition fs.h:37
const GLchar * name
Definition glquake.h:601
#define ISWHITESPACE(ch)
Definition qdefs.h:184
#define MAX_QPATH
max length of a quake game pathname
Definition qdefs.h:169
char worldbasename[MAX_QPATH]
Definition client.h:898
char worldnamenoextension[MAX_QPATH]
Definition client.h:900

References ca_connected, cl, CL_Locs_AddNode(), CL_Locs_Clear_f(), cls, cmd(), Con_Printf(), dpsnprintf(), FS_LoadFile(), i, int(), ISWHITESPACE, client_static_t::levelmempool, MAX_INPUTLINE, MAX_QPATH, maxs, min, mins, name, NULL, client_static_t::state, VectorScale, client_state_t::worldbasename, client_state_t::worldmodel, and client_state_t::worldnamenoextension.

Referenced by CL_Init(), and CL_SetupWorldModel().

◆ CL_MeshEntities_Init()

void CL_MeshEntities_Init ( void )

Definition at line 2555 of file cl_main.c.

2556{
2557 int i;
2558 entity_t *ent;
2559 for (i = 0; i < NUM_MESHENTITIES; i++)
2560 {
2561 ent = cl_meshentities + i;
2562 ent->state_current.active = true;
2565 ent->render.alpha = 1;
2567 ent->render.framegroupblend[0].lerp = 1;
2568 ent->render.frameblend[0].lerp = 1;
2569 VectorSet(ent->render.colormod, 1, 1, 1);
2570 VectorSet(ent->render.glowmod, 1, 1, 1);
2574 VectorSet(ent->render.render_fullbright, 1, 1, 1);
2575 VectorSet(ent->render.render_glowmod, 0, 0, 0);
2580 VectorSet(ent->render.render_modellight_lightdir_local, 0, 0, 1); // local doesn't matter because no diffuse/specular color
2586
2589 }
2592}
model_t cl_meshentitymodels[NUM_MESHENTITIES]
Definition cl_main.c:2514
static void CL_MeshEntities_Start(void)
Definition cl_main.c:2533
static void CL_MeshEntities_Restart(void)
Definition cl_main.c:2521
static void CL_MeshEntities_Shutdown(void)
Definition cl_main.c:2544
const char * cl_meshentitynames[NUM_MESHENTITIES]
Definition cl_main.c:2515
entity_t cl_meshentities[NUM_MESHENTITIES]
Definition cl_main.c:2513
void Matrix4x4_CreateIdentity(matrix4x4_t *out)
Definition matrixlib.c:564
void Mod_Mesh_Create(model_t *mod, const char *name)
#define RENDER_NOSELFSHADOW
Definition protocol.h:367
void R_RegisterModule(const char *name, void(*start)(void), void(*shutdown)(void), void(*newmap)(void), void(*devicelost)(void), void(*devicerestored)(void))
Definition r_modules.c:25
frameblend_t frameblend[MAX_FRAMEBLENDS]
Definition client.h:373
vec3_t custommodellight_lightdir
Definition client.h:404
float render_fullbright[3]
Definition client.h:412
float render_rtlight_diffuse[3]
Definition client.h:426
float render_glowmod[3]
Definition client.h:414
float render_modellight_specular[3]
Definition client.h:420
float colormod[3]
Definition client.h:359
float render_modellight_lightdir_world[3]
Definition client.h:418
float render_lightmap_ambient[3]
Definition client.h:422
vec3_t custommodellight_diffuse
Definition client.h:403
float render_modellight_lightdir_local[3]
Definition client.h:419
framegroupblend_t framegroupblend[MAX_FRAMEGROUPBLENDS]
Definition client.h:363
vec3_t custommodellight_ambient
Definition client.h:402
float render_lightmap_diffuse[3]
Definition client.h:423
float render_modellight_ambient[3]
Definition client.h:416
float render_rtlight_specular[3]
Definition client.h:427
float render_lightmap_specular[3]
Definition client.h:424
float render_modellight_diffuse[3]
Definition client.h:417
float glowmod[3]
Definition client.h:360
float lerp
Definition client.h:313

References entity_state_t::active, entity_render_t::alpha, cl_meshentities, CL_MeshEntities_Restart(), CL_MeshEntities_Shutdown(), CL_MeshEntities_Start(), cl_meshentitymodels, cl_meshentitynames, CL_UpdateRenderEntity(), entity_render_t::colormod, entity_render_t::custommodellight_ambient, entity_render_t::custommodellight_diffuse, entity_render_t::custommodellight_lightdir, entity_render_t::flags, entity_render_t::frameblend, entity_render_t::framegroupblend, entity_render_t::glowmod, i, frameblend_t::lerp, framegroupblend_t::lerp, entity_render_t::matrix, Matrix4x4_CreateIdentity(), MESH_UI, Mod_Mesh_Create(), entity_render_t::model, NUM_MESHENTITIES, R_RegisterModule(), entity_t::render, entity_render_t::render_fullbright, entity_render_t::render_glowmod, RENDER_LIGHT, entity_render_t::render_lightmap_ambient, entity_render_t::render_lightmap_diffuse, entity_render_t::render_lightmap_specular, entity_render_t::render_modellight_ambient, entity_render_t::render_modellight_diffuse, entity_render_t::render_modellight_lightdir_local, entity_render_t::render_modellight_lightdir_world, entity_render_t::render_modellight_specular, RENDER_NOSELFSHADOW, entity_render_t::render_rtlight_diffuse, entity_render_t::render_rtlight_specular, RENDER_SHADOW, entity_t::state_current, and VectorSet.

Referenced by Render_Init().

◆ CL_MeshEntities_Scene_AddRenderEntity()

void CL_MeshEntities_Scene_AddRenderEntity ( void )

◆ CL_MeshEntities_Scene_Clear()

void CL_MeshEntities_Scene_Clear ( void )

Definition at line 2594 of file cl_main.c.

2595{
2597}
void Mod_Mesh_Reset(model_t *mod)

References CL_Mesh_Scene, and Mod_Mesh_Reset().

Referenced by CL_UpdateWorld(), and VM_CL_R_ClearScene().

◆ CL_MeshEntities_Scene_FinalizeRenderEntity()

void CL_MeshEntities_Scene_FinalizeRenderEntity ( void )

◆ CL_MoveLerpEntityStates()

void CL_MoveLerpEntityStates ( entity_t * ent)

Definition at line 1991 of file cl_parse.c.

1992{
1993 float odelta[3], adelta[3];
1997 {
1998 // reset all persistent stuff if this is a new entity
1999 ent->persistent.lerpdeltatime = 0;
2000 ent->persistent.lerpstarttime = cl.mtime[1];
2005 // reset animation interpolation as well
2008 ent->render.framegroupblend[0].lerp = 1;ent->render.framegroupblend[1].lerp = 0;
2009 ent->render.shadertime = cl.time;
2010 // reset various persistent stuff
2011 ent->persistent.muzzleflash = 0;
2012 ent->persistent.trail_allowed = false;
2013 }
2015 {
2016 // don't interpolate the move
2017 ent->persistent.lerpdeltatime = 0;
2018 ent->persistent.lerpstarttime = cl.mtime[1];
2023 ent->persistent.trail_allowed = false;
2024
2025 // if(ent->state_current.frame != ent->state_previous.frame)
2026 // do this even if we did change the frame
2027 // teleport bit is only used if an animation restart, or a jump, is necessary
2028 // so it should be always harmless to do this
2029 {
2032 ent->render.framegroupblend[0].lerp = 1;ent->render.framegroupblend[1].lerp = 0;
2033 }
2034
2035 // note that this case must do everything the following case does too
2036 }
2038 {
2039 ent->render.framegroupblend[1] = ent->render.framegroupblend[0];
2040 ent->render.framegroupblend[1].lerp = 1;
2043 ent->render.framegroupblend[0].lerp = 0;
2044 }
2045 else if (DotProduct(odelta, odelta) > 1000*1000
2046 || (cl.fixangle[0] && !cl.fixangle[1])
2049 {
2050 // don't interpolate the move
2051 // (the fixangle[] check detects teleports, but not constant fixangles
2052 // such as when spectating)
2053 ent->persistent.lerpdeltatime = 0;
2054 ent->persistent.lerpstarttime = cl.mtime[1];
2059 ent->persistent.trail_allowed = false;
2060 }
2061 else if (ent->state_current.flags & RENDER_STEP)
2062 {
2063 // monster interpolation
2064 if (DotProduct(odelta, odelta) + DotProduct(adelta, adelta) > 0.01)
2065 {
2066 ent->persistent.lerpdeltatime = bound(0, cl.mtime[1] - ent->persistent.lerpstarttime, 0.1);
2067 ent->persistent.lerpstarttime = cl.mtime[1];
2072 }
2073 }
2074 else
2075 {
2076 // not a monster
2083 }
2084 // trigger muzzleflash effect if necessary
2086 ent->persistent.muzzleflash = 1;
2087
2088 // restart animation bit
2090 {
2091 ent->render.framegroupblend[1] = ent->render.framegroupblend[0];
2092 ent->render.framegroupblend[1].lerp = 1;
2095 ent->render.framegroupblend[0].lerp = 0;
2096 }
2097}
#define EF_RESTARTANIM_BIT
Definition protocol.h:88
#define EF_TELEPORT_BIT
Definition protocol.h:89
#define RENDER_STEP
Definition protocol.h:356
#define EF_MUZZLEFLASH
Definition protocol.h:69
qbool fixangle[2]
Definition client.h:800
double mtime[2]
Definition client.h:861
double shadertime
Definition client.h:366
unsigned char flags
Definition protocol.h:468
unsigned short tagentity
Definition protocol.h:451
unsigned short modelindex
Definition protocol.h:449
unsigned char tagindex
Definition protocol.h:470
float angles[3]
Definition protocol.h:445
unsigned short frame
Definition protocol.h:450
entity_persistent_t persistent
Definition client.h:474

References entity_state_t::active, entity_state_t::angles, bound, cl, DotProduct, EF_MUZZLEFLASH, EF_RESTARTANIM_BIT, EF_TELEPORT_BIT, entity_state_t::effects, client_state_t::fixangle, entity_state_t::flags, entity_state_t::frame, framegroupblend_t::frame, entity_render_t::framegroupblend, framegroupblend_t::lerp, entity_persistent_t::lerpdeltatime, entity_persistent_t::lerpstarttime, entity_state_t::modelindex, client_state_t::mtime, entity_persistent_t::muzzleflash, entity_persistent_t::newangles, entity_persistent_t::neworigin, entity_persistent_t::oldangles, entity_persistent_t::oldorigin, entity_state_t::origin, entity_t::persistent, entity_t::render, RENDER_STEP, entity_render_t::shadertime, framegroupblend_t::start, entity_t::state_current, entity_t::state_previous, entity_state_t::tagentity, entity_state_t::tagindex, client_state_t::time, entity_state_t::time, entity_persistent_t::trail_allowed, VectorCopy, and VectorSubtract.

Referenced by EntityFrame4_CL_ReadFrame(), EntityFrame5_CL_ReadFrame(), EntityFrame_CL_ReadFrame(), EntityFrameQuake_ReadEntity(), EntityFrameQW_CL_ReadFrame(), and EntityStateQW_ReadPlayerUpdate().

◆ CL_NewBeam()

void CL_NewBeam ( int ent,
vec3_t start,
vec3_t end,
model_t * m,
int lightning )

Definition at line 2356 of file cl_parse.c.

2357{
2358 int i;
2359 beam_t *b = NULL;
2360
2361 if (ent >= MAX_EDICTS)
2362 {
2363 Con_Printf("CL_NewBeam: invalid entity number %i\n", ent);
2364 ent = 0;
2365 }
2366
2367 if (ent >= cl.max_entities)
2368 CL_ExpandEntities(ent);
2369
2370 // override any beam with the same entity
2371 i = cl.max_beams;
2372 if (ent)
2373 for (i = 0, b = cl.beams;i < cl.max_beams;i++, b++)
2374 if (b->entity == ent)
2375 break;
2376 // if the entity was not found then just replace an unused beam
2377 if (i == cl.max_beams)
2378 for (i = 0, b = cl.beams;i < cl.max_beams;i++, b++)
2379 if (!b->model)
2380 break;
2381 if (i < cl.max_beams)
2382 {
2383 cl.num_beams = max(cl.num_beams, i + 1);
2384 b->entity = ent;
2385 b->lightning = lightning;
2386 b->model = m;
2387 b->endtime = cl.mtime[0] + 0.2;
2388 VectorCopy (start, b->start);
2389 VectorCopy (end, b->end);
2390 }
2391 else
2392 Con_DPrint("beam list overflow!\n");
2393}
void CL_ExpandEntities(int num)
Definition cl_main.c:300

References b, client_state_t::beams, cl, CL_ExpandEntities(), Con_DPrint(), Con_Printf(), i, max, client_state_t::max_beams, MAX_EDICTS, client_state_t::max_entities, client_state_t::mtime, NULL, client_state_t::num_beams, and VectorCopy.

Referenced by CL_ParseBeam(), VM_CL_te_beam(), VM_CL_te_lightning1(), VM_CL_te_lightning2(), and VM_CL_te_lightning3().

◆ CL_NewFrameReceived()

◆ CL_NewTempEntity()

entity_render_t * CL_NewTempEntity ( double shadertime)

Definition at line 794 of file cl_main.c.

795{
796 entity_render_t *render;
797
799 return NULL;
801 {
802 r_refdef.scene.expandtempentities = true; // will be reallocated next frame since current frame may have pointers set already
803 return NULL;
804 }
806 memset (render, 0, sizeof(*render));
808
809 render->shadertime = shadertime;
810 render->alpha = 1;
811 VectorSet(render->colormod, 1, 1, 1);
812 VectorSet(render->glowmod, 1, 1, 1);
813 return render;
814}

References entity_render_t::alpha, entity_render_t::colormod, r_refdef_scene_t::entities, r_refdef_scene_t::expandtempentities, entity_render_t::glowmod, r_refdef_scene_t::maxentities, r_refdef_scene_t::maxtempentities, NULL, r_refdef_scene_t::numentities, r_refdef_scene_t::numtempentities, r_refdef, r_refdef_t::scene, entity_render_t::shadertime, r_refdef_scene_t::tempentities, and VectorSet.

Referenced by CL_AddQWCTFFlagModel(), CL_RelinkBeams(), CL_RelinkEffects(), CL_RelinkQWNails(), and CSQC_AddRenderEdict().

◆ CL_NextDemo()

void CL_NextDemo ( void )

Definition at line 50 of file cl_demo.c.

51{
52 char str[MAX_INPUTLINE];
53
54 if (cls.demonum == -1)
55 return; // don't play demos
56
57 if (!cls.demos[cls.demonum][0] || cls.demonum == MAX_DEMOS)
58 {
59 cls.demonum = 0;
60 if (!cls.demos[cls.demonum][0])
61 {
62 Con_Print("No demos listed with startdemos\n");
63 cls.demonum = -1;
64 return;
65 }
66 }
67
68 dpsnprintf (str, sizeof(str), "playdemo %s\n", cls.demos[cls.demonum]);
70 cls.demonum++;
71}
void Cbuf_InsertText(cmd_state_t *cmd, const char *text)
Definition cmd.c:292
void Con_Print(const char *msg)
Prints to all appropriate console targets, and adds timestamps.
Definition console.c:1504
#define MAX_DEMOS
max demos provided to demos command
Definition qdefs.h:118
char demos[MAX_DEMOS][MAX_DEMONAME]
Definition client.h:578

References Cbuf_InsertText(), cls, cmd_local, Con_Print(), client_static_t::demonum, client_static_t::demos, dpsnprintf(), MAX_DEMOS, and MAX_INPUTLINE.

Referenced by CL_Demos_f(), CL_ParseServerMessage(), and CL_Startdemos_f().

◆ CL_ParseEntityLump()

void CL_ParseEntityLump ( char * entitystring)

Definition at line 384 of file cl_parse.c.

385{
386 qbool loadedsky = false;
387 const char *data;
388 char key[128], value[MAX_INPUTLINE];
389 FOG_clear(); // LadyHavoc: no fog until set
390 // LadyHavoc: default to the map's sky (q3 shader parsing sets this)
391 R_SetSkyBox(cl.worldmodel->brush.skybox);
392 data = entdata;
393 if (!data)
394 return;
395 if (!COM_ParseToken_Simple(&data, false, false, true))
396 return; // error
397 if (com_token[0] != '{')
398 return; // error
399 while (1)
400 {
401 if (!COM_ParseToken_Simple(&data, false, false, true))
402 return; // error
403 if (com_token[0] == '}')
404 break; // end of worldspawn
405 if (com_token[0] == '_')
406 dp_strlcpy (key, com_token + 1, sizeof (key));
407 else
408 dp_strlcpy (key, com_token, sizeof (key));
409 while (key[strlen(key)-1] == ' ') // remove trailing spaces
410 key[strlen(key)-1] = 0;
411 if (!COM_ParseToken_Simple(&data, false, false, true))
412 return; // error
413 dp_strlcpy (value, com_token, sizeof (value));
414 if (!strcmp("sky", key))
415 {
416 loadedsky = true;
418 }
419 else if (!strcmp("skyname", key)) // non-standard, introduced by QuakeForge... sigh.
420 {
421 loadedsky = true;
423 }
424 else if (!strcmp("qlsky", key)) // non-standard, introduced by QuakeLives (EEK)
425 {
426 loadedsky = true;
428 }
429 else if (!strcmp("fog", key))
430 {
431 FOG_clear(); // so missing values get good defaults
434 r_refdef.fog_end = 16384;
435 r_refdef.fog_height = 1<<30;
437#if _MSC_VER >= 1400
438#define sscanf sscanf_s
439#endif
441 }
442 else if (!strcmp("fog_density", key))
443 r_refdef.fog_density = atof(value);
444 else if (!strcmp("fog_red", key))
445 r_refdef.fog_red = atof(value);
446 else if (!strcmp("fog_green", key))
447 r_refdef.fog_green = atof(value);
448 else if (!strcmp("fog_blue", key))
449 r_refdef.fog_blue = atof(value);
450 else if (!strcmp("fog_alpha", key))
451 r_refdef.fog_alpha = atof(value);
452 else if (!strcmp("fog_start", key))
453 r_refdef.fog_start = atof(value);
454 else if (!strcmp("fog_end", key))
455 r_refdef.fog_end = atof(value);
456 else if (!strcmp("fog_height", key))
457 r_refdef.fog_height = atof(value);
458 else if (!strcmp("fog_fadedepth", key))
460 else if (!strcmp("fog_heighttexture", key))
461 {
462 FOG_clear(); // so missing values get good defaults
463#if _MSC_VER >= 1400
465#else
467#endif
469 }
470 }
471
472 if (!loadedsky && cl.worldmodel->brush.isq2bsp)
473 R_SetSkyBox("unit1_");
474}
char com_token[MAX_INPUTLINE]
Definition common.c:39
qbool COM_ParseToken_Simple(const char **datapointer, qbool returnnewline, qbool parsebackslash, qbool parsecomments)
Definition common.c:463
void FOG_clear(void)
Definition gl_rmain.c:349
GLsizeiptr const GLvoid * data
Definition glquake.h:639
int R_SetSkyBox(const char *sky)
Definition r_sky.c:149
char fog_height_texturename[64]
Definition render.h:444
float fog_start
Definition render.h:436
float fog_density
Definition render.h:431
float fog_height
Definition render.h:438
float fog_green
Definition render.h:433
float fog_alpha
Definition render.h:435
float fog_fadedepth
Definition render.h:439
float fog_end
Definition render.h:437
float fog_blue
Definition render.h:434
float fog_red
Definition render.h:432

References cl, COM_ParseToken_Simple(), com_token, data, dp_strlcpy, r_refdef_t::fog_alpha, r_refdef_t::fog_blue, FOG_clear(), r_refdef_t::fog_density, r_refdef_t::fog_end, r_refdef_t::fog_fadedepth, r_refdef_t::fog_green, r_refdef_t::fog_height, r_refdef_t::fog_height_texturename, r_refdef_t::fog_red, r_refdef_t::fog_start, MAX_INPUTLINE, r_refdef, R_SetSkyBox(), strlen(), value, and client_state_t::worldmodel.

Referenced by gl_main_newmap().

◆ CL_ParseTEnt()

void CL_ParseTEnt ( void )

◆ CL_PasteDemo()

void CL_PasteDemo ( unsigned char ** buf,
fs_offset_t * filesize )

Definition at line 160 of file cl_demo.c.

161{
162 fs_offset_t startoffset = 0;
163
164 if(!*buf)
165 return;
166
167 // skip cdtrack
168 while(startoffset < *filesize && ((char *)(*buf))[startoffset] != '\n')
169 ++startoffset;
170 if(startoffset < *filesize)
171 ++startoffset;
172
173 FS_Write(cls.demofile, *buf + startoffset, *filesize - startoffset);
174
175 Mem_Free(*buf);
176 *buf = NULL;
177 *filesize = 0;
178}
fs_offset_t FS_Write(qfile_t *file, const void *data, size_t datasize)
Definition fs.c:3019

References buf, cls, client_static_t::demofile, FS_Write(), Mem_Free, and NULL.

Referenced by CL_VM_Init().

◆ CL_PlayDemo()

void CL_PlayDemo ( const char * demo)

Definition at line 413 of file cl_demo.c.

414{
415 char name[MAX_QPATH];
416 int c;
417 qbool neg = false;
418 qfile_t *f;
419
420 // open the demo file
421 dp_strlcpy (name, demo, sizeof (name));
422 FS_DefaultExtension (name, ".dem", sizeof (name));
423 f = FS_OpenVirtualFile(name, false);
424 if (!f)
425 {
426 Con_Printf(CON_ERROR "ERROR: couldn't open %s.\n", name);
427 cls.demonum = -1; // stop demo loop
428 return;
429 }
430
431 cls.demostarting = true;
432
433 // disconnect from server
435
436 // update networking ports (this is mainly just needed at startup)
438
440
441 Con_Printf("Playing demo %s.\n", name);
442 cls.demofile = f;
444
445 cls.demoplayback = true;
447 cls.forcetrack = 0;
448
449 while ((c = FS_Getc (cls.demofile)) != '\n')
450 if (c == '-')
451 neg = true;
452 else
453 cls.forcetrack = cls.forcetrack * 10 + (c - '0');
454
455 if (neg)
457
458 cls.demostarting = false;
459}
@ PROTOCOL_QUAKE
quake (aka netquake/normalquake/nq) protocol
Definition common.h:144
qfile_t * FS_OpenVirtualFile(const char *filepath, qbool quiet)
Definition fs.c:2928
void FS_DefaultExtension(char *path, const char *extension, size_t size_path)
Definition fs.c:3641
int FS_Getc(qfile_t *file)
Definition fs.c:3323
qbool demostarting
Definition client.h:588

References ca_connected, CL_Disconnect(), cls, CON_ERROR, Con_Printf(), client_static_t::demofile, client_static_t::demoname, client_static_t::demonum, client_static_t::demoplayback, client_static_t::demostarting, dp_strlcpy, f, client_static_t::forcetrack, FS_DefaultExtension(), FS_Getc(), FS_OpenVirtualFile(), MAX_QPATH, name, NetConn_UpdateSockets(), client_static_t::protocol, PROTOCOL_QUAKE, and client_static_t::state.

Referenced by CL_PlayDemo_f(), and CL_TimeDemo_f().

◆ CL_PlayDemo_f()

void CL_PlayDemo_f ( cmd_state_t * cmd)

Definition at line 468 of file cl_demo.c.

469{
470 if (Cmd_Argc(cmd) != 2)
471 {
472 Con_Print("playdemo <demoname> : plays a demo\n");
473 return;
474 }
475
477}
void CL_PlayDemo(const char *demo)
Definition cl_demo.c:413

References CL_PlayDemo(), cmd(), Cmd_Argc(), Cmd_Argv(), and Con_Print().

Referenced by CL_Demo_Init().

◆ CL_ReadDemoMessage()

void CL_ReadDemoMessage ( void )

Definition at line 187 of file cl_demo.c.

188{
189 int i;
190 float f;
191
192 if (!cls.demoplayback)
193 return;
194
195 // LadyHavoc: pausedemo
196 if (cls.demopaused)
197 return;
198
199 for (;;)
200 {
201 // decide if it is time to grab the next message
202 // always grab until fully connected
203 if (cls.signon == SIGNONS)
204 {
205 if (cls.timedemo)
206 {
207 cls.td_frames++;
209 // if this is the first official frame we can now grab the real
210 // td_starttime so the bogus time on the first frame doesn't
211 // count against the final report
212 if (cls.td_frames == 0)
213 {
222 }
224 {
226 if (cls.td_onesecondavgcount == 0)
227 {
230 }
234 cls.td_onesecondavgfps += fps;
238 }
239 }
240 else if (cl.time < cl.mtime[0])
241 {
242 // don't need another message yet
243 return;
244 }
245 }
246
247 /* At signon 1 the cl_begindownloads command starts the world and, if applicable,
248 * boots up CSQC which may be required to parse the next message.
249 * That will be delayed if curl must first (down)load the map.
250 */
251 if (cls.signon == 1 && cl.loadcsqc) // waiting for CL_VM_Init() to be called
252 return;
253
254 // get the next message
257 if(cl_message.cursize & DEMOMSG_CLIENT_TO_SERVER) // This is a client->server message! Ignore for now!
258 {
259 // skip over demo packet
261 continue;
262 }
264 {
265 CL_DisconnectEx(false, "Demo message (%i) > cl_message.maxsize (%i)", cl_message.cursize, cl_message.maxsize);
267 return;
268 }
270 for (i = 0;i < 3;i++)
271 {
272 FS_Read(cls.demofile, &f, 4);
274 }
275
277 {
280
281 if (cls.signon != SIGNONS)
282 Cbuf_Execute((cmd_local)->cbuf); // immediately execute svc_stufftext if in the demo before connect!
283
284 // In case the demo contains a "svc_disconnect" message
285 if (!cls.demoplayback)
286 return;
287
288 if (cls.timedemo)
289 return;
290 }
291 else
292 {
294 return;
295 }
296 }
297}
void CL_ParseServerMessage(void)
Definition cl_parse.c:3435
void Cbuf_Execute(cmd_buf_t *cbuf)
Definition cmd.c:351
void MSG_BeginReading(sizebuf_t *sb)
Definition com_msg.c:257
#define LittleLong(l)
Definition common.h:92
#define LittleFloat(l)
Definition common.h:94
fs_offset_t FS_Read(qfile_t *file, void *buffer, size_t buffersize)
Definition fs.c:3066
int FS_Seek(qfile_t *file, fs_offset_t offset, int whence)
Definition fs.c:3359
sizebuf_t cl_message
Definition netconn.c:71
#define DEMOMSG_CLIENT_TO_SERVER
Definition quakedef.h:178
qbool loadcsqc
Definition client.h:1026
vec3_t mviewangles[2]
Definition client.h:786
double td_onesecondframes
Definition client.h:597
double td_onesecondavgfps
Definition client.h:601
double td_onesecondrealtime
Definition client.h:598
double td_onesecondmaxfps
Definition client.h:600
int td_onesecondavgcount
Definition client.h:602
double td_starttime
Definition client.h:594
double td_onesecondnexttime
Definition client.h:596
double td_onesecondminfps
Definition client.h:599
double realtime
the accumulated mainloop time since application started (with filtering), without any slowmo or clamp...
Definition host.h:46
unsigned char * data
Definition common.h:52
int cursize
Definition common.h:54
int maxsize
Definition common.h:53

References Cbuf_Execute(), cl, CL_Disconnect(), CL_DisconnectEx(), cl_message, CL_ParseServerMessage(), cls, cmd_local, sizebuf_t::cursize, sizebuf_t::data, client_static_t::demofile, DEMOMSG_CLIENT_TO_SERVER, client_static_t::demopaused, client_static_t::demoplayback, f, FS_Read(), FS_Seek(), host, i, LittleFloat, LittleLong, client_state_t::loadcsqc, max, sizebuf_t::maxsize, min, MSG_BeginReading(), client_state_t::mtime, client_state_t::mviewangles, host_static_t::realtime, client_static_t::signon, SIGNONS, client_static_t::td_frames, client_static_t::td_onesecondavgcount, client_static_t::td_onesecondavgfps, client_static_t::td_onesecondframes, client_static_t::td_onesecondmaxfps, client_static_t::td_onesecondminfps, client_static_t::td_onesecondnexttime, client_static_t::td_onesecondrealtime, client_static_t::td_starttime, client_state_t::time, client_static_t::timedemo, and VectorCopy.

Referenced by CL_Frame().

◆ CL_Record_f()

void CL_Record_f ( cmd_state_t * cmd)

Definition at line 346 of file cl_demo.c.

347{
348 int c, track;
349 char name[MAX_OSPATH];
350 char vabuf[1024];
351 int vabuf_len;
352
353 c = Cmd_Argc(cmd);
354 if (c != 2 && c != 3 && c != 4)
355 {
356 Con_Print("record <demoname> [<map> [cd track]]\n");
357 return;
358 }
359
360 if (strstr(Cmd_Argv(cmd, 1), ".."))
361 {
362 Con_Print("Relative pathnames are not allowed.\n");
363 return;
364 }
365
366 if (c == 2 && cls.state == ca_connected)
367 {
368 Con_Print("Can not record - already connected to server\nClient demo recording must be started before connecting\n");
369 return;
370 }
371
372 if (cls.state == ca_connected)
374
375 // write the forced cd track number, or -1
376 if (c == 4)
377 {
378 track = atoi(Cmd_Argv(cmd, 3));
379 Con_Printf("Forcing CD track to %i\n", cls.forcetrack);
380 }
381 else
382 track = -1;
383
384 // get the demo name
385 dp_strlcpy (name, Cmd_Argv(cmd, 1), sizeof (name));
386 FS_DefaultExtension (name, ".dem", sizeof (name));
387
388 // start the map up
389 if (c > 2)
390 {
391 vabuf_len = dpsnprintf(vabuf, sizeof(vabuf), "map %s", Cmd_Argv(cmd, 2));
392 Cmd_ExecuteString(cmd, vabuf, vabuf_len, src_local, false);
393 }
394
395 // open the demo file
396 Con_Printf("recording to %s.\n", name);
397 cls.demofile = FS_OpenRealFile(name, "wb", false);
398 if (!cls.demofile)
399 {
400 Con_Print(CON_ERROR "ERROR: couldn't open.\n");
401 return;
402 }
404
405 cls.forcetrack = track;
407
408 cls.demorecording = true;
411}
void Cmd_ExecuteString(cmd_state_t *cmd, const char *text, size_t textlen, cmd_source_t src, qbool lockmutex)
Parses a single line of text into arguments and tries to execute it.
Definition cmd.c:2068
@ src_local
from the command buffer
Definition cmd.h:75
#define MAX_OSPATH
max length of a filesystem pathname
Definition qdefs.h:175
int demo_lastcsprogscrc
Definition client.h:586
fs_offset_t demo_lastcsprogssize
Definition client.h:585

References ca_connected, CL_Disconnect(), cls, cmd(), Cmd_Argc(), Cmd_Argv(), Cmd_ExecuteString(), CON_ERROR, Con_Print(), Con_Printf(), client_static_t::demo_lastcsprogscrc, client_static_t::demo_lastcsprogssize, client_static_t::demofile, client_static_t::demoname, client_static_t::demorecording, dp_strlcpy, dpsnprintf(), client_static_t::forcetrack, FS_DefaultExtension(), FS_OpenRealFile(), FS_Printf(), MAX_OSPATH, name, src_local, and client_static_t::state.

Referenced by CL_Demo_Init().

◆ CL_RelinkBeams()

void CL_RelinkBeams ( void )

Definition at line 1884 of file cl_main.c.

1885{
1886 int i;
1887 beam_t *b;
1888 vec3_t dist, org, start, end;
1889 float d;
1890 entity_render_t *entrender;
1891 double yaw, pitch;
1892 float forward;
1893 matrix4x4_t tempmatrix;
1894
1895 for (i = 0, b = cl.beams;i < cl.num_beams;i++, b++)
1896 {
1897 if (!b->model)
1898 continue;
1899 if (b->endtime < cl.time)
1900 {
1901 b->model = NULL;
1902 continue;
1903 }
1904
1905 CL_Beam_CalculatePositions(b, start, end);
1906
1907 if (b->lightning)
1908 {
1910 {
1911 // FIXME: create a matrix from the beam start/end orientation
1912 vec3_t dlightcolor;
1913 VectorSet(dlightcolor, 0.3, 0.7, 1);
1914 Matrix4x4_CreateFromQuakeEntity(&tempmatrix, end[0], end[1], end[2], 0, 0, 0, 200);
1915 R_RTLight_Update(&r_refdef.scene.templights[r_refdef.scene.numlights], false, &tempmatrix, dlightcolor, -1, NULL, true, 1, 0.25, 1, 0, 0, LIGHTFLAG_NORMALMODE | LIGHTFLAG_REALTIMEMODE);
1917 }
1919 {
1921 continue;
1922 }
1923 }
1924
1925 // calculate pitch and yaw
1926 // (this is similar to the QuakeC builtin function vectoangles)
1927 VectorSubtract(end, start, dist);
1928 if (dist[1] == 0 && dist[0] == 0)
1929 {
1930 yaw = 0;
1931 if (dist[2] > 0)
1932 pitch = 90;
1933 else
1934 pitch = 270;
1935 }
1936 else
1937 {
1938 yaw = atan2(dist[1], dist[0]) * 180 / M_PI;
1939 if (yaw < 0)
1940 yaw += 360;
1941
1942 forward = sqrt (dist[0]*dist[0] + dist[1]*dist[1]);
1943 pitch = atan2(dist[2], forward) * 180 / M_PI;
1944 if (pitch < 0)
1945 pitch += 360;
1946 }
1947
1948 // add new entities for the lightning
1949 VectorCopy (start, org);
1950 d = VectorNormalizeLength(dist);
1951 while (d > 0)
1952 {
1953 entrender = CL_NewTempEntity (0);
1954 if (!entrender)
1955 return;
1956 entrender->model = b->model;
1957 Matrix4x4_CreateFromQuakeEntity(&entrender->matrix, org[0], org[1], org[2], -pitch, yaw, lhrandom(0, 360), 1);
1958 CL_UpdateRenderEntity(entrender);
1959 VectorMA(org, 30, dist, org);
1960 d -= 30;
1961 }
1962 }
1963
1964 while (cl.num_beams > 0 && !cl.beams[cl.num_beams - 1].model)
1965 cl.num_beams--;
1966}
entity_render_t * CL_NewTempEntity(double shadertime)
Definition cl_main.c:794
#define LIGHTFLAG_NORMALMODE
Definition client.h:34
#define LIGHTFLAG_REALTIMEMODE
Definition client.h:35
void CL_Beam_AddPolygons(const beam_t *b)
float VectorNormalizeLength(vec3_t v)
returns vector length
Definition mathlib.c:763
#define lhrandom(MIN, MAX)
LadyHavoc: this function never returns exactly MIN or exactly MAX, because of a QuakeC bug in id1 whe...
Definition mathlib.h:48
#define M_PI
Definition mathlib.h:28
void R_RTLight_Update(rtlight_t *rtlight, int isstatic, matrix4x4_t *matrix, vec3_t color, int style, const char *cubemapname, int shadow, vec_t corona, vec_t coronasizescale, vec_t ambientscale, vec_t diffusescale, vec_t specularscale, int flags)
Definition r_shadow.c:2980
struct model_s * model
Definition client.h:91
rtlight_t templights[MAX_DLIGHTS]
Definition render.h:373
rtlight_t * lights[MAX_DLIGHTS]
Definition render.h:372
static vec3_t forward
Definition sv_user.c:305

References b, client_state_t::beams, cl, CL_Beam_AddPolygons(), CL_Beam_CalculatePositions(), cl_beams_lightatend, cl_beams_polygons, CL_NewTempEntity(), CL_UpdateRenderEntity(), forward, i, cvar_t::integer, lhrandom, LIGHTFLAG_NORMALMODE, LIGHTFLAG_REALTIMEMODE, r_refdef_scene_t::lights, M_PI, entity_render_t::matrix, Matrix4x4_CreateFromQuakeEntity(), MAX_DLIGHTS, beam_t::model, entity_render_t::model, NULL, client_state_t::num_beams, r_refdef_scene_t::numlights, r_refdef, R_RTLight_Update(), r_refdef_t::scene, sqrt(), r_refdef_scene_t::templights, client_state_t::time, VectorCopy, VectorMA, VectorNormalizeLength(), VectorSet, and VectorSubtract.

Referenced by CSQC_RelinkAllEntities().

◆ CL_RelinkLightFlashes()

void CL_RelinkLightFlashes ( void )

Definition at line 935 of file cl_main.c.

936{
937 int i, j, k, l;
938 dlight_t *dl;
939 float frac, f;
940 matrix4x4_t tempmatrix;
941
942 if (r_dynamic.integer)
943 {
944 for (i = 0, dl = cl.dlights;i < cl.num_dlights && r_refdef.scene.numlights < MAX_DLIGHTS;i++, dl++)
945 {
946 if (dl->radius)
947 {
948 tempmatrix = dl->matrix;
949 Matrix4x4_Scale(&tempmatrix, dl->radius, 1);
950 // we need the corona fading to be persistent
951 R_RTLight_Update(&dl->rtlight, false, &tempmatrix, dl->color, dl->style, dl->cubemapname, dl->shadow, dl->corona, dl->coronasizescale, dl->ambientscale, dl->diffusescale, dl->specularscale, dl->flags);
953 }
954 }
955 }
956
957 if (!cl.lightstyle)
958 {
959 for (j = 0;j < cl.max_lightstyle;j++)
960 {
963 }
964 return;
965 }
966
967// light animations
968// 'm' is normal light, 'a' is no light, 'z' is double bright
969 f = cl.time * 10;
970 i = (int)floor(f);
971 frac = f - i;
972 for (j = 0;j < cl.max_lightstyle;j++)
973 {
974 if (!cl.lightstyle[j].length)
975 {
978 continue;
979 }
980 // static lightstyle "=value"
981 if (cl.lightstyle[j].map[0] == '=')
982 {
984 if ( r_lerplightstyles.integer || ((int)f - f) < 0.01)
986 continue;
987 }
988 k = i % cl.lightstyle[j].length;
989 l = (i-1) % cl.lightstyle[j].length;
990 k = cl.lightstyle[j].map[k] - 'a';
991 l = cl.lightstyle[j].map[l] - 'a';
992 // rtlightstylevalue is always interpolated because it has no bad
993 // consequences for performance
994 // lightstylevalue is subject to a cvar for performance reasons;
995 // skipping lightmap updates on most rendered frames substantially
996 // improves framerates (but makes light fades look bad)
997 r_refdef.scene.rtlightstylevalue[j] = ((k*frac)+(l*(1-frac)))*(22/256.0f);
998 r_refdef.scene.lightstylevalue[j] = r_lerplightstyles.integer ? (unsigned short)(((k*frac)+(l*(1-frac)))*22) : k*22;
999 }
1000}
cvar_t r_dynamic
Definition gl_rmain.c:121
cvar_t r_lerplightstyles
Definition gl_rmain.c:205
void Matrix4x4_Scale(matrix4x4_t *out, double rotatescale, double originscale)
Definition matrixlib.c:1837
rtlight_t rtlight
Definition client.h:301
char map[MAX_STYLESTRING]
Definition client.h:484
float rtlightstylevalue[MAX_LIGHTSTYLES]
float fraction of base light value
Definition render.h:377
unsigned short lightstylevalue[MAX_LIGHTSTYLES]
8.8 fraction of base light value
Definition render.h:380

References dlight_t::ambientscale, cl, dlight_t::color, dlight_t::corona, dlight_t::coronasizescale, dlight_t::cubemapname, dlight_t::diffusescale, client_state_t::dlights, f, dlight_t::flags, floor(), i, int(), cvar_t::integer, lightstyle_t::length, r_refdef_scene_t::lights, client_state_t::lightstyle, r_refdef_scene_t::lightstylevalue, lightstyle_t::map, dlight_t::matrix, Matrix4x4_Scale(), MAX_DLIGHTS, client_state_t::max_lightstyle, client_state_t::num_dlights, r_refdef_scene_t::numlights, r_dynamic, r_lerplightstyles, r_refdef, R_RTLight_Update(), dlight_t::radius, dlight_t::rtlight, r_refdef_scene_t::rtlightstylevalue, r_refdef_t::scene, dlight_t::shadow, dlight_t::specularscale, dlight_t::style, and client_state_t::time.

Referenced by CSQC_RelinkAllEntities().

◆ CL_RotateMoves()

void CL_RotateMoves ( const matrix4x4_t * m)

Definition at line 1746 of file cl_input.c.

1747{
1748 // rotate viewangles in all previous moves
1749 vec3_t v;
1750 vec3_t f, r, u;
1751 int i;
1752 for (i = 0;i < CL_MAX_USERCMDS;i++)
1753 {
1755 {
1756 usercmd_t *c = &cl.movecmd[i];
1757 AngleVectors(c->viewangles, f, r, u);
1759 Matrix4x4_Transform(m, u, v); VectorCopy(v, u);
1760 AnglesFromVectors(c->viewangles, f, u, false);
1761 }
1762 }
1763}
const GLdouble * v
Definition glquake.h:762
void AnglesFromVectors(vec3_t angles, const vec3_t forward, const vec3_t up, qbool flippitch)
LadyHavoc: calculates pitch/yaw/roll angles from forward and up vectors.
Definition mathlib.c:650
void AngleVectors(const vec3_t angles, vec3_t forward, vec3_t right, vec3_t up)
Definition mathlib.c:444
dp_FragColor r
vec3_t viewangles
Definition protocol.h:377

References AnglesFromVectors(), AngleVectors(), cl, CL_MAX_USERCMDS, cls, f, i, Matrix4x4_Transform(), client_state_t::movecmd, r, usercmd_t::sequence, client_static_t::servermovesequence, v, VectorCopy, and usercmd_t::viewangles.

Referenced by VM_CL_RotateMoves().

◆ CL_SendMove()

void CL_SendMove ( void )

Definition at line 1771 of file cl_input.c.

1772{
1773 int i, j, packetloss;
1774 int checksumindex;
1775 int bits;
1776 int maxusercmds;
1777 usercmd_t *cmd;
1778 sizebuf_t buf;
1779 unsigned char data[1024];
1780 float packettime, lag;
1781 qbool opportune_moment;
1782 qbool quemove;
1783 qbool important;
1784
1785 // if playing a demo, do nothing
1786 if (!cls.netcon)
1787 return;
1788
1789 // we don't que moves during a lag spike (potential network timeout)
1791
1792 // we build up cl.cmd and then decide whether to send or not
1793 // we store this into cl.movecmd[0] for prediction each frame even if we
1794 // do not send, to make sure that prediction is instant
1795 cl.cmd.time = cl.time;
1797
1798 // set button bits
1799 // LadyHavoc: added 6 new buttons and use and chat buttons, and prydon cursor active button
1800 bits = 0;
1801 if (in_attack.state & 3) bits |= 1;
1802 if (in_jump.state & 3) bits |= 2;
1803 if (in_button3.state & 3) bits |= 4;
1804 if (in_button4.state & 3) bits |= 8;
1805 if (in_button5.state & 3) bits |= 16;
1806 if (in_button6.state & 3) bits |= 32;
1807 if (in_button7.state & 3) bits |= 64;
1808 if (in_button8.state & 3) bits |= 128;
1809 if (in_use.state & 3) bits |= 256;
1810 if (key_dest != key_game || key_consoleactive || !vid_activewindow) bits |= 512;
1811 if (cl_prydoncursor.integer > 0) bits |= 1024;
1812 if (in_button9.state & 3) bits |= 2048;
1813 if (in_button10.state & 3) bits |= 4096;
1814 if (in_button11.state & 3) bits |= 8192;
1815 if (in_button12.state & 3) bits |= 16384;
1816 if (in_button13.state & 3) bits |= 32768;
1817 if (in_button14.state & 3) bits |= 65536;
1818 if (in_button15.state & 3) bits |= 131072;
1819 if (in_button16.state & 3) bits |= 262144;
1820 // button bits 19-31 unused currently
1821 // rotate/zoom view serverside if PRYDON_CLIENTCURSOR cursor is at edge of screen
1822 if(cl_prydoncursor.integer > 0)
1823 {
1824 if (cl.cmd.cursor_screen[0] <= -1) bits |= 8;
1825 if (cl.cmd.cursor_screen[0] >= 1) bits |= 16;
1826 if (cl.cmd.cursor_screen[1] <= -1) bits |= 32;
1827 if (cl.cmd.cursor_screen[1] >= 1) bits |= 64;
1828 }
1829
1830 // set buttons and impulse
1831 cl.cmd.buttons = bits;
1833
1834 // set viewangles
1836
1837 // bones_was_here: previously cl.cmd.frametime was floored to nearest millisec
1838 // this meant the smoothest async movement required integer millisec
1839 // client and server frame times (eg 125fps)
1840 cl.cmd.frametime = bound(0.0, cl.cmd.time - cl.movecmd[1].time, 0.255);
1841 // ridiculous value rejection (matches qw)
1842 if (cl.cmd.frametime > 0.25)
1843 cl.cmd.frametime = 0.1;
1844 cl.cmd.msec = (unsigned char)floor(cl.cmd.frametime * 1000);
1845
1846 switch(cls.protocol)
1847 {
1849 // quakeworld uses a different cvar with opposite meaning, for compatibility
1851 break;
1856 break;
1857 default:
1858 cl.cmd.predicted = false;
1859 break;
1860 }
1861
1862 // movement is set by input code (forwardmove/sidemove/upmove)
1863 // always dump the first two moves, because they may contain leftover inputs from the last level
1864 if (cl.cmd.sequence <= 2)
1866
1867 cl.cmd.jump = (cl.cmd.buttons & 2) != 0;
1868 cl.cmd.crouch = 0;
1869 switch (cls.protocol)
1870 {
1872 case PROTOCOL_QUAKE:
1873 case PROTOCOL_QUAKEDP:
1883 break;
1887 // FIXME: cl.cmd.buttons & 16 is +button5, Nexuiz/Xonotic specific
1888 cl.cmd.crouch = (cl.cmd.buttons & 16) != 0;
1889 break;
1890 case PROTOCOL_UNKNOWN:
1891 break;
1892 }
1893
1894 if (quemove)
1895 cl.movecmd[0] = cl.cmd;
1896
1897 /* Accumulating cl.realframetime to prevent low packet rates,
1898 * previously with cl_maxfps == cl_netfps it did not send every frame because
1899 * host.realtime - cl.lastpackettime was often well below (or above) cl_packetinterval.
1900 */
1902
1903 // don't predict more than 256fps
1904 if (cl.timesincepacket >= 1/256)
1905 cl.movement_replay = true; // redo the prediction
1906
1907 // now decide whether to actually send this move
1908 // (otherwise it is only for prediction)
1909
1910 // do not send 0ms packets because they mess up physics
1911 // DP servers discard (treat like lost) predicted moves shorter than 0.0005s
1912 // the time advancing check must be unaffected by time sync as it may have caused the short move
1913 if(cl.cmd.msec == 0 && cl.mtime[0] > cl.mtime[1] && (cls.protocol == PROTOCOL_QUAKEWORLD || cls.signon == SIGNONS))
1914 return;
1915
1916 // don't send too often or else network connections can get clogged by a
1917 // high renderer framerate
1918 packettime = 1.0f / bound(10.0f, cl_netfps.value, 1000.0f);
1919 if (cl.movevars_ticrate)
1920 packettime = bound(cl.movevars_ticrate * 0.5f, packettime, cl.movevars_ticrate);
1921
1922 // always send if buttons changed or an impulse is pending
1923 // even if it violates the rate limit!
1925
1926 // improve and stabilise ping by synchronising with the server
1927 lag = cl.mtime[0] - cl.cmd.time;
1928 // unknown ticrate || PL or ping spike || loading
1929 if (!cl.movevars_ticrate || lag > cl.movevars_ticrate || lag < 0)
1930 opportune_moment = false;
1931 else // sync should be possible
1932 {
1933 float frames_per_tic = cl.movevars_ticrate / cl.realframetime;
1934 opportune_moment = lag < 0.999f * (float)cl.realframetime * (frames_per_tic <= 1 ? 1 : sqrtf(frames_per_tic));
1935 }
1936
1937 // don't send too often (cl_netfps)
1938 if (!important && cl.timesincepacket < packettime * 0.999f
1939 && (!opportune_moment || cl.opt_inputs_since_update))
1940 {
1941// Con_Printf("^1moveft %f realft %f lag %f tic %f inputsince %d opp %d\n", cl.cmd.frametime, cl.realframetime, lag, cl.movevars_ticrate, cl.opt_inputs_since_update, opportune_moment);
1942 return;
1943 }
1944
1945 // don't choke the connection with packets (obey rate limit)
1946 // it is important that this check be last, because it adds a new
1947 // frame to the shownetgraph output and any cancelation after this
1948 // will produce a nasty spike-like look to the netgraph
1949 // we also still send if it is important
1950 if (!NetConn_CanSend(cls.netcon) && !important)
1951 return;
1952
1953// Con_Printf("%smoveft %f realft %f lag %f tic %f inputsince %d opp %d import %d\n", (lag < 0.0005 || !opportune_moment) ? "^3" : "^2", cl.cmd.frametime, cl.realframetime, lag, cl.movevars_ticrate, cl.opt_inputs_since_update, opportune_moment, important);
1954
1955 if (opportune_moment)
1957 cl.timesincepacket = 0;
1958
1959 buf.maxsize = sizeof(data);
1960 buf.cursize = 0;
1961 buf.data = data;
1962
1963 // send the movement message
1964 // PROTOCOL_QUAKE clc_move = 16 bytes total
1965 // PROTOCOL_QUAKEDP clc_move = 16 bytes total
1966 // PROTOCOL_NEHAHRAMOVIE clc_move = 16 bytes total
1967 // PROTOCOL_DARKPLACES1 clc_move = 19 bytes total
1968 // PROTOCOL_DARKPLACES2 clc_move = 25 bytes total
1969 // PROTOCOL_DARKPLACES3 clc_move = 25 bytes total
1970 // PROTOCOL_DARKPLACES4 clc_move = 19 bytes total
1971 // PROTOCOL_DARKPLACES5 clc_move = 19 bytes total
1972 // PROTOCOL_DARKPLACES6 clc_move = 52 bytes total
1973 // PROTOCOL_DARKPLACES7 clc_move = 56 bytes total per move (can be up to 16 moves)
1974 // PROTOCOL_DARKPLACES8 clc_move = 56 bytes total per move (can be up to 16 moves)
1975 // PROTOCOL_QUAKEWORLD clc_move = 34 bytes total (typically, but can reach 43 bytes, or even 49 bytes with roll)
1976
1977 // set prydon cursor info
1979
1981 {
1982 switch (cls.protocol)
1983 {
1986 // save the position for a checksum byte
1987 checksumindex = buf.cursize;
1988 MSG_WriteByte(&buf, 0);
1989 // packet loss percentage
1990 for (j = 0, packetloss = 0;j < NETGRAPH_PACKETS;j++)
1992 packetloss++;
1993 packetloss = packetloss * 100 / NETGRAPH_PACKETS;
1994 MSG_WriteByte(&buf, packetloss);
1995 // write most recent 3 moves
1999 // calculate the checksum
2000 buf.data[checksumindex] = COM_BlockSequenceCRCByteQW(buf.data + checksumindex + 1, buf.cursize - checksumindex - 1, cls.netcon->outgoing_unreliable_sequence);
2001 // if delta compression history overflows, request no delta
2003 cl.qw_validsequence = 0;
2004 // request delta compression if appropriate
2006 {
2010 }
2011 else
2013 break;
2014 case PROTOCOL_QUAKE:
2015 case PROTOCOL_QUAKEDP:
2020 // 5 bytes
2022 MSG_WriteFloat (&buf, cl.cmd.time); // last server packet time
2023 // 3 bytes (6 bytes in proquake)
2024 if (cls.proquake_servermod == 1) // MOD_PROQUAKE
2025 {
2026 for (i = 0;i < 3;i++)
2028 }
2029 else
2030 {
2031 for (i = 0;i < 3;i++)
2033 }
2034 // 6 bytes
2038 // 2 bytes
2041 break;
2044 // 5 bytes
2046 MSG_WriteFloat (&buf, cl.cmd.time); // last server packet time
2047 // 12 bytes
2048 for (i = 0;i < 3;i++)
2050 // 6 bytes
2054 // 2 bytes
2057 break;
2061 // 5 bytes
2063 MSG_WriteFloat (&buf, cl.cmd.time); // last server packet time
2064 // 6 bytes
2065 for (i = 0;i < 3;i++)
2067 // 6 bytes
2071 // 2 bytes
2077 // set the maxusercmds variable to limit how many should be sent
2078 maxusercmds = bound(1, cl_netrepeatinput.integer + 1, min(3, CL_MAX_USERCMDS));
2079 // when movement prediction is off, there's not much point in repeating old input as it will just be ignored
2080 if (!cl.cmd.predicted)
2081 maxusercmds = 1;
2082
2083 // send the latest moves in order, the old ones will be
2084 // ignored by the server harmlessly, however if the previous
2085 // packets were lost these moves will be used
2086 //
2087 // this reduces packet loss impact on gameplay.
2088 for (j = 0, cmd = &cl.movecmd[maxusercmds-1];j < maxusercmds;j++, cmd--)
2089 {
2090 // don't repeat any stale moves
2091 if (cmd->sequence && cmd->sequence < cls.servermovesequence)
2092 continue;
2093 // 5/9 bytes
2096 MSG_WriteLong (&buf, cmd->predicted ? cmd->sequence : 0);
2097 MSG_WriteFloat (&buf, cmd->time); // last server packet time
2098 // 6 bytes
2099 for (i = 0;i < 3;i++)
2100 MSG_WriteAngle16i (&buf, cmd->viewangles[i]);
2101 // 6 bytes
2102 MSG_WriteCoord16i (&buf, cmd->forwardmove);
2103 MSG_WriteCoord16i (&buf, cmd->sidemove);
2104 MSG_WriteCoord16i (&buf, cmd->upmove);
2105 // 5 bytes
2106 MSG_WriteLong (&buf, cmd->buttons);
2107 MSG_WriteByte (&buf, cmd->impulse);
2108 // PRYDON_CLIENTCURSOR
2109 // 30 bytes
2110 MSG_WriteShort (&buf, (short)(cmd->cursor_screen[0] * 32767.0f));
2111 MSG_WriteShort (&buf, (short)(cmd->cursor_screen[1] * 32767.0f));
2112 MSG_WriteFloat (&buf, cmd->cursor_start[0]);
2113 MSG_WriteFloat (&buf, cmd->cursor_start[1]);
2114 MSG_WriteFloat (&buf, cmd->cursor_start[2]);
2115 MSG_WriteFloat (&buf, cmd->cursor_impact[0]);
2116 MSG_WriteFloat (&buf, cmd->cursor_impact[1]);
2117 MSG_WriteFloat (&buf, cmd->cursor_impact[2]);
2118 MSG_WriteShort (&buf, cmd->cursor_entitynumber);
2119 }
2120 break;
2121 case PROTOCOL_UNKNOWN:
2122 break;
2123 }
2124 }
2125
2126 if (cls.protocol != PROTOCOL_QUAKEWORLD && buf.cursize)
2127 {
2128 // ack entity frame numbers received since the last input was sent
2129 // (redundent to improve handling of client->server packet loss)
2130 // if cl_netrepeatinput is 1 and client framerate matches server
2131 // framerate, this is 10 bytes, if client framerate is lower this
2132 // will be more...
2133 unsigned int oldsequence = cl.cmd.sequence;
2134 unsigned int delta = bound(1, cl_netrepeatinput.integer + 1, 3);
2135 if (oldsequence > delta)
2136 oldsequence = oldsequence - delta;
2137 else
2138 oldsequence = 1;
2139 for (i = 0;i < LATESTFRAMENUMS;i++)
2140 {
2142 if (cl.latestsendnums[j] >= oldsequence)
2143 {
2145 Con_Printf("send clc_ackframe %i\n", cl.latestframenums[j]);
2148 }
2149 }
2150 }
2151
2152 // PROTOCOL_DARKPLACES6 = 67 bytes per packet
2153 // PROTOCOL_DARKPLACES7 = 71 bytes per packet
2154
2155 // acknowledge any recently received data blocks
2157 {
2162 cls.dp_downloadack[i].size = 0;
2163 }
2164
2165 // send the reliable message (forwarded commands) if there is one
2166 if (buf.cursize || cls.netcon->message.cursize)
2168
2169 if (quemove)
2170 {
2171 // update the cl.movecmd array which holds the most recent moves,
2172 // because we now need a new slot for the next input
2173 for (i = CL_MAX_USERCMDS - 1;i >= 1;i--)
2174 cl.movecmd[i] = cl.movecmd[i-1];
2175 cl.movecmd[0].msec = 0;
2176 cl.movecmd[0].frametime = 0;
2177 }
2178
2179 // clear button 'click' states
2180 in_attack.state &= ~2;
2181 in_jump.state &= ~2;
2182 in_button3.state &= ~2;
2183 in_button4.state &= ~2;
2184 in_button5.state &= ~2;
2185 in_button6.state &= ~2;
2186 in_button7.state &= ~2;
2187 in_button8.state &= ~2;
2188 in_use.state &= ~2;
2189 in_button9.state &= ~2;
2190 in_button10.state &= ~2;
2191 in_button11.state &= ~2;
2192 in_button12.state &= ~2;
2193 in_button13.state &= ~2;
2194 in_button14.state &= ~2;
2195 in_button15.state &= ~2;
2196 in_button16.state &= ~2;
2197 // clear impulse
2198 in_impulse = 0;
2199
2201 CL_DisconnectEx(true, "Lost connection to server");
2202}
kbutton_t in_button3
Definition cl_input.c:57
int in_impulse
Definition cl_input.c:61
kbutton_t in_button11
Definition cl_input.c:59
kbutton_t in_button15
Definition cl_input.c:59
kbutton_t in_button6
Definition cl_input.c:57
kbutton_t in_button7
Definition cl_input.c:57
kbutton_t in_button13
Definition cl_input.c:59
kbutton_t in_button5
Definition cl_input.c:57
kbutton_t in_jump
Definition cl_input.c:54
kbutton_t in_button10
Definition cl_input.c:59
kbutton_t in_button4
Definition cl_input.c:57
static void QW_MSG_WriteDeltaUsercmd(sizebuf_t *buf, usercmd_t *from, usercmd_t *to)
Definition cl_input.c:1695
kbutton_t in_button9
Definition cl_input.c:59
usercmd_t nullcmd
Definition cl_input.c:1770
kbutton_t in_button12
Definition cl_input.c:59
static void CL_UpdatePrydonCursor(void)
Definition cl_input.c:787
kbutton_t in_button14
Definition cl_input.c:59
kbutton_t in_attack
Definition cl_input.c:54
kbutton_t in_use
Definition cl_input.c:54
kbutton_t in_button8
Definition cl_input.c:57
kbutton_t in_button16
Definition cl_input.c:59
#define CL_MAX_DOWNLOADACKS
Definition client.h:546
unsigned char COM_BlockSequenceCRCByteQW(unsigned char *base, int length, int sequence)
Definition com_crc16.c:132
void MSG_WriteShort(sizebuf_t *sb, int c)
Definition com_msg.c:138
void MSG_WriteAngle16i(sizebuf_t *sb, float f)
Definition com_msg.c:227
void MSG_WriteLong(sizebuf_t *sb, int c)
Definition com_msg.c:147
void MSG_WriteFloat(sizebuf_t *sb, float f)
Definition com_msg.c:158
void MSG_WriteAngle32f(sizebuf_t *sb, float f)
Definition com_msg.c:232
void MSG_WriteAngle8i(sizebuf_t *sb, float f)
Definition com_msg.c:222
void MSG_WriteCoord16i(sizebuf_t *sb, float f)
Definition com_msg.c:192
@ PROTOCOL_DARKPLACES2
various changes
Definition common.h:140
@ PROTOCOL_DARKPLACES4
various changes
Definition common.h:138
@ PROTOCOL_NEHAHRABJP2
same as NEHAHRABJP but with 16bit soundindex
Definition common.h:147
@ PROTOCOL_DARKPLACES3
uses EntityFrame4 entity snapshot encoder/decoder which is broken, this attempted to do partial snaps...
Definition common.h:139
@ PROTOCOL_NEHAHRABJP
same as QUAKEDP but with 16bit modelindex
Definition common.h:146
@ PROTOCOL_DARKPLACES5
uses EntityFrame5 entity snapshot encoder/decoder which is based on a Tribes networking article at ht...
Definition common.h:137
@ PROTOCOL_DARKPLACES7
added QuakeWorld-style movement protocol to allow more consistent prediction
Definition common.h:135
@ PROTOCOL_QUAKEDP
darkplaces extended quake protocol (used by TomazQuake and others), backwards compatible as long as n...
Definition common.h:142
@ PROTOCOL_UNKNOWN
Definition common.h:133
@ PROTOCOL_DARKPLACES6
various changes
Definition common.h:136
@ PROTOCOL_NEHAHRABJP3
same as NEHAHRABJP2 but with some changes
Definition common.h:148
@ PROTOCOL_NEHAHRAMOVIE
Nehahra movie protocol, a big nasty hack dating back to early days of the Quake Standards Group (but ...
Definition common.h:143
@ PROTOCOL_DARKPLACES1
uses EntityFrame entity snapshot encoder/decoder which is a QuakeWorld-like entity snapshot delta com...
Definition common.h:141
qbool NetConn_CanSend(netconn_t *conn)
Definition netconn.c:789
#define NETGRAPH_PACKETS
Definition netconn.h:222
#define NETGRAPH_LOSTPACKET
Definition netconn.h:224
#define qw_clc_delta
Definition protocol.h:958
#define clc_move
Definition protocol.h:290
#define clc_ackdownloaddata
Definition protocol.h:295
#define QW_UPDATE_BACKUP
Definition protocol.h:1033
#define qw_clc_move
Definition protocol.h:956
#define clc_ackframe
Definition protocol.h:294
#define QW_UPDATE_MASK
Definition protocol.h:1034
precision highp float
Definition shader_glsl.h:53
float movevars_ticrate
Definition client.h:1086
float last_received_message
Definition client.h:885
uint8_t opt_inputs_since_update
Definition client.h:1051
unsigned int qw_validsequence
Definition client.h:1104
float timesincepacket
Definition client.h:1049
cl_downloadack_t dp_downloadack[CL_MAX_DOWNLOADACKS]
Definition client.h:634
int proquake_servermod
Definition client.h:683
netgraphitem_t incoming_netgraph[NETGRAPH_PACKETS]
Definition netconn.h:227
unsigned int outgoing_unreliable_sequence
used by both NQ and QW protocols
Definition netconn.h:176
int unreliablebytes
Definition netconn.h:136
qbool overflowed
set to true if the buffer size failed
Definition common.h:51
int impulse
Definition protocol.h:396
qbool predicted
Definition protocol.h:399
double time
Definition protocol.h:392
qbool crouch
Definition protocol.h:405
int buttons
Definition protocol.h:395

References bound, buf, usercmd_t::buttons, ca_connected, cl, CL_DisconnectEx(), CL_MAX_DOWNLOADACKS, CL_MAX_USERCMDS, cl_movement, cl_movement_nettimeout, cl_netfps, cl_netimmediatebuttons, cl_netrepeatinput, cl_nodelta, cl_nopred, cl_prydoncursor, cl_rate, cl_rate_burstsize, CL_UpdatePrydonCursor(), clc_ackdownloaddata, clc_ackframe, clc_move, cls, client_state_t::cmd, cmd(), COM_BlockSequenceCRCByteQW(), Con_Printf(), usercmd_t::crouch, sizebuf_t::cursize, usercmd_t::cursor_screen, data, client_static_t::demorecording, developer_networkentities, client_static_t::dp_downloadack, float, floor(), usercmd_t::forwardmove, usercmd_t::frametime, host, i, usercmd_t::impulse, in_attack, in_button10, in_button11, in_button12, in_button13, in_button14, in_button15, in_button16, in_button3, in_button4, in_button5, in_button6, in_button7, in_button8, in_button9, in_impulse, in_jump, in_use, netconn_t::incoming_netgraph, cvar_t::integer, usercmd_t::jump, key_consoleactive, key_dest, key_game, client_state_t::last_received_message, LATESTFRAMENUMS, client_state_t::latestframenums, client_state_t::latestframenumsposition, client_state_t::latestsendnums, max, netconn_t::message, min, client_state_t::movecmd, client_state_t::movement_replay, client_state_t::movevars_ticrate, usercmd_t::msec, MSG_WriteAngle16i(), MSG_WriteAngle32f(), MSG_WriteAngle8i(), MSG_WriteByte(), MSG_WriteCoord16i(), MSG_WriteFloat(), MSG_WriteLong(), MSG_WriteShort(), client_state_t::mtime, client_static_t::netcon, NetConn_CanSend(), NetConn_SendUnreliableMessage(), NETGRAPH_LOSTPACKET, NETGRAPH_PACKETS, nullcmd, client_state_t::opt_inputs_since_update, netconn_t::outgoing_unreliable_sequence, sizebuf_t::overflowed, usercmd_t::predicted, client_static_t::proquake_servermod, client_static_t::protocol, PROTOCOL_DARKPLACES1, PROTOCOL_DARKPLACES2, PROTOCOL_DARKPLACES3, PROTOCOL_DARKPLACES4, PROTOCOL_DARKPLACES5, PROTOCOL_DARKPLACES6, PROTOCOL_DARKPLACES7, PROTOCOL_DARKPLACES8, PROTOCOL_NEHAHRABJP, PROTOCOL_NEHAHRABJP2, PROTOCOL_NEHAHRABJP3, PROTOCOL_NEHAHRAMOVIE, PROTOCOL_QUAKE, PROTOCOL_QUAKEDP, PROTOCOL_QUAKEWORLD, PROTOCOL_UNKNOWN, qw_clc_delta, qw_clc_move, client_state_t::qw_deltasequence, QW_MSG_WriteDeltaUsercmd(), QW_UPDATE_BACKUP, QW_UPDATE_MASK, client_state_t::qw_validsequence, client_state_t::realframetime, host_static_t::realtime, usercmd_t::sequence, client_static_t::servermovesequence, usercmd_t::sidemove, client_static_t::signon, SIGNONS, cl_downloadack_t::size, cl_downloadack_t::start, client_static_t::state, kbutton_t::state, client_state_t::time, usercmd_t::time, client_state_t::timesincepacket, netgraphitem_t::unreliablebytes, usercmd_t::upmove, cvar_t::value, VectorCopy, vid_activewindow, client_state_t::viewangles, and usercmd_t::viewangles.

Referenced by CL_Frame().

◆ CL_SetEntityColormapColors()

void CL_SetEntityColormapColors ( entity_render_t * ent,
int colormap )

Definition at line 1061 of file cl_main.c.

1062{
1063 const unsigned char *cbcolor;
1064 if (colormap >= 0)
1065 {
1066 cbcolor = palette_rgb_pantscolormap[colormap & 0xF];
1067 VectorScale(cbcolor, (1.0f / 255.0f), ent->colormap_pantscolor);
1068 cbcolor = palette_rgb_shirtcolormap[(colormap & 0xF0) >> 4];
1069 VectorScale(cbcolor, (1.0f / 255.0f), ent->colormap_shirtcolor);
1070 }
1071 else
1072 {
1075 }
1076}
float colormap
#define VectorClear(a)
Definition mathlib.h:97
unsigned char palette_rgb_pantscolormap[16][3]
Definition palette.c:8
unsigned char palette_rgb_shirtcolormap[16][3]
Definition palette.c:9
vec3_t colormap_shirtcolor
Definition client.h:348
vec3_t colormap_pantscolor
Definition client.h:347

References colormap, entity_render_t::colormap_pantscolor, entity_render_t::colormap_shirtcolor, palette_rgb_pantscolormap, palette_rgb_shirtcolormap, VectorClear, and VectorScale.

Referenced by CL_UpdateNetworkEntity(), and CSQC_AddRenderEdict().

◆ CL_SetInfo()

void CL_SetInfo ( const char * key,
const char * value,
qbool send,
qbool allowstarkey,
qbool allowmodel,
qbool quiet )

Definition at line 233 of file cl_main.c.

234{
235 int i;
236 qbool fail = false;
237 char vabuf[1024];
238 if (!allowstarkey && key[0] == '*')
239 fail = true;
240 if (!allowmodel && (!strcasecmp(key, "pmodel") || !strcasecmp(key, "emodel")))
241 fail = true;
242 for (i = 0;key[i];i++)
243 if (ISWHITESPACE(key[i]) || key[i] == '\"')
244 fail = true;
245 for (i = 0;value[i];i++)
246 if (value[i] == '\r' || value[i] == '\n' || value[i] == '\"')
247 fail = true;
248 if (fail)
249 {
250 if (!quiet)
251 Con_Printf("Can't setinfo \"%s\" \"%s\"\n", key, value);
252 return;
253 }
255 if (cls.state == ca_connected && cls.netcon)
256 {
258 {
260 MSG_WriteString(&cls.netcon->message, va(vabuf, sizeof(vabuf), "setinfo \"%s\" \"%s\"", key, value));
261 }
262 else if (!strcasecmp(key, "_cl_name") || !strcasecmp(key, "name"))
263 {
265 MSG_WriteString(&cls.netcon->message, va(vabuf, sizeof(vabuf), "name \"%s\"", value));
266 }
267 else if (!strcasecmp(key, "playermodel"))
268 {
270 MSG_WriteString(&cls.netcon->message, va(vabuf, sizeof(vabuf), "playermodel \"%s\"", value));
271 }
272 else if (!strcasecmp(key, "playerskin"))
273 {
275 MSG_WriteString(&cls.netcon->message, va(vabuf, sizeof(vabuf), "playerskin \"%s\"", value));
276 }
277 else if (!strcasecmp(key, "topcolor"))
278 {
280 MSG_WriteString(&cls.netcon->message, va(vabuf, sizeof(vabuf), "color %i %i", atoi(value), cl_bottomcolor.integer));
281 }
282 else if (!strcasecmp(key, "bottomcolor"))
283 {
285 MSG_WriteString(&cls.netcon->message, va(vabuf, sizeof(vabuf), "color %i %i", cl_topcolor.integer, atoi(value)));
286 }
287 else if (!strcasecmp(key, "rate"))
288 {
290 MSG_WriteString(&cls.netcon->message, va(vabuf, sizeof(vabuf), "rate \"%s\"", value));
291 }
292 else if (!strcasecmp(key, "rate_burstsize"))
293 {
295 MSG_WriteString(&cls.netcon->message, va(vabuf, sizeof(vabuf), "rate_burstsize \"%s\"", value));
296 }
297 }
298}
cvar_t cl_bottomcolor
Definition cl_cmd.c:36
cvar_t cl_topcolor
Definition cl_cmd.c:35
char * va(char *buf, size_t buflen, const char *format,...)
Definition common.c:972

References ca_connected, cl_bottomcolor, cl_topcolor, clc_stringcmd, cls, Con_Printf(), i, InfoString_SetValue(), cvar_t::integer, ISWHITESPACE, netconn_t::message, MSG_WriteByte(), MSG_WriteString(), client_static_t::netcon, client_static_t::protocol, PROTOCOL_QUAKEWORLD, qw_clc_stringcmd, client_static_t::state, client_static_t::userinfo, va(), and value.

Referenced by CL_FullInfo_f(), CL_SetInfo_f(), Cvar_SetQuick_Internal(), and QW_CL_RequestNextDownload().

◆ CL_Shutdown()

void CL_Shutdown ( void )

Definition at line 2951 of file cl_main.c.

2952{
2953 // be quiet while shutting down
2955
2956 // disconnect client from server if active
2957 CL_Disconnect();
2958
2960
2961#ifdef CONFIG_MENU
2962 // Shutdown menu
2963 if(MR_Shutdown)
2964 MR_Shutdown();
2965#endif
2966
2967 S_Terminate ();
2968
2970 VID_Shutdown();
2971
2976
2977 Key_Shutdown();
2978
2981}
void CL_Parse_Shutdown(void)
Definition cl_parse.c:4365
void CL_Particles_Shutdown(void)
void CL_Screen_Shutdown(void)
Definition cl_screen.c:797
void CL_Video_Shutdown(void)
Definition cl_video.c:713
void Key_Shutdown(void)
Definition keys.c:1735
void(* MR_Shutdown)(void)
Definition menu.c:5481
void R_Modules_Shutdown(void)
Definition r_modules.c:67
void S_Terminate(void)
Definition snd_main.c:842
void VID_Shutdown(void)
Called at shutdown.
Definition vid_null.c:28
#define Mem_FreePool(pool)
Definition zone.h:105

References CL_Disconnect(), CL_MeshEntities_Shutdown(), CL_Parse_Shutdown(), CL_Particles_Shutdown(), CL_Screen_Shutdown(), CL_Video_Shutdown(), cls, Key_Shutdown(), client_static_t::levelmempool, Mem_FreePool, MR_Shutdown, client_static_t::permanentmempool, R_Modules_Shutdown(), S_StopAllSounds(), S_Terminate(), and VID_Shutdown().

Referenced by Host_Shutdown().

◆ CL_StartVideo()

void CL_StartVideo ( void )

Definition at line 2786 of file cl_main.c.

2787{
2788 if (!vid_opened && cls.state != ca_dedicated)
2789 {
2790 vid_opened = true;
2791#ifdef WIN32
2792 // make sure we open sockets before opening video because the Windows Firewall "unblock?" dialog can screw up the graphics context on some graphics drivers
2794#endif
2795 VID_Start();
2796 }
2797}
qbool vid_opened
Definition cl_main.c:2785
void VID_Start(void)

References ca_dedicated, cls, NetConn_UpdateSockets(), client_static_t::state, vid_opened, and VID_Start().

Referenced by Call_MR_ToggleMenu_f(), CD_f(), CDAudio_Play_byName(), CL_PlayVideo_f(), CL_VideoStart(), Host_Init(), Mod_ForName(), and R_Modules_Restart_f().

◆ CL_Stop_f()

void CL_Stop_f ( cmd_state_t * cmd)

Definition at line 307 of file cl_demo.c.

308{
310 unsigned char bufdata[64];
311
312 if (!cls.demorecording)
313 {
314 Con_Print("Not recording a demo.\n");
315 return;
316 }
317
318// write a disconnect message to the demo file
319 // LadyHavoc: don't replace the cl_message when doing this
320 buf.data = bufdata;
321 buf.maxsize = sizeof(bufdata);
322 SZ_Clear(&buf);
325
326// finish up
328 {
330 Con_Print("Completed and deleted demo\n");
331 }
332 else
333 Con_Print("Completed demo\n");
335 cls.demofile = NULL;
336 cls.demorecording = false;
337}
void CL_WriteDemoMessage(sizebuf_t *message)
Definition cl_demo.c:110
void SZ_Clear(sizebuf_t *buf)
Definition common.c:44
void FS_RemoveOnClose(qfile_t *file)
Definition fs.c:3007
#define svc_disconnect
Definition protocol.h:216

References buf, cl_autodemo, cl_autodemo_delete, CL_WriteDemoMessage(), cls, Con_Print(), client_static_t::demofile, client_static_t::demorecording, FS_Close(), FS_RemoveOnClose(), cvar_t::integer, MSG_WriteByte(), NULL, svc_disconnect, and SZ_Clear().

Referenced by CL_Demo_Init(), CL_DisconnectEx(), CL_ParseServerInfo(), and Sys_Error().

◆ CL_StopPlayback()

void CL_StopPlayback ( void )

Definition at line 81 of file cl_demo.c.

82{
83#ifdef CONFIG_VIDEO_CAPTURE
84 if (cl_capturevideo_demo_stop.integer)
85 Cvar_SetQuick(&cl_capturevideo, "0");
86#endif
87
88 if (!cls.demoplayback)
89 return;
90
92 cls.demoplayback = false;
94
95 if (cls.timedemo)
97
98 if (!cls.demostarting) // only quit if not starting another demo
99 if (Sys_CheckParm("-demo") || Sys_CheckParm("-capturedemo"))
101}
static void CL_FinishTimeDemo(void)
Definition cl_demo.c:504
void Cvar_SetQuick(cvar_t *var, const char *value)
Definition cvar.c:436
@ host_shutdown
states >= host_shutdown cause graceful shutdown, see Sys_HandleCrash() comments
Definition host.h:27
int state
Definition host.h:44

References CL_FinishTimeDemo(), cls, Cvar_SetQuick(), client_static_t::demofile, client_static_t::demoplayback, client_static_t::demostarting, FS_Close(), host, host_shutdown, cvar_t::integer, NULL, host_static_t::state, Sys_CheckParm(), and client_static_t::timedemo.

Referenced by CL_DisconnectEx().

◆ CL_TimeDemo_f()

void CL_TimeDemo_f ( cmd_state_t * cmd)

Definition at line 612 of file cl_demo.c.

613{
614 if (Cmd_Argc(cmd) != 2)
615 {
616 Con_Print("timedemo <demoname> : gets demo speeds\n");
617 return;
618 }
619
620 srand(0); // predictable random sequence for benchmarking
621
623
624// cls.td_starttime will be grabbed at the second frame of the demo, so
625// all the loading time doesn't get counted
626
627 // instantly hide console and deactivate it
630 scr_con_current = 0;
631
632 cls.timedemo = host.restless = true;
633 cls.td_frames = -2; // skip the first frame
634 cls.demonum = -1; // stop demo loop
635
636 // Might need to disable vsync
638}
unsigned int scr_con_current
Definition cl_screen.c:106

References CL_PlayDemo(), cls, cmd(), Cmd_Argc(), Cmd_Argv(), Con_Print(), Cvar_Callback(), client_static_t::demonum, host, key_consoleactive, key_dest, key_game, host_static_t::restless, scr_con_current, client_static_t::td_frames, client_static_t::timedemo, and vid_vsync.

Referenced by CL_Demo_Init().

◆ CL_UpdateEntityShading()

void CL_UpdateEntityShading ( void )

Definition at line 2777 of file cl_main.c.

2778{
2779 int i;
2781 for (i = 0; i < r_refdef.scene.numentities; i++)
2783}
static void CL_UpdateEntityShading_Entity(entity_render_t *ent)
Definition cl_main.c:2642
entity_render_t * worldentity
the world
Definition render.h:355

References CL_UpdateEntityShading_Entity(), r_refdef_scene_t::entities, i, r_refdef_scene_t::numentities, r_refdef, r_refdef_t::scene, and r_refdef_scene_t::worldentity.

Referenced by R_Envmap_f(), SCR_DrawScreen(), and VM_CL_R_RenderScene().

◆ CL_UpdateMoveVars()

void CL_UpdateMoveVars ( void )

Definition at line 1495 of file cl_input.c.

1496{
1498 {
1499 cl.moveflags = 0;
1500 }
1501 else if (cl.stats[STAT_MOVEVARS_TICRATE])
1502 {
1537 }
1538 else
1539 {
1540 cl.moveflags = 0;
1541 cl.movevars_ticrate = 0; // bones_was_here: no guessing, unavailable ticrate triggers better fallbacks
1574 }
1575
1576 if(!(cl.moveflags & MOVEFLAG_VALID))
1577 {
1578 if(gamemode == GAME_NEXUIZ) // Legacy hack to work with old servers of Nexuiz.
1580 }
1581
1583 cl.movevars_aircontrol_power = 2; // CPMA default
1584}
@ GAME_NEXUIZ
Definition com_game.h:33
#define STAT_MOVEVARS_WARSOWBUNNY_ACCEL
DP.
Definition qstats.h:37
#define STAT_MOVEFLAGS
DP.
Definition qstats.h:35
#define STAT_MOVEVARS_MAXAIRSPEED
DP.
Definition qstats.h:62
#define STAT_MOVEVARS_AIRACCELERATE
DP.
Definition qstats.h:57
#define STAT_MOVEVARS_WATERACCELERATE
DP.
Definition qstats.h:58
#define STAT_MOVEVARS_AIRACCEL_QW
DP.
Definition qstats.h:64
#define STAT_MOVEVARS_AIRSTOPACCELERATE
DP.
Definition qstats.h:41
#define STAT_MOVEVARS_TIMESCALE
DP.
Definition qstats.h:51
#define STAT_MOVEVARS_AIRSTRAFEACCEL_QW
DP.
Definition qstats.h:33
#define STAT_MOVEVARS_AIRCONTROL
DP.
Definition qstats.h:44
#define STAT_MOVEVARS_WARSOWBUNNY_BACKTOSIDERATIO
DP.
Definition qstats.h:40
#define STAT_MOVEVARS_GRAVITY
DP.
Definition qstats.h:52
#define STAT_MOVEVARS_AIRSTRAFEACCELERATE
DP.
Definition qstats.h:42
#define STAT_MOVEVARS_AIRACCEL_QW_STRETCHFACTOR
DP.
Definition qstats.h:30
#define STAT_MOVEVARS_TICRATE
DP.
Definition qstats.h:50
#define STAT_MOVEVARS_SPECTATORMAXSPEED
DP.
Definition qstats.h:55
#define STAT_MOVEVARS_MAXSPEED
DP.
Definition qstats.h:54
#define STAT_MOVEVARS_WALLFRICTION
DP.
Definition qstats.h:47
#define STAT_MOVEVARS_STEPHEIGHT
DP.
Definition qstats.h:63
#define STAT_MOVEVARS_AIRSPEEDLIMIT_NONQW
DP.
Definition qstats.h:32
#define STAT_MOVEVARS_AIRCONTROL_PENALTY
DP.
Definition qstats.h:31
#define STAT_MOVEVARS_AIRACCEL_SIDEWAYS_FRICTION
DP.
Definition qstats.h:65
#define STAT_MOVEVARS_WARSOWBUNNY_AIRFORWARDACCEL
DP.
Definition qstats.h:36
#define STAT_MOVEVARS_MAXAIRSTRAFESPEED
DP.
Definition qstats.h:43
#define STAT_MOVEVARS_STOPSPEED
DP.
Definition qstats.h:53
#define STAT_MOVEVARS_ACCELERATE
DP.
Definition qstats.h:56
#define STAT_MOVEVARS_ENTGRAVITY
DP.
Definition qstats.h:59
#define STAT_MOVEVARS_WATERFRICTION
DP.
Definition qstats.h:49
#define STAT_MOVEVARS_EDGEFRICTION
DP.
Definition qstats.h:61
#define STAT_MOVEVARS_AIRCONTROL_POWER
DP.
Definition qstats.h:34
#define STAT_MOVEVARS_WARSOWBUNNY_TURNACCEL
DP.
Definition qstats.h:39
#define STAT_MOVEVARS_JUMPVELOCITY
DP.
Definition qstats.h:60
#define STAT_MOVEVARS_WARSOWBUNNY_TOPSPEED
DP.
Definition qstats.h:38
#define STAT_MOVEVARS_FRICTION
DP.
Definition qstats.h:48
#define MOVEFLAG_Q2AIRACCELERATE
Definition quakedef.h:33
#define MOVEFLAG_VALID
Definition quakedef.h:32
cvar_t sv_gravity
Definition sv_main.c:134
float movevars_warsowbunny_airforwardaccel
Definition client.h:1081
float movevars_stopspeed
Definition client.h:1060
float movevars_maxairstrafespeed
Definition client.h:1076
float movevars_entgravity
Definition client.h:1066
float movevars_waterfriction
Definition client.h:1056
float movevars_jumpvelocity
Definition client.h:1067
float movevars_warsowbunny_accel
Definition client.h:1082
float movevars_spectatormaxspeed
Definition client.h:1062
float movevars_aircontrol
Definition client.h:1078
float movevars_airaccel_qw_stretchfactor
Definition client.h:1072
float movevars_airaccel_qw
Definition client.h:1071
float movevars_warsowbunny_topspeed
Definition client.h:1083
float movevars_gravity
Definition client.h:1059
float movevars_airspeedlimit_nonqw
Definition client.h:1087
float movevars_airstrafeaccelerate
Definition client.h:1075
float movevars_maxairspeed
Definition client.h:1069
float movevars_warsowbunny_turnaccel
Definition client.h:1084
float movevars_accelerate
Definition client.h:1063
float movevars_aircontrol_power
Definition client.h:1079
float movevars_maxspeed
Definition client.h:1061
float movevars_airaccel_sideways_friction
Definition client.h:1073
float movevars_edgefriction
Definition client.h:1068
float movevars_warsowbunny_backtosideratio
Definition client.h:1085
float movevars_friction
Definition client.h:1057
unsigned int moveflags
Definition client.h:1054
float movevars_aircontrol_penalty
Definition client.h:1080
float movevars_airaccelerate
Definition client.h:1064
float movevars_stepheight
Definition client.h:1070
float movevars_wateraccelerate
Definition client.h:1065
float movevars_airstrafeaccel_qw
Definition client.h:1077
float movevars_airstopaccelerate
Definition client.h:1074
float movevars_wallfriction
Definition client.h:1055

References cl, cl_movement_accelerate, cl_movement_airaccel_qw, cl_movement_airaccel_sideways_friction, cl_movement_airaccelerate, cl_movement_edgefriction, cl_movement_friction, cl_movement_jumpvelocity, cl_movement_maxairspeed, cl_movement_maxspeed, cl_movement_stepheight, cl_movement_stopspeed, cl_movement_wallfriction, cl_movement_wateraccelerate, cl_movement_waterfriction, cls, client_static_t::demoplayback, GAME_NEXUIZ, gamemode, host_timescale, MOVEFLAG_Q2AIRACCELERATE, MOVEFLAG_VALID, client_state_t::moveflags, client_state_t::movevars_accelerate, client_state_t::movevars_airaccel_qw, client_state_t::movevars_airaccel_qw_stretchfactor, client_state_t::movevars_airaccel_sideways_friction, client_state_t::movevars_airaccelerate, client_state_t::movevars_aircontrol, client_state_t::movevars_aircontrol_penalty, client_state_t::movevars_aircontrol_power, client_state_t::movevars_airspeedlimit_nonqw, client_state_t::movevars_airstopaccelerate, client_state_t::movevars_airstrafeaccel_qw, client_state_t::movevars_airstrafeaccelerate, client_state_t::movevars_edgefriction, client_state_t::movevars_entgravity, client_state_t::movevars_friction, client_state_t::movevars_gravity, client_state_t::movevars_jumpvelocity, client_state_t::movevars_maxairspeed, client_state_t::movevars_maxairstrafespeed, client_state_t::movevars_maxspeed, client_state_t::movevars_spectatormaxspeed, client_state_t::movevars_stepheight, client_state_t::movevars_stopspeed, client_state_t::movevars_ticrate, client_state_t::movevars_timescale, client_state_t::movevars_wallfriction, client_state_t::movevars_warsowbunny_accel, client_state_t::movevars_warsowbunny_airforwardaccel, client_state_t::movevars_warsowbunny_backtosideratio, client_state_t::movevars_warsowbunny_topspeed, client_state_t::movevars_warsowbunny_turnaccel, client_state_t::movevars_wateraccelerate, client_state_t::movevars_waterfriction, client_static_t::protocol, PROTOCOL_QUAKEWORLD, STAT_MOVEFLAGS, STAT_MOVEVARS_ACCELERATE, STAT_MOVEVARS_AIRACCEL_QW, STAT_MOVEVARS_AIRACCEL_QW_STRETCHFACTOR, STAT_MOVEVARS_AIRACCEL_SIDEWAYS_FRICTION, STAT_MOVEVARS_AIRACCELERATE, STAT_MOVEVARS_AIRCONTROL, STAT_MOVEVARS_AIRCONTROL_PENALTY, STAT_MOVEVARS_AIRCONTROL_POWER, STAT_MOVEVARS_AIRSPEEDLIMIT_NONQW, STAT_MOVEVARS_AIRSTOPACCELERATE, STAT_MOVEVARS_AIRSTRAFEACCEL_QW, STAT_MOVEVARS_AIRSTRAFEACCELERATE, STAT_MOVEVARS_EDGEFRICTION, STAT_MOVEVARS_ENTGRAVITY, STAT_MOVEVARS_FRICTION, STAT_MOVEVARS_GRAVITY, STAT_MOVEVARS_JUMPVELOCITY, STAT_MOVEVARS_MAXAIRSPEED, STAT_MOVEVARS_MAXAIRSTRAFESPEED, STAT_MOVEVARS_MAXSPEED, STAT_MOVEVARS_SPECTATORMAXSPEED, STAT_MOVEVARS_STEPHEIGHT, STAT_MOVEVARS_STOPSPEED, STAT_MOVEVARS_TICRATE, STAT_MOVEVARS_TIMESCALE, STAT_MOVEVARS_WALLFRICTION, STAT_MOVEVARS_WARSOWBUNNY_ACCEL, STAT_MOVEVARS_WARSOWBUNNY_AIRFORWARDACCEL, STAT_MOVEVARS_WARSOWBUNNY_BACKTOSIDERATIO, STAT_MOVEVARS_WARSOWBUNNY_TOPSPEED, STAT_MOVEVARS_WARSOWBUNNY_TURNACCEL, STAT_MOVEVARS_WATERACCELERATE, STAT_MOVEVARS_WATERFRICTION, client_state_t::stats, client_state_t::statsf, sv_gravity, and cvar_t::value.

Referenced by CL_ParseServerMessage().

◆ CL_UpdateRenderEntity()

void CL_UpdateRenderEntity ( entity_render_t * ent)

Definition at line 702 of file cl_main.c.

703{
704 vec3_t org;
705 vec_t scale;
706 model_t *model = ent->model;
707 // update the inverse matrix for the renderer
709 // update the animation blend state
711 // we need the matrix origin to center the box
713 // update entity->render.scale because the renderer needs it
715 if (model)
716 {
717 // NOTE: this directly extracts vector components from the matrix, which relies on the matrix orientation!
718#ifdef MATRIX4x4_OPENGLORIENTATION
719 if (ent->matrix.m[0][2] != 0 || ent->matrix.m[1][2] != 0)
720#else
721 if (ent->matrix.m[2][0] != 0 || ent->matrix.m[2][1] != 0)
722#endif
723 {
724 // pitch or roll
725 VectorMA(org, scale, model->rotatedmins, ent->mins);
726 VectorMA(org, scale, model->rotatedmaxs, ent->maxs);
727 }
728#ifdef MATRIX4x4_OPENGLORIENTATION
729 else if (ent->matrix.m[1][0] != 0 || ent->matrix.m[0][1] != 0)
730#else
731 else if (ent->matrix.m[0][1] != 0 || ent->matrix.m[1][0] != 0)
732#endif
733 {
734 // yaw
735 VectorMA(org, scale, model->yawmins, ent->mins);
736 VectorMA(org, scale, model->yawmaxs, ent->maxs);
737 }
738 else
739 {
740 VectorMA(org, scale, model->normalmins, ent->mins);
741 VectorMA(org, scale, model->normalmaxs, ent->maxs);
742 }
743 }
744 else
745 {
746 ent->mins[0] = org[0] - 16;
747 ent->mins[1] = org[1] - 16;
748 ent->mins[2] = org[2] - 16;
749 ent->maxs[0] = org[0] + 16;
750 ent->maxs[1] = org[1] + 16;
751 ent->maxs[2] = org[2] + 16;
752 }
753}
float scale
void Matrix4x4_Invert_Simple(matrix4x4_t *out, const matrix4x4_t *in1)
Definition matrixlib.c:422
double Matrix4x4_ScaleFromMatrix(const matrix4x4_t *in)
Definition matrixlib.c:1805
void VM_FrameBlendFromFrameGroupBlend(struct frameblend_s *frameblend, const struct framegroupblend_s *framegroupblend, const struct model_s *model, double curtime)
matrix4x4_t inversematrix
Definition client.h:334
vec_t m[4][4]
Definition matrixlib.h:11

References cl, entity_render_t::frameblend, entity_render_t::framegroupblend, entity_render_t::inversematrix, matrix4x4_t::m, entity_render_t::matrix, Matrix4x4_Invert_Simple(), Matrix4x4_OriginFromMatrix(), Matrix4x4_ScaleFromMatrix(), entity_render_t::maxs, entity_render_t::mins, entity_render_t::model, model, entity_render_t::scale, scale, client_state_t::time, VectorMA, and VM_FrameBlendFromFrameGroupBlend().

Referenced by CL_AddQWCTFFlagModel(), CL_ClearState(), CL_MeshEntities_Init(), CL_ParseStatic(), CL_RelinkBeams(), CL_RelinkEffects(), CL_RelinkQWNails(), CL_RelinkStaticEntities(), CL_RelinkWorld(), CL_SetupWorldModel(), CL_UpdateNetworkEntity(), CSQC_AddRenderEdict(), and VM_CL_makestatic().

◆ CL_UpdateViewEntities()

void CL_UpdateViewEntities ( void )

Definition at line 1432 of file cl_main.c.

1433{
1434 int i;
1435 // update any RENDER_VIEWMODEL entities to use the new view matrix
1436 for (i = 1;i < cl.num_entities;i++)
1437 {
1438 if (cl.entities_active[i])
1439 {
1440 entity_t *ent = cl.entities + i;
1442 CL_UpdateNetworkEntity(ent, 32, true);
1443 }
1444 }
1445 // and of course the engine viewmodel needs updating as well
1446 CL_UpdateNetworkEntity(&cl.viewent, 32, true);
1447}
static void CL_UpdateNetworkEntity(entity_t *e, int recursionlimit, qbool interpolate)
Definition cl_main.c:1079
#define RENDER_VIEWMODEL
Definition protocol.h:358
entity_t viewent
Definition client.h:937

References cl, CL_UpdateNetworkEntity(), client_state_t::entities, client_state_t::entities_active, entity_render_t::flags, i, client_state_t::num_entities, entity_t::render, RENDER_VIEWMODEL, entity_t::state_current, entity_state_t::tagentity, and client_state_t::viewent.

Referenced by VM_CL_R_RenderScene().

◆ CL_UpdateWorld()

void CL_UpdateWorld ( void )

Definition at line 2052 of file cl_main.c.

2053{
2057 r_refdef.view.quality = 1;
2058
2060
2061 if (cls.state == ca_connected && cls.signon == SIGNONS)
2062 {
2063 // prepare for a new frame
2067 V_DriftPitch();
2069
2070 // if prediction is enabled we have to update all the collidable
2071 // network entities before the prediction code can be run
2073
2074 // now update the player prediction
2076
2077 // update the player entity (which may be predicted)
2079
2080 // now update the view (which depends on that player entity)
2081 V_CalcRefdef();
2082
2083 // now update all the network entities and create particle trails
2084 // (some entities may depend on the view)
2086
2087 // update the engine-based viewmodel
2089
2090 // when csqc is loaded, it will call this in CSQC_UpdateView
2091 if (!CLVM_prog->loaded || CLVM_prog->flag & PRVM_CSQC_SIMPLE)
2092 {
2093 // clear the CL_Mesh_Scene() used for some engine effects
2095 // add engine entities and effects
2097 }
2098
2099 // decals, particles, and explosions will be updated during rneder
2100 }
2101
2103}
void CL_ClientMovement_Replay(void)
Definition cl_input.c:1607
void CSQC_RelinkAllEntities(int drawmask)
Definition cl_main.c:2021
static void CL_LerpPlayer(float frac)
Definition cl_main.c:1994
static float CL_LerpPoint(void)
Definition cl_main.c:763
void CL_ClearTempEntities(void)
Definition cl_main.c:781
static void CL_UpdateViewModel(void)
Definition cl_main.c:1508
static void CL_UpdateNetworkCollisionEntities(void)
Definition cl_main.c:1454
static void CL_UpdateNetworkEntities(void)
Definition cl_main.c:1481
static void CL_DecayLightFlashes(void)
Definition cl_main.c:902
void CL_MeshEntities_Scene_Clear(void)
Definition cl_main.c:2594
#define ENTMASK_ENGINEVIEWMODELS
Definition csprogs.h:28
#define ENTMASK_ENGINE
Definition csprogs.h:27
const matrix4x4_t identitymatrix
Definition matrixlib.c:9
#define PRVM_CSQC_SIMPLE
Definition progsvm.h:239
float quality
render quality (0 to 1) - affects r_drawparticles_drawdistance and others
Definition render.h:321
void V_DriftPitch(void)
Definition view.c:189
void V_FadeViewFlashs(void)
Definition view.c:1028
void V_CalcRefdef(void)
Definition view.c:944

References ca_connected, cl, CL_ClearTempEntities(), CL_ClientMovement_Replay(), CL_DecayLightFlashes(), CL_LerpPlayer(), CL_LerpPoint(), CL_MeshEntities_Scene_Clear(), CL_UpdateNetworkCollisionEntities(), CL_UpdateNetworkEntities(), CL_UpdateNetworkEntity(), CL_UpdateViewModel(), cls, CLVM_prog, CSQC_RelinkAllEntities(), client_state_t::entities, ENTMASK_ENGINE, ENTMASK_ENGINEVIEWMODELS, identitymatrix, r_refdef_view_t::matrix, client_state_t::num_brushmodel_entities, r_refdef_scene_t::numentities, r_refdef_scene_t::numlights, PRVM_CSQC_SIMPLE, r_refdef_view_t::quality, r_refdef, r_refdef_t::scene, client_static_t::signon, SIGNONS, client_static_t::state, client_state_t::time, r_refdef_scene_t::time, V_CalcRefdef(), V_DriftPitch(), V_FadeViewFlashs(), r_refdef_t::view, and client_state_t::viewentity.

Referenced by CL_Frame().

◆ CL_ValidateState()

void CL_ValidateState ( entity_state_t * s)

Definition at line 1962 of file cl_parse.c.

1963{
1964 model_t *model;
1965
1966 if (!s->active)
1967 return;
1968
1969 if (s->modelindex >= MAX_MODELS)
1970 Host_Error("CL_ValidateState: modelindex (%i) >= MAX_MODELS (%i)\n", s->modelindex, MAX_MODELS);
1971
1972 // these warnings are only warnings, no corrections are made to the state
1973 // because states are often copied for decoding, which otherwise would
1974 // propogate some of the corrections accidentally
1975 // (this used to happen, sometimes affecting skin and frame)
1976
1977 // colormap is client index + 1
1978 if (!(s->flags & RENDER_COLORMAPPED) && s->colormap > cl.maxclients)
1979 Con_DPrintf("CL_ValidateState: colormap (%i) > cl.maxclients (%i)\n", s->colormap, cl.maxclients);
1980
1982 {
1984 if (model && model->type && s->frame >= model->numframes)
1985 Con_DPrintf("CL_ValidateState: no such frame %i in \"%s\" (which has %i frames)\n", s->frame, model->name, model->numframes);
1986 if (model && model->type && s->skin > 0 && s->skin >= model->numskins && !(s->lightpflags & PFLAGS_FULLDYNAMIC))
1987 Con_DPrintf("CL_ValidateState: no such skin %i in \"%s\" (which has %i skins)\n", s->skin, model->name, model->numskins);
1988 }
1989}
model_t * CL_GetModelByIndex(int modelindex)
cvar_t developer_extra
Definition host.c:49
#define PFLAGS_FULLDYNAMIC
Definition protocol.h:108
#define RENDER_COLORMAPPED
Definition protocol.h:361
#define MAX_MODELS
max number of models loaded at once (including during level transitions)
Definition qdefs.h:106
unsigned char skin
Definition protocol.h:463
unsigned char colormap
Definition protocol.h:462
unsigned char lightpflags
Definition protocol.h:461

References entity_state_t::active, cl, CL_GetModelByIndex(), entity_state_t::colormap, Con_DPrintf(), developer_extra, entity_state_t::flags, entity_state_t::frame, Host_Error(), cvar_t::integer, entity_state_t::lightpflags, MAX_MODELS, client_state_t::maxclients, model, entity_state_t::modelindex, PFLAGS_FULLDYNAMIC, RENDER_COLORMAPPED, and entity_state_t::skin.

◆ CL_WriteDemoMessage()

void CL_WriteDemoMessage ( sizebuf_t * mesage)

Definition at line 110 of file cl_demo.c.

111{
112 int len;
113 int i;
114 float f;
115
116 if (cls.demopaused) // LadyHavoc: pausedemo
117 return;
118
119 len = LittleLong (message->cursize);
120 FS_Write (cls.demofile, &len, 4);
121 for (i=0 ; i<3 ; i++)
122 {
124 FS_Write (cls.demofile, &f, 4);
125 }
126 FS_Write (cls.demofile, message->data, message->cursize);
127}
string message
Definition progsdefs.qc:205

References cl, cls, client_static_t::demofile, client_static_t::demopaused, f, FS_Write(), i, LittleFloat, LittleLong, message, and client_state_t::viewangles.

Referenced by CL_ParseServerMessage(), CL_Stop_f(), and CL_VM_Init().

◆ CL_WriteToServer()

void CL_WriteToServer ( void )

Variable Documentation

◆ cl

client_state_t cl
extern

Definition at line 117 of file cl_main.c.

Referenced by CL_AddQWCTFFlagModel(), CL_AdjustAngles(), CL_AllocLightFlash(), CL_AreaStats_f(), CL_Beam_CalculatePositions(), CL_BeginDownloads(), CL_BeginDownloads_f(), CL_Cache_TraceLineSurfaces(), CL_ClearState(), CL_ClientMovement_Move(), CL_ClientMovement_Physics_CheckJump(), CL_ClientMovement_Physics_CPM_PM_Aircontrol(), CL_ClientMovement_Physics_PM_Accelerate(), CL_ClientMovement_Physics_PM_AirAccelerate(), CL_ClientMovement_Physics_Swim(), CL_ClientMovement_Physics_Walk(), CL_ClientMovement_Replay(), CL_ClientMovement_Unstick(), CL_ClientMovement_UpdateStatus(), CL_DecayLightFlashes(), CL_DisconnectEx(), CL_Effect(), CL_EntityParticles(), CL_ExaminePrintString(), CL_ExpandCSQCRenderEntities(), CL_ExpandEntities(), CL_FindNonSolidLocation(), CL_ForwardToServer(), CL_Frame(), CL_FullServerinfo_f(), CL_GetEntityLocalTagMatrix(), CL_GetModelByIndex(), CL_Input(), CL_LerpPlayer(), CL_LerpPoint(), CL_LinkEdict(), CL_LinkNetworkEntity(), CL_Locs_AddNode(), CL_Locs_Clear_f(), CL_Locs_FindNearest(), CL_Locs_FreeNode(), CL_Locs_Reload_f(), CL_Locs_Save_f(), CL_MoveLerpEntityStates(), CL_NetworkTimeReceived(), CL_NewBeam(), CL_NewFrameReceived(), CL_NewParticle(), CL_ParseClientdata(), CL_ParseEntityLump(), CL_ParseServerInfo(), CL_ParseServerMessage(), CL_ParseStartSoundPacket(), CL_ParseStatic(), CL_ParseStaticSound(), CL_ParseTempEntity(), CL_ParseTrailParticles(), CL_ParticleRain(), CL_Particles_LoadEffectInfo(), CL_PingPLReport_f(), CL_PrintEntities_f(), CL_ReadDemoMessage(), CL_ReadPointFile_f(), CL_RelinkBeams(), CL_RelinkEffects(), CL_RelinkLightFlashes(), CL_RelinkNetworkEntities(), CL_RelinkQWNails(), CL_RelinkStaticEntities(), CL_RelinkWorld(), CL_RotateMoves(), CL_SelectTraceLine(), CL_SendMove(), CL_SetupWorldModel(), CL_SoundIndexList_f(), CL_Sparks(), CL_SpawnDecalParticleForSurface(), CL_Trace_Toss(), CL_TraceBox(), CL_TraceLine(), CL_TracePoint(), CL_UpdateEntityShading_Entity(), CL_UpdateEntityShading_GetDirectedFullbright(), CL_UpdateItemsAndWeapon(), CL_UpdateMoveVars(), CL_UpdateNetworkCollisionEntities(), CL_UpdateNetworkEntities(), CL_UpdateNetworkEntity(), CL_UpdateNetworkEntityTrail(), CL_UpdatePrydonCursor(), CL_UpdateRenderEntity(), CL_UpdateScreen(), CL_UpdateViewEntities(), CL_UpdateViewModel(), CL_UpdateWorld(), CL_User_f(), CL_Users_f(), CL_ValidateState(), CL_VM_ConsoleCommand(), CL_VM_DrawHud(), CL_VM_Event_Sound(), CL_VM_GetViewEntity(), CL_VM_Init(), CL_VM_InputEvent(), CL_VM_Parse_CenterPrint(), CL_VM_Parse_Print(), CL_VM_Parse_StuffCmd(), CL_VM_Parse_TempEntity(), CL_VM_ShutDown(), CL_VM_TransformView(), CL_VM_UpdateView(), CL_WriteDemoMessage(), CLVM_begin_increase_edicts(), CLVM_free_edict(), CLVM_init_edict(), CLVM_reset_cmd(), Con_DrawNotifyRect(), Con_MaskPrint(), ConBuffer_AddLine(), ConBuffer_FixTimes(), convex_builder_add_point(), CSQC_AddPrintText(), CSQC_AddRenderEdict(), CSQC_R_RecalcView(), CSQC_ReadEntities(), CSQC_RelinkAllEntities(), CSQC_SetGlobals(), Curl_Curl_f(), EntityFrame4_CL_ReadFrame(), EntityFrame5_CL_ReadFrame(), EntityFrame_CL_ReadFrame(), EntityFrameQuake_ISeeDeadEntities(), EntityFrameQuake_ReadEntity(), EntityFrameQW_CL_ReadFrame(), EntityState5_ReadUpdate(), EntityStateQW_ReadPlayerUpdate(), Force_CenterView_f(), gl_main_newmap(), IN_BestWeapon_f(), IN_Move_TouchScreen_Quake(), IN_Move_TouchScreen_SteelStorm(), M_Menu_Main_f(), M_Menu_Save_f(), Mod_Decompile_f(), Mod_GenerateLightmaps_f(), Mod_GenerateLightmaps_SamplePoint(), Mod_Precache_f(), NetConn_IsLocalGame(), Nicks_CompleteCountPossible(), PHYS_NudgeOutOfSolid(), PRVM_GarbageCollection(), QW_CL_Changing_f(), QW_CL_ParseModelList(), QW_CL_ParseNails(), QW_CL_ParseSoundList(), QW_CL_ProcessUserInfo(), QW_CL_RequestNextDownload(), QW_CL_ServerInfo(), QW_CL_SetInfo(), QW_CL_UpdateUserInfo(), QW_TranslateEffects(), R_BuildLightMap(), R_DecalSystem_SplatEntities(), R_DrawLocs(), R_DrawModelDecals_FadeEntity(), R_DrawParticle_TransparentCallback(), R_DrawParticles(), R_GetCurrentTexture(), R_HDR_UpdateIrisAdaptation(), R_MotionBlurView(), R_MoveExplosion(), R_NewExplosion(), R_RenderScene(), R_RenderWaterPlanes(), R_ReplaceWorldTexture_f(), R_SetupShader_SetPermutationGLSL(), R_SetupShader_Surface(), R_Shadow_DrawPrepass(), R_Shadow_EditLights_Reload_f(), R_Shadow_EditLights_Save_f(), R_Shadow_LoadLightsFile(), R_Shadow_LoadWorldLights(), R_Shadow_LoadWorldLightsFromMap_LightArghliteTyrlite(), r_shadow_newmap(), R_Shadow_SaveWorldLights(), R_Stain(), R_TimeReport_EndFrame(), R_UpdateVariables(), RSurf_ActiveModelEntity(), S_FindName(), S_LocalSoundEx(), S_PaintAndSubmit(), S_SetUnderwaterIntensity(), S_StartSound_StartPosition_Flags(), S_Update(), S_UpdateAmbientSounds(), Sbar_DeathmatchOverlay(), Sbar_Draw(), Sbar_DrawFace(), Sbar_DrawFrags(), Sbar_DrawInventory(), Sbar_DrawScoreboard(), Sbar_IntermissionOverlay(), Sbar_MiniDeathmatchOverlay(), Sbar_PrintScoreboardItem(), Sbar_Score(), Sbar_ShowFPS(), Sbar_SoloScoreboard(), Sbar_SortFrags(), SCR_CenterPrint(), SCR_CheckDrawCenterString(), SCR_DrawCenterString(), SCR_DrawNet(), SCR_DrawPause(), SCR_DrawScreen(), SCR_DrawTurtle(), SCR_InfobarHeight(), SCR_ScreenShot_f(), SCR_UpdateVars(), SHOWLMP_decodehide(), SHOWLMP_decodeshow(), SHOWLMP_drawall(), SND_PickChannel(), SND_Spatialize_WithSfx(), SV_Viewframe_f(), SV_Viewmodel_f(), SV_Viewnext_f(), SV_Viewprev_f(), Sys_SDL_HandleEvents(), V_BonusFlash_f(), V_CalcIntermissionRefdef(), V_CalcRefdef(), V_CalcRefdefUsing(), V_CalcViewBlend(), V_DriftPitch(), V_FadeViewFlashs(), V_MakeViewIsometric(), V_ParseDamage(), V_StartPitchDrift(), V_StopPitchDrift(), VID_ApplyJoyState(), VID_BuildGammaTables(), VM_CL_checkpvs(), VM_CL_droptofloor(), VM_CL_findbox(), VM_CL_findradius(), VM_CL_GetEntity(), VM_CL_getinputstate(), VM_CL_getmousepos(), VM_CL_getplayerkey(), VM_CL_getstatf(), VM_CL_getstati(), VM_CL_getstats(), VM_CL_gettaginfo(), VM_CL_lightstyle(), VM_CL_makestatic(), VM_CL_precache_model(), VM_CL_R_AddEntities(), VM_CL_R_ClearScene(), VM_CL_R_SetView(), VM_CL_serverkey(), VM_CL_setcursormode(), VM_CL_setlistener(), VM_CL_setmodel(), VM_CL_setpause(), VM_CL_setsensitivityscale(), VM_CL_skel_build(), VM_CL_sound(), VM_CL_SpawnParticle(), VM_CL_SpawnParticleDelayed(), VM_CL_te_beam(), VM_CL_te_explosion(), VM_CL_te_explosion2(), VM_CL_te_explosionquad(), VM_CL_te_gunshot(), VM_CL_te_gunshotquad(), VM_CL_te_knightspike(), VM_CL_te_lightning1(), VM_CL_te_lightning2(), VM_CL_te_lightning3(), VM_CL_te_spike(), VM_CL_te_spikequad(), VM_CL_te_superspike(), VM_CL_te_superspikequad(), VM_CL_te_tarexplosion(), VM_CL_te_wizspike(), and VM_CL_V_CalcRefdef().

◆ cl_anglespeedkey

cvar_t cl_anglespeedkey
extern

Definition at line 375 of file cl_input.c.

375{CF_CLIENT | CF_ARCHIVE, "cl_anglespeedkey","1.5","how much +speed multiplies keyboard turning speed"};
#define CF_ARCHIVE
cvar should have its set value saved to config.cfg and persist across sessions
Definition cmd.h:53

Referenced by CL_AdjustAngles(), and CL_Init().

◆ cl_areagrid_link_SOLID_NOT

cvar_t cl_areagrid_link_SOLID_NOT
extern

Definition at line 112 of file cl_main.c.

112{CF_CLIENT, "cl_areagrid_link_SOLID_NOT", "1", "set to 0 to prevent SOLID_NOT entities from being linked to the area grid, and unlink any that are already linked (in the code paths that would otherwise link them), for better performance"};

Referenced by CL_Init(), and CL_LinkEdict().

◆ cl_autodemo

cvar_t cl_autodemo
extern

Definition at line 62 of file cl_main.c.

62{CF_CLIENT | CF_ARCHIVE, "cl_autodemo", "0", "records every game played, using the date/time and map name to name the demo file" };

Referenced by CL_Demo_Init(), CL_ParseServerInfo(), and CL_Stop_f().

◆ cl_autodemo_delete

cvar_t cl_autodemo_delete
extern

Definition at line 64 of file cl_main.c.

64{CF_CLIENT, "cl_autodemo_delete", "0", "3: automatically delete every newly recorded demo unless this cvar is set to 2 during a game, in case something interesting happened (cvar will be automatically set back to 3); 0: keep every newly recorded demo unless this cvar is set to 1 during a game, in case nothing interesting happened (cvar will be automatically set back to 0). Technically speaking, the value is a bitmask: bit 1 defines behaviour for all demos, bit 0 overrides behaviour for the demo currently being recorded" };

Referenced by CL_Demo_Init(), CL_ParseServerInfo(), and CL_Stop_f().

◆ cl_autodemo_nameformat

cvar_t cl_autodemo_nameformat
extern

Definition at line 63 of file cl_main.c.

63{CF_CLIENT | CF_ARCHIVE, "cl_autodemo_nameformat", "autodemos/%Y-%m-%d_%H-%M", "The format of the cl_autodemo filename, followed by the map name (the date is encoded using strftime escapes)" };

Referenced by CL_Demo_Init(), and CL_ParseServerInfo().

◆ cl_autofire

cvar_t cl_autofire
extern

◆ cl_backspeed

cvar_t cl_backspeed
extern

Definition at line 366 of file cl_input.c.

366{CF_CLIENT | CF_ARCHIVE, "cl_backspeed","400","backward movement speed"};

Referenced by CL_Init(), CL_Input(), and M_Menu_Options_AdjustSliders().

◆ cl_color

cvar_t cl_color
extern

Definition at line 252 of file cl_cmd.c.

252{CF_CLIENT | CF_ARCHIVE, "_cl_color", "0", "internal storage cvar for current player colors (changed by color command)"};

Referenced by CL_Bottomcolor_c(), CL_InitCommands(), and CL_Topcolor_c().

◆ cl_explosions_alpha_end

cvar_t cl_explosions_alpha_end
extern

Definition at line 70 of file cl_main.c.

70{CF_CLIENT | CF_ARCHIVE, "cl_explosions_alpha_end", "0","end alpha of an explosion shell (just before it disappears)"};

Referenced by CL_Init(), and R_NewExplosion().

◆ cl_explosions_alpha_start

cvar_t cl_explosions_alpha_start
extern

Definition at line 69 of file cl_main.c.

69{CF_CLIENT | CF_ARCHIVE, "cl_explosions_alpha_start", "1.5","starting alpha of an explosion shell"};

Referenced by CL_Init(), and R_NewExplosion().

◆ cl_explosions_lifetime

cvar_t cl_explosions_lifetime
extern

Definition at line 73 of file cl_main.c.

73{CF_CLIENT | CF_ARCHIVE, "cl_explosions_lifetime", "0.5","how long an explosion shell lasts"};

Referenced by CL_Init(), and R_NewExplosion().

◆ cl_explosions_size_end

cvar_t cl_explosions_size_end
extern

Definition at line 72 of file cl_main.c.

72{CF_CLIENT | CF_ARCHIVE, "cl_explosions_size_end", "128","ending alpha of an explosion shell (just before it disappears)"};

Referenced by CL_Init(), and R_NewExplosion().

◆ cl_explosions_size_start

cvar_t cl_explosions_size_start
extern

Definition at line 71 of file cl_main.c.

71{CF_CLIENT | CF_ARCHIVE, "cl_explosions_size_start", "16","starting size of an explosion shell"};

Referenced by CL_Init(), and R_NewExplosion().

◆ cl_forwardspeed

cvar_t cl_forwardspeed
extern

◆ cl_ignoremousemoves

int cl_ignoremousemoves
extern

Definition at line 474 of file cl_input.c.

Referenced by CL_Input(), VID_Mode(), VID_SetMouse(), and VM_CL_setcursormode().

◆ cl_locs_enable

cvar_t cl_locs_enable
extern

Definition at line 97 of file cl_main.c.

97{CF_CLIENT | CF_ARCHIVE, "locs_enable", "1", "enables replacement of certain % codes in chat messages: %l (location), %d (last death location), %h (health), %a (armor), %x (rockets), %c (cells), %r (rocket launcher status), %p (powerup status), %w (weapon status), %t (current time in level)"};

Referenced by CL_ForwardToServer(), and CL_Init().

◆ cl_meshentities

◆ cl_meshentitymodels

model_t cl_meshentitymodels[NUM_MESHENTITIES]
extern

Definition at line 2514 of file cl_main.c.

Referenced by CL_MeshEntities_Init().

◆ cl_meshentitynames

const char* cl_meshentitynames[NUM_MESHENTITIES]
extern

Definition at line 2515 of file cl_main.c.

2516{
2517 "MESH_SCENE",
2518 "MESH_UI",
2519};

Referenced by CL_MeshEntities_Init(), CL_MeshEntities_Restart(), and CL_MeshEntities_Start().

◆ cl_movespeedkey

cvar_t cl_movespeedkey
extern

Definition at line 369 of file cl_input.c.

369{CF_CLIENT | CF_ARCHIVE, "cl_movespeedkey","2.0","how much +speed multiplies keyboard movement speed"};

Referenced by CL_Init(), and CL_Input().

◆ cl_name

cvar_t cl_name
extern

User-visible names of these CF_USERINFO cvars must be matched in CL_SetInfo()!

Definition at line 32 of file cl_cmd.c.

32{CF_CLIENT | CF_ARCHIVE | CF_USERINFO, "_cl_name", "player", "player name"};
#define CF_USERINFO
command or cvar used to communicate userinfo to the server
Definition cmd.h:57

Referenced by CL_InitCommands(), CL_Name_f(), CL_SendPlayerInfo(), M_Menu_Setup_f(), M_Setup_Key(), and SV_Kick_f().

◆ cl_nettimesyncboundmode

cvar_t cl_nettimesyncboundmode
extern

Definition at line 192 of file cl_parse.c.

192{CF_CLIENT | CF_ARCHIVE, "cl_nettimesyncboundmode", "6", "method of restricting client time to valid values, 0 = no correction, 1 = tight bounding (jerky with packet loss), 2 = loose bounding (corrects it if out of bounds), 3 = leniant bounding (ignores temporary errors due to varying framerate), 4 = slow adjustment method from Quake3, 5 = slightly nicer version of Quake3 method, 6 = tight bounding + mode 5, 7 = jitter compensated dynamic adjustment rate"};

Referenced by CL_LerpPoint(), CL_NetworkTimeReceived(), and CL_Parse_Init().

◆ cl_nettimesyncboundtolerance

cvar_t cl_nettimesyncboundtolerance
extern

Definition at line 193 of file cl_parse.c.

193{CF_CLIENT | CF_ARCHIVE, "cl_nettimesyncboundtolerance", "0.25", "how much error is tolerated by bounding check, as a fraction of frametime, 0.25 = up to 25% margin of error tolerated, 1 = use only new time, 0 = use only old time (same effect as setting cl_nettimesyncfactor to 1) (only affects bound modes 2 and 3)"};

Referenced by CL_NetworkTimeReceived(), and CL_Parse_Init().

◆ cl_nettimesyncfactor

cvar_t cl_nettimesyncfactor
extern

Definition at line 191 of file cl_parse.c.

191{CF_CLIENT | CF_ARCHIVE, "cl_nettimesyncfactor", "0", "rate at which client time adapts to match server time, 1 = instantly, 0.125 = slowly, 0 = not at all (only applied in bound modes 0, 1, 2, 3)"};

Referenced by CL_NetworkTimeReceived(), and CL_Parse_Init().

◆ cl_pitchdriftspeed

cvar_t cl_pitchdriftspeed
extern

◆ cl_pitchspeed

cvar_t cl_pitchspeed
extern

Definition at line 373 of file cl_input.c.

373{CF_CLIENT | CF_ARCHIVE, "cl_pitchspeed","150","keyboard pitch turning speed"};

Referenced by CL_AdjustAngles(), CL_Init(), IN_Move_TouchScreen_Quake(), IN_Move_TouchScreen_SteelStorm(), and VID_ApplyJoyState().

◆ cl_playermodel

cvar_t cl_playermodel
extern

Definition at line 36 of file common.c.

36{CF_CLIENT | CF_SERVER | CF_USERINFO | CF_ARCHIVE, "playermodel", "", "current player model in Nexuiz/Xonotic"};

Referenced by CL_SendPlayerInfo(), and COM_Init_Commands().

◆ cl_playerskin

cvar_t cl_playerskin
extern

Definition at line 37 of file common.c.

37{CF_CLIENT | CF_SERVER | CF_USERINFO | CF_ARCHIVE, "playerskin", "", "current player skin in Nexuiz/Xonotic"};

Referenced by CL_SendPlayerInfo(), and COM_Init_Commands().

◆ cl_pmodel

cvar_t cl_pmodel
extern

Definition at line 40 of file cl_cmd.c.

40{CF_CLIENT | CF_USERINFO | CF_ARCHIVE, "pmodel", "0", "current player model number in nehahra"};

Referenced by CL_InitCommands(), and CL_SendPlayerInfo().

◆ cl_prydoncursor

cvar_t cl_prydoncursor
extern

Definition at line 92 of file cl_main.c.

92{CF_CLIENT, "cl_prydoncursor", "0", "enables a mouse pointer which is able to click on entities in the world, useful for point and click mods, see PRYDON_CLIENTCURSOR extension in dpextensions.qc"};

Referenced by CL_Init(), CL_Input(), CL_SendMove(), CL_UpdatePrydonCursor(), Sbar_Draw(), and Sys_SDL_HandleEvents().

◆ cl_prydoncursor_notrace

cvar_t cl_prydoncursor_notrace
extern

Definition at line 93 of file cl_main.c.

93{CF_CLIENT, "cl_prydoncursor_notrace", "0", "disables traceline used in prydon cursor reporting to the game, saving some cpu time"};

Referenced by CL_Init(), and CL_UpdatePrydonCursor().

◆ cl_rate

cvar_t cl_rate
extern

Definition at line 33 of file cl_cmd.c.

33{CF_CLIENT | CF_ARCHIVE | CF_USERINFO, "rate", "20000", "connection speed"};

Referenced by CL_InitCommands(), CL_SendMove(), CL_SendPlayerInfo(), M_Menu_Setup_f(), NetConn_ReceivedMessage(), and SCR_DrawNetGraph().

◆ cl_rate_burstsize

cvar_t cl_rate_burstsize
extern

Definition at line 34 of file cl_cmd.c.

34{CF_CLIENT | CF_ARCHIVE | CF_USERINFO, "rate_burstsize", "1024", "rate control burst size"};

Referenced by CL_InitCommands(), CL_SendMove(), CL_SendPlayerInfo(), and NetConn_ReceivedMessage().

◆ cl_shownet

cvar_t cl_shownet
extern

Definition at line 42 of file cl_main.c.

42{CF_CLIENT, "cl_shownet","0","1 = print packet size, 2 = print packet message list"};

Referenced by CL_Init(), and CL_ParseServerMessage().

◆ cl_sidespeed

cvar_t cl_sidespeed
extern

Definition at line 367 of file cl_input.c.

367{CF_CLIENT | CF_ARCHIVE, "cl_sidespeed","350","strafe movement speed"};

Referenced by CL_Init(), CL_Input(), IN_Move_TouchScreen_Quake(), IN_Move_TouchScreen_SteelStorm(), and VID_ApplyJoyState().

◆ cl_stainmaps

cvar_t cl_stainmaps
extern

Definition at line 75 of file cl_main.c.

75{CF_CLIENT | CF_ARCHIVE, "cl_stainmaps", "0","stains lightmaps, much faster than decals but blurred"};

◆ cl_stainmaps_clearonload

cvar_t cl_stainmaps_clearonload
extern

Definition at line 76 of file cl_main.c.

76{CF_CLIENT | CF_ARCHIVE, "cl_stainmaps_clearonload", "1","clear stainmaps on map restart"};

◆ cl_startdemos

cvar_t cl_startdemos
extern

Definition at line 65 of file cl_main.c.

65{CF_CLIENT | CF_ARCHIVE, "cl_startdemos", "1", "1 enables the `startdemos` loop used in Quake and some mods, 0 goes straight to the menu"};

Referenced by CL_Demo_Init(), and CL_Startdemos_f().

◆ cl_upspeed

cvar_t cl_upspeed
extern

Definition at line 364 of file cl_input.c.

364{CF_CLIENT | CF_ARCHIVE, "cl_upspeed","400","vertical movement speed (while swimming or flying)"};

Referenced by CL_Init(), CL_Input(), and VID_ApplyJoyState().

◆ cl_yawspeed

cvar_t cl_yawspeed
extern

Definition at line 372 of file cl_input.c.

372{CF_CLIENT | CF_ARCHIVE, "cl_yawspeed","140","keyboard yaw turning speed"};

Referenced by CL_AdjustAngles(), CL_Init(), IN_Move_TouchScreen_Quake(), IN_Move_TouchScreen_SteelStorm(), and VID_ApplyJoyState().

◆ cls

client_static_t cls
extern

Definition at line 116 of file cl_main.c.

Referenced by CDAudio_Init(), CL_BeginDownloads(), CL_ClearState(), CL_ClearTempEntities(), CL_ClientMovement_Physics_Swim(), CL_ClientMovement_Physics_Walk(), CL_ClientMovement_Replay(), CL_CutDemo(), CL_Demos_f(), CL_DisconnectEx(), CL_DownloadBegin_f(), CL_EstablishConnection(), CL_EstablishConnection_Local(), CL_ExaminePrintString(), CL_ExpandCSQCRenderEntities(), CL_ExpandEntities(), CL_FinishTimeDemo(), CL_ForwardToServer(), CL_Frame(), CL_Init(), CL_InitCommands(), CL_IPLog_Add(), CL_KeepaliveMessage(), CL_LerpPlayer(), CL_Locs_AddNode(), CL_Locs_Reload_f(), CL_Locs_Save_f(), CL_NetworkTimeReceived(), CL_NextDemo(), CL_ParseBaseline(), CL_ParseBeam(), CL_ParseClientdata(), CL_ParseDownload(), CL_ParseEffect(), CL_ParseEffect2(), CL_ParseParticleEffect(), CL_ParsePointParticles(), CL_ParsePointParticles1(), CL_ParseServerInfo(), CL_ParseServerMessage(), CL_ParseStartSoundPacket(), CL_ParseStaticSound(), CL_ParseTempEntity(), CL_ParseTrailParticles(), CL_PasteDemo(), CL_PauseDemo_f(), CL_PlayDemo(), CL_PQRcon_f(), CL_Rcon_f(), CL_ReadDemoMessage(), CL_Reconnect_f(), CL_Record_f(), CL_RotateMoves(), CL_SendCvar_f(), CL_SendMove(), CL_SendPlayerInfo(), CL_SetInfo(), CL_SetInfo_f(), CL_SetSignonStage_WithMsg(), CL_Shutdown(), CL_SignonReply(), CL_Startdemos_f(), CL_StartVideo(), CL_Stop_f(), CL_Stopdemo_f(), CL_StopDownload(), CL_StopDownload_f(), CL_StopPlayback(), CL_TimeDemo_f(), CL_UpdateMoveVars(), CL_UpdateNetworkEntity(), CL_UpdateScreen(), CL_UpdateWorld(), CL_VM_Init(), CL_WriteDemoMessage(), Cmd_Exec(), Cmd_Init(), Con_MaskPrint(), Con_MsgCmdMode(), Crypto_ClientParsePacket(), Crypto_Shutdown(), CSQC_AddRenderEdict(), CSQC_SetGlobals(), Curl_Begin(), Curl_Curl_f(), Curl_Frame(), EntityFrame4_CL_ReadFrame(), EntityFrame5_CL_ReadFrame(), EntityFrame_CL_ReadFrame(), EntityFrameQuake_ReadEntity(), EntityFrameQW_CL_ReadFrame(), EntityState5_ReadUpdate(), EntityState_ReadFields(), EntityStateQW_ReadPlayerUpdate(), FS_ChangeGameDirs(), FS_GameDir_f(), FS_Rescan(), Host_Error(), Host_Frame(), Host_Init(), Host_SaveConfig(), Host_Shutdown(), Host_UpdateVersion(), Key_Console(), LoadSubtitles(), M_Main_Key(), M_Setup_Draw(), Mod_BuildVBOs(), Mod_IDS2_Load(), Mod_LoadTextureFromQ3Shader(), Mod_MakeSortedSurfaces(), Mod_Q1BSP_Load(), Mod_Q1BSP_LoadFaces(), Mod_Q1BSP_LoadSplitSky(), Mod_Q1BSP_LoadTextures(), Mod_Q2BSP_Load(), Mod_Q3BSP_Load(), Mod_Q3BSP_LoadFaces(), Mod_Q3BSP_LoadLightmaps(), Mod_Sprite_SharedSetup(), Mod_VBSP_LoadFaces(), ModList_Enable(), MR_Init(), MVM_error_cmd(), NetConn_CL_UpdateSockets_Callback(), NetConn_ClientFrame(), NetConn_ClientParsePacket(), NetConn_ConnectionEstablished(), NetConn_IsLocalGame(), NetConn_OpenServerPorts(), NetConn_ReceivedMessage(), NetConn_SendUnreliableMessage(), NetConn_UpdateSockets(), OpenVideo(), PrintStats(), QW_CL_Changing_f(), QW_CL_CheckOrDownloadFile(), QW_CL_NextUpload_f(), QW_CL_ParseDownload(), QW_CL_ParseModelList(), QW_CL_ParseSoundList(), QW_CL_RequestNextDownload(), QW_CL_Skins_f(), QW_CL_StartUpload(), QW_CL_StopUpload_f(), R_BuildLightMap(), R_DecalSystem_SpawnTriangle(), R_DrawDebugModel(), R_DrawParticles(), R_Envmap_f(), R_LoadTextureDDSFile(), R_LoadTextureRenderBuffer(), R_MeshQueue_AddTransparent(), R_MeshQueue_RenderTransparent(), R_SetupTexture(), R_SkinFrame_LoadExternal(), R_SkinFrame_LoadExternal_SkinFrame(), R_SkinFrame_LoadInternal8bit(), R_SkinFrame_LoadInternalBGRA(), R_SkinFrame_LoadInternalQuake(), R_SkinFrame_LoadInternalUsingTexture(), R_SkinFrame_LoadMissing(), R_SkinFrame_LoadNoTexture(), R_TimeReport_EndFrame(), RSurf_ActiveModelEntity(), S_PaintAndSubmit(), S_PlaySfxOnChannel(), S_Restart_f(), S_StartSound_StartPosition_Flags(), S_UnloadAllSounds_f(), S_Update(), Sbar_DeathmatchOverlay(), Sbar_PrintScoreboardItem(), Sbar_ShowFPS(), SCR_CaptureVideo_Avi_BeginVideo(), SCR_CaptureVideo_Avi_EndVideo(), SCR_CaptureVideo_Avi_VideoFrames(), SCR_CaptureVideo_ConvertFrame_BGRA_to_I420_flip(), SCR_CaptureVideo_Ogg_BeginVideo(), SCR_CaptureVideo_Ogg_ConvertFrame_BGRA_to_YUV(), SCR_CaptureVideo_Ogg_EndVideo(), SCR_CaptureVideo_Ogg_FlushInterleaving(), SCR_CaptureVideo_Ogg_Interleave(), SCR_CaptureVideo_Ogg_SoundFrame(), SCR_CaptureVideo_RIFF_Finish(), SCR_CaptureVideo_RIFF_Flush(), SCR_CaptureVideo_RIFF_FlushNoIncrease(), SCR_CaptureVideo_RIFF_IndexEntry(), SCR_CaptureVideo_RIFF_MakeIxChunk(), SCR_CaptureVideo_RIFF_Pop(), SCR_CaptureVideo_RIFF_WriteBytes(), SCR_DrawCurlDownload(), SCR_DrawInfobarString(), SCR_DrawNet(), SCR_DrawNetGraph(), SCR_DrawPause(), SCR_DrawQWDownload(), SCR_DrawScreen(), SCR_DrawTurtle(), SCR_InfobarHeight(), SCR_SetUpToDrawConsole(), SHOWLMP_decodeshow(), SND_Spatialize_WithSfx(), SV_Frame(), SV_Loadgame_f(), SV_ServerOptions(), SV_SpawnServer(), Sys_Error(), Sys_SDL_HandleEvents(), Sys_Sleep(), V_CalcIntermissionRefdef(), V_CalcRefdef(), V_CalcViewBlend(), V_DriftPitch(), V_ParseDamage(), VID_SetVsync_c(), VM_CL_checkpvs(), VM_CL_isdemo(), VM_CL_ReadAngle(), VM_CL_ReadCoord(), VM_CL_skel_create(), VM_clientstate(), W_GetLumpName(), W_GetTextureBGRA(), W_LoadTextureWadFile(), and WakeVideo().

◆ freelook

cvar_t freelook
extern

Definition at line 60 of file cl_main.c.

60{CF_CLIENT | CF_ARCHIVE, "freelook", "1","mouse controls pitch instead of forward/back"};

Referenced by CL_Init(), and CL_Input().

◆ in_klook

kbutton_t in_klook

Definition at line 1250 of file client.h.

◆ in_mlook

kbutton_t in_mlook
extern

Definition at line 51 of file cl_input.c.

Referenced by CL_Input(), IN_MLookDown(), and IN_MLookUp().

◆ in_speed

kbutton_t in_speed
extern

Definition at line 54 of file cl_input.c.

Referenced by CL_AdjustAngles(), CL_Input(), IN_SpeedDown(), and IN_SpeedUp().

◆ in_strafe

kbutton_t in_strafe
extern

Definition at line 54 of file cl_input.c.

Referenced by CL_AdjustAngles(), CL_Input(), IN_StrafeDown(), and IN_StrafeUp().

◆ lookspring

cvar_t lookspring
extern

Definition at line 51 of file cl_main.c.

51{CF_CLIENT | CF_ARCHIVE, "lookspring","0","returns pitch to level with the floor when no longer holding a pitch key"};

Referenced by CL_Init(), and IN_MLookUp().

◆ lookstrafe

cvar_t lookstrafe
extern

Definition at line 52 of file cl_main.c.

52{CF_CLIENT | CF_ARCHIVE, "lookstrafe","0","move instead of turning"};

Referenced by CL_Init(), and CL_Input().

◆ m_forward

cvar_t m_forward
extern

Definition at line 57 of file cl_main.c.

57{CF_CLIENT | CF_ARCHIVE, "m_forward","1","mouse forward speed multiplier"};

Referenced by CL_Init(), and CL_Input().

◆ m_pitch

cvar_t m_pitch
extern

Definition at line 55 of file cl_main.c.

55{CF_CLIENT | CF_ARCHIVE, "m_pitch","0.022","mouse pitch speed multiplier"};

Referenced by CL_Init(), CL_Input(), M_Menu_Options_AdjustSliders(), and M_Options_Draw().

◆ m_side

cvar_t m_side
extern

Definition at line 58 of file cl_main.c.

58{CF_CLIENT | CF_ARCHIVE, "m_side","0.8","mouse side speed multiplier"};

Referenced by CL_Init(), and CL_Input().

◆ m_yaw

cvar_t m_yaw
extern

Definition at line 56 of file cl_main.c.

56{CF_CLIENT | CF_ARCHIVE, "m_yaw","0.022","mouse yaw speed multiplier"};

Referenced by CL_Init(), and CL_Input().

◆ r_draweffects

cvar_t r_draweffects
extern

Definition at line 67 of file cl_main.c.

67{CF_CLIENT, "r_draweffects", "1","renders temporary sprite effects"};

Referenced by CL_Init(), and CL_RelinkEffects().

◆ rcon_address

cvar_t rcon_address
extern

Definition at line 92 of file console.c.

92{CF_CLIENT, "rcon_address", "", "server address to send rcon commands to (when not connected to a server)"};

Referenced by CL_PQRcon_f(), CL_Rcon_f(), and Con_Init().

◆ rcon_password

cvar_t rcon_password
extern

Definition at line 89 of file console.c.

89{CF_CLIENT | CF_SERVER | CF_PRIVATE, "rcon_password", "", "password to authenticate rcon commands; NOTE: changing rcon_secure clears rcon_password, so set rcon_secure always before rcon_password; may be set to a string of the form user1:pass1 user2:pass2 user3:pass3 to allow multiple user accounts - the client then has to specify ONE of these combinations"};
#define CF_PRIVATE
cvar should not be $ expanded or sent to the server under any circumstances (rcon_password,...
Definition cmd.h:59

Referenced by CL_Connect_f(), CL_PQRcon_f(), CL_Rcon_f(), Con_Init(), Con_RCon_ClearPassword_c(), NetConn_ClientParsePacket(), and RCon_Authenticate().

◆ sb_showscores

◆ sensitivity

cvar_t sensitivity
extern

Definition at line 53 of file cl_main.c.

53{CF_CLIENT | CF_ARCHIVE, "sensitivity","3","mouse speed multiplier"};

Referenced by CL_Init(), CL_Input(), M_Menu_Options_AdjustSliders(), and M_Options_Draw().