Quake II RTX doxygen  1.0 dev
client.h File Reference
#include "shared/shared.h"
#include "shared/list.h"
#include "common/bsp.h"
#include "common/cmd.h"
#include "common/cmodel.h"
#include "common/common.h"
#include "common/cvar.h"
#include "common/field.h"
#include "common/files.h"
#include "common/pmove.h"
#include "common/math.h"
#include "common/msg.h"
#include "common/net/chan.h"
#include "common/net/net.h"
#include "common/prompt.h"
#include "common/protocol.h"
#include "common/sizebuf.h"
#include "common/zone.h"
#include "system/system.h"
#include "refresh/refresh.h"
#include "server/server.h"
#include "client/client.h"
#include "client/input.h"
#include "client/keys.h"
#include "client/sound/sound.h"
#include "client/ui.h"
#include "client/video.h"

Go to the source code of this file.

Classes

struct  explosion_t
 
struct  centity_s
 
struct  clientinfo_s
 
struct  client_history_t
 
struct  server_frame_t
 
struct  client_state_s
 
struct  dlqueue_t
 
struct  client_static_s
 
struct  tent_params_t
 
struct  mz_params_t
 
struct  snd_params_t
 
struct  cl_sustain_s
 
struct  cparticle_s
 

Macros

#define MAX_EXPLOSIONS   32
 
#define MAX_CLIENTWEAPONMODELS   20
 
#define FF_SERVERDROP   (1<<4)
 
#define FF_BADFRAME   (1<<5)
 
#define FF_OLDFRAME   (1<<6)
 
#define FF_OLDENT   (1<<7)
 
#define FF_NODELTA   (1<<8)
 
#define CL_FRAMETIME   BASE_FRAMETIME
 
#define CL_1_FRAMETIME   BASE_1_FRAMETIME
 
#define CL_FRAMEDIV   1
 
#define CL_FRAMESYNC   1
 
#define CL_KEYPS   &cl.frame.ps
 
#define CL_OLDKEYPS   &cl.oldframe.ps
 
#define CL_KEYLERPFRAC   cl.lerpfrac
 
#define CONNECT_DELAY   3000u
 
#define CONNECT_INSTANT   CONNECT_DELAY
 
#define CONNECT_FAST   (CONNECT_DELAY - 1000u)
 
#define FOR_EACH_DLQ(q)   LIST_FOR_EACH(dlqueue_t, q, &cls.download.queue, entry)
 
#define FOR_EACH_DLQ_SAFE(q, n)   LIST_FOR_EACH_SAFE(dlqueue_t, q, n, &cls.download.queue, entry)
 
#define C_FPS   cls.measure.fps[0]
 
#define R_FPS   cls.measure.fps[1]
 
#define C_MPS   cls.measure.fps[2]
 
#define C_PPS   cls.measure.fps[3]
 
#define C_FRAMES   cls.measure.frames[0]
 
#define R_FRAMES   cls.measure.frames[1]
 
#define M_FRAMES   cls.measure.frames[2]
 
#define P_FRAMES   cls.measure.frames[3]
 
#define RECENT_ADDR   4
 
#define RECENT_MASK   (RECENT_ADDR - 1)
 
#define NOPART_GRENADE_EXPLOSION   1
 
#define NOPART_GRENADE_TRAIL   2
 
#define NOPART_ROCKET_EXPLOSION   4
 
#define NOPART_ROCKET_TRAIL   8
 
#define NOPART_BLOOD   16
 
#define NOEXP_GRENADE   1
 
#define NOEXP_ROCKET   2
 
#define SHOWNET(...)
 
#define SHOWCLAMP(...)
 
#define SHOWMISS(...)
 
#define CL_PLAYER_MODEL_DISABLED   0
 
#define CL_PLAYER_MODEL_ONLY_GUN   1
 
#define CL_PLAYER_MODEL_FIRST_PERSON   2
 
#define CL_PLAYER_MODEL_THIRD_PERSON   3
 
#define V_AddLight(org, intensity, r, g, b)
 
#define V_AddLightEx(org, intensity, r, g, b, radius)
 
#define PARTICLE_GRAVITY   120
 
#define BLASTER_PARTICLE_COLOR   0xe0
 
#define INSTANT_PARTICLE   -10000.0
 
#define HTTP_Init()   (void)0
 
#define HTTP_Shutdown()   (void)0
 
#define HTTP_SetServer(url)   (void)0
 
#define HTTP_QueueDownload(path, type)   Q_ERR_NOSYS
 
#define HTTP_RunDownloads()   (void)0
 
#define HTTP_CleanupDownloads()   (void)0
 
#define CL_GTV_EmitFrame()   (void)0
 
#define CL_GTV_WriteMessage(data, len)   (void)0
 
#define CL_GTV_Resume()   (void)0
 
#define CL_GTV_Suspend()   (void)0
 
#define CL_GTV_Transmit()   (void)0
 
#define CL_GTV_Run()   (void)0
 
#define CL_GTV_Init()   (void)0
 
#define CL_GTV_Shutdown()   (void)0
 

Typedefs

typedef struct centity_s centity_t
 
typedef struct clientinfo_s clientinfo_t
 
typedef struct client_state_s client_state_t
 
typedef struct client_static_s client_static_t
 
typedef struct cl_sustain_s cl_sustain_t
 
typedef struct cparticle_s cparticle_t
 

Enumerations

enum  connstate_t {
  ca_uninitialized, ca_disconnected, ca_challenging, ca_connecting,
  ca_connected, ca_loading, ca_precached, ca_active,
  ca_cinematic
}
 
enum  dltype_t { DL_OTHER, DL_MAP, DL_MODEL }
 
enum  dlstate_t { DL_PENDING, DL_RUNNING, DL_DONE }
 
enum  load_state_t {
  LOAD_NONE, LOAD_MAP, LOAD_MODELS, LOAD_IMAGES,
  LOAD_CLIENTS, LOAD_SOUNDS
}
 

Functions

void CL_Init (void)
 
void CL_Quit_f (void)
 
void CL_Disconnect (error_type_t type)
 
void CL_UpdateRecordingSetting (void)
 
void CL_Begin (void)
 
void CL_CheckForResend (void)
 
void CL_ClearState (void)
 
void CL_RestartFilesystem (qboolean total)
 
void CL_RestartRefresh (qboolean total)
 
void CL_ClientCommand (const char *string)
 
void CL_SendRcon (const netadr_t *adr, const char *pass, const char *cmd)
 
const char * CL_Server_g (const char *partial, int argnum, int state)
 
void CL_CheckForPause (void)
 
void CL_UpdateFrameTimes (void)
 
qboolean CL_CheckForIgnore (const char *s)
 
void CL_WriteConfig (void)
 
void CL_ParsePlayerSkin (char *name, char *model, char *skin, const char *s)
 
void CL_LoadClientinfo (clientinfo_t *ci, const char *s)
 
void CL_LoadState (load_state_t state)
 
void CL_RegisterSounds (void)
 
void CL_RegisterBspModels (void)
 
void CL_RegisterVWepModels (void)
 
void CL_PrepRefresh (void)
 
void CL_UpdateConfigstring (int index)
 
qerror_t CL_QueueDownload (const char *path, dltype_t type)
 
qboolean CL_IgnoreDownload (const char *path)
 
void CL_FinishDownload (dlqueue_t *q)
 
void CL_CleanupDownloads (void)
 
void CL_LoadDownloadIgnores (void)
 
void CL_HandleDownload (byte *data, int size, int percent, int compressed)
 
qboolean CL_CheckDownloadExtension (const char *ext)
 
void CL_StartNextDownload (void)
 
void CL_RequestNextDownload (void)
 
void CL_ResetPrecacheCheck (void)
 
void CL_InitDownloads (void)
 
void IN_Init (void)
 
void IN_Shutdown (void)
 
void IN_Frame (void)
 
void IN_Activate (void)
 
void CL_RegisterInput (void)
 
void CL_UpdateCmd (int msec)
 
void CL_FinalizeCmd (void)
 
void CL_SendCmd (void)
 
void CL_ParseServerMessage (void)
 
void CL_SeekDemoMessage (void)
 
void CL_DeltaFrame (void)
 
void CL_AddEntities (void)
 
void CL_CalcViewValues (void)
 
void CL_GetEntitySoundOrigin (int ent, vec3_t org)
 
void V_Init (void)
 
void V_Shutdown (void)
 
void V_RenderView (void)
 
void V_AddEntity (entity_t *ent)
 
void V_AddParticle (particle_t *p)
 
void CL_UpdateBlendSetting (void)
 
void CL_SmokeAndFlash (vec3_t origin)
 
void CL_RegisterTEntSounds (void)
 
void CL_RegisterTEntModels (void)
 
void CL_ParseTEnt (void)
 
void CL_AddTEnts (void)
 
void CL_ClearTEnts (void)
 
void CL_InitTEnts (void)
 
void CL_PredictAngles (void)
 
void CL_PredictMovement (void)
 
void CL_CheckPredictionError (void)
 
void CL_BigTeleportParticles (vec3_t org)
 
void CL_RocketTrail (vec3_t start, vec3_t end, centity_t *old)
 
void CL_DiminishingTrail (vec3_t start, vec3_t end, centity_t *old, int flags)
 
void CL_FlyEffect (centity_t *ent, vec3_t origin)
 
void CL_BfgParticles (entity_t *ent)
 
void CL_ItemRespawnParticles (vec3_t org)
 
void CL_InitEffects (void)
 
void CL_ClearEffects (void)
 
void CL_BlasterParticles (vec3_t org, vec3_t dir)
 
void CL_ExplosionParticles (vec3_t org)
 
void CL_BFGExplosionParticles (vec3_t org)
 
void CL_BlasterTrail (vec3_t start, vec3_t end)
 
void CL_QuadTrail (vec3_t start, vec3_t end)
 
void CL_OldRailTrail (void)
 
void CL_BubbleTrail (vec3_t start, vec3_t end)
 
void CL_FlagTrail (vec3_t start, vec3_t end, int color)
 
void CL_MuzzleFlash (void)
 
void CL_MuzzleFlash2 (void)
 
void CL_TeleporterParticles (vec3_t org)
 
void CL_TeleportParticles (vec3_t org)
 
void CL_ParticleEffect (vec3_t org, vec3_t dir, int color, int count)
 
void CL_ParticleEffectWaterSplash (vec3_t org, vec3_t dir, int color, int count)
 
void CL_BloodParticleEffect (vec3_t org, vec3_t dir, int color, int count)
 
void CL_ParticleEffect2 (vec3_t org, vec3_t dir, int color, int count)
 
cparticle_tCL_AllocParticle (void)
 
void CL_RunParticles (void)
 
void CL_AddParticles (void)
 
void CL_BlasterParticles2 (vec3_t org, vec3_t dir, unsigned int color)
 
void CL_BlasterTrail2 (vec3_t start, vec3_t end)
 
void CL_DebugTrail (vec3_t start, vec3_t end)
 
void CL_SmokeTrail (vec3_t start, vec3_t end, int colorStart, int colorRun, int spacing)
 
void CL_ForceWall (vec3_t start, vec3_t end, int color)
 
void CL_GenericParticleEffect (vec3_t org, vec3_t dir, int color, int count, int numcolors, int dirspread, float alphavel)
 
void CL_BubbleTrail2 (vec3_t start, vec3_t end, int dist)
 
void CL_Heatbeam (vec3_t start, vec3_t end)
 
void CL_ParticleSteamEffect (vec3_t org, vec3_t dir, int color, int count, int magnitude)
 
void CL_TrackerTrail (vec3_t start, vec3_t end, int particleColor)
 
void CL_Tracker_Explode (vec3_t origin)
 
void CL_TagTrail (vec3_t start, vec3_t end, int color)
 
void CL_Tracker_Shell (vec3_t origin)
 
void CL_MonsterPlasma_Shell (vec3_t origin)
 
void CL_ColorExplosionParticles (vec3_t org, int color, int run)
 
void CL_ParticleSmokeEffect (vec3_t org, vec3_t dir, int color, int count, int magnitude)
 
void CL_Widowbeamout (cl_sustain_t *self)
 
void CL_Nukeblast (cl_sustain_t *self)
 
void CL_WidowSplash (void)
 
void CL_IonripperTrail (vec3_t start, vec3_t end)
 
void CL_TrapParticles (entity_t *ent)
 
void CL_ParticleEffect3 (vec3_t org, vec3_t dir, int color, int count)
 
void CL_ParticleSteamEffect2 (cl_sustain_t *self)
 
void CL_InitDemos (void)
 
void CL_CleanupDemos (void)
 
void CL_DemoFrame (int msec)
 
qboolean CL_WriteDemoMessage (sizebuf_t *buf)
 
void CL_EmitDemoFrame (void)
 
void CL_EmitDemoSnapshot (void)
 
void CL_FirstDemoFrame (void)
 
void CL_Stop_f (void)
 
demoInfo_t * CL_GetDemoInfo (const char *path, demoInfo_t *info)
 
void LOC_Init (void)
 
void LOC_LoadLocations (void)
 
void LOC_FreeLocations (void)
 
void LOC_UpdateCvars (void)
 
void LOC_AddLocationsToScene (void)
 
void Con_Init (void)
 
void Con_PostInit (void)
 
void Con_Shutdown (void)
 
void Con_DrawConsole (void)
 
void Con_RunConsole (void)
 
void Con_Print (const char *txt)
 
void Con_ClearNotify_f (void)
 
void Con_ToggleConsole_f (void)
 
void Con_ClearTyping (void)
 
void Con_Close (qboolean force)
 
void Con_Popup (qboolean force)
 
void Con_SkipNotify (qboolean skip)
 
void Con_RegisterMedia (void)
 
void Con_CheckResize (void)
 
void Key_Console (int key)
 
void Key_Message (int key)
 
void Char_Console (int key)
 
void Char_Message (int key)
 
void CL_InitRefresh (void)
 
void CL_ShutdownRefresh (void)
 
void CL_RunRefresh (void)
 
void SCR_Init (void)
 
void SCR_Shutdown (void)
 
void SCR_UpdateScreen (void)
 
void SCR_SizeUp (void)
 
void SCR_SizeDown (void)
 
void SCR_CenterPrint (const char *str)
 
void SCR_FinishCinematic (void)
 
void SCR_PlayCinematic (const char *name)
 
void SCR_RunCinematic ()
 
void SCR_BeginLoadingPlaque (void)
 
void SCR_EndLoadingPlaque (void)
 
void SCR_DebugGraph (float value, int color)
 
void SCR_TouchPics (void)
 
void SCR_RegisterMedia (void)
 
void SCR_ModeChanged (void)
 
void SCR_LagSample (void)
 
void SCR_LagClear (void)
 
void SCR_SetCrosshairColor (void)
 
qhandle_t SCR_GetFont (void)
 
void SCR_SetHudAlpha (float alpha)
 
float SCR_FadeAlpha (unsigned startTime, unsigned visTime, unsigned fadeTime)
 
int SCR_DrawStringEx (int x, int y, int flags, size_t maxlen, const char *s, qhandle_t font)
 
void SCR_DrawStringMulti (int x, int y, int flags, size_t maxlen, const char *s, qhandle_t font)
 
void SCR_ClearChatHUD_f (void)
 
void SCR_AddToChatHUD (const char *text)
 
void CL_InitAscii (void)
 
byte COM_BlockSequenceCRCByte (byte *base, size_t length, int sequence)
 
void FX_Init (void)
 

Variables

explosion_t cl_explosions [MAX_EXPLOSIONS]
 
centity_t cl_entities [MAX_EDICTS]
 
client_state_t cl
 
client_static_t cls
 
cmdbuf_t cl_cmdbuf
 
char cl_cmdbuf_text [MAX_STRING_CHARS]
 
cvar_t * cl_gun
 
cvar_t * cl_gunalpha
 
cvar_t * cl_predict
 
cvar_t * cl_footsteps
 
cvar_t * cl_noskins
 
cvar_t * cl_kickangles
 
cvar_t * cl_rollhack
 
cvar_t * cl_noglow
 
cvar_t * cl_nolerp
 
cvar_t * cl_vwep
 
cvar_t * cl_disable_particles
 
cvar_t * cl_disable_explosions
 
cvar_t * cl_explosion_sprites
 
cvar_t * cl_explosion_frametime
 
cvar_t * cl_chat_notify
 
cvar_t * cl_chat_sound
 
cvar_t * cl_chat_filter
 
cvar_t * cl_disconnectcmd
 
cvar_t * cl_changemapcmd
 
cvar_t * cl_beginmapcmd
 
cvar_t * cl_gibs
 
cvar_t * cl_player_model
 
cvar_t * cl_thirdperson_angle
 
cvar_t * cl_thirdperson_range
 
cvar_t * cl_async
 
cvar_t * info_password
 
cvar_t * info_spectator
 
cvar_t * info_name
 
cvar_t * info_skin
 
cvar_t * info_rate
 
cvar_t * info_fov
 
cvar_t * info_msg
 
cvar_t * info_hand
 
cvar_t * info_gender
 
cvar_t * info_uf
 
tent_params_t te
 
mz_params_t mz
 
snd_params_t snd
 
int gun_frame
 
qhandle_t gun_model
 
vrect_t scr_vrect
 

Macro Definition Documentation

◆ BLASTER_PARTICLE_COLOR

#define BLASTER_PARTICLE_COLOR   0xe0

Definition at line 777 of file client.h.

◆ C_FPS

#define C_FPS   cls.measure.fps[0]

Definition at line 393 of file client.h.

◆ C_FRAMES

#define C_FRAMES   cls.measure.frames[0]

Definition at line 397 of file client.h.

◆ C_MPS

#define C_MPS   cls.measure.fps[2]

Definition at line 395 of file client.h.

◆ C_PPS

#define C_PPS   cls.measure.fps[3]

Definition at line 396 of file client.h.

◆ CL_1_FRAMETIME

#define CL_1_FRAMETIME   BASE_1_FRAMETIME

Definition at line 162 of file client.h.

◆ CL_FRAMEDIV

#define CL_FRAMEDIV   1

Definition at line 163 of file client.h.

◆ CL_FRAMESYNC

#define CL_FRAMESYNC   1

Definition at line 164 of file client.h.

◆ CL_FRAMETIME

#define CL_FRAMETIME   BASE_FRAMETIME

Definition at line 161 of file client.h.

◆ CL_GTV_EmitFrame

#define CL_GTV_EmitFrame ( )    (void)0

Definition at line 1015 of file client.h.

◆ CL_GTV_Init

#define CL_GTV_Init ( )    (void)0

Definition at line 1021 of file client.h.

◆ CL_GTV_Resume

#define CL_GTV_Resume ( )    (void)0

Definition at line 1017 of file client.h.

◆ CL_GTV_Run

#define CL_GTV_Run ( )    (void)0

Definition at line 1020 of file client.h.

◆ CL_GTV_Shutdown

#define CL_GTV_Shutdown ( )    (void)0

Definition at line 1022 of file client.h.

◆ CL_GTV_Suspend

#define CL_GTV_Suspend ( )    (void)0

Definition at line 1018 of file client.h.

◆ CL_GTV_Transmit

#define CL_GTV_Transmit ( )    (void)0

Definition at line 1019 of file client.h.

◆ CL_GTV_WriteMessage

#define CL_GTV_WriteMessage (   data,
  len 
)    (void)0

Definition at line 1016 of file client.h.

◆ CL_KEYLERPFRAC

#define CL_KEYLERPFRAC   cl.lerpfrac

Definition at line 167 of file client.h.

◆ CL_KEYPS

#define CL_KEYPS   &cl.frame.ps

Definition at line 165 of file client.h.

◆ CL_OLDKEYPS

#define CL_OLDKEYPS   &cl.oldframe.ps

Definition at line 166 of file client.h.

◆ CL_PLAYER_MODEL_DISABLED

#define CL_PLAYER_MODEL_DISABLED   0

Definition at line 553 of file client.h.

◆ CL_PLAYER_MODEL_FIRST_PERSON

#define CL_PLAYER_MODEL_FIRST_PERSON   2

Definition at line 555 of file client.h.

◆ CL_PLAYER_MODEL_ONLY_GUN

#define CL_PLAYER_MODEL_ONLY_GUN   1

Definition at line 554 of file client.h.

◆ CL_PLAYER_MODEL_THIRD_PERSON

#define CL_PLAYER_MODEL_THIRD_PERSON   3

Definition at line 556 of file client.h.

◆ CONNECT_DELAY

#define CONNECT_DELAY   3000u

Definition at line 327 of file client.h.

◆ CONNECT_FAST

#define CONNECT_FAST   (CONNECT_DELAY - 1000u)

Definition at line 330 of file client.h.

◆ CONNECT_INSTANT

#define CONNECT_INSTANT   CONNECT_DELAY

Definition at line 329 of file client.h.

◆ FF_BADFRAME

#define FF_BADFRAME   (1<<5)

Definition at line 146 of file client.h.

◆ FF_NODELTA

#define FF_NODELTA   (1<<8)

Definition at line 149 of file client.h.

◆ FF_OLDENT

#define FF_OLDENT   (1<<7)

Definition at line 148 of file client.h.

◆ FF_OLDFRAME

#define FF_OLDFRAME   (1<<6)

Definition at line 147 of file client.h.

◆ FF_SERVERDROP

#define FF_SERVERDROP   (1<<4)

Definition at line 145 of file client.h.

◆ FOR_EACH_DLQ

#define FOR_EACH_DLQ (   q)    LIST_FOR_EACH(dlqueue_t, q, &cls.download.queue, entry)

Definition at line 344 of file client.h.

◆ FOR_EACH_DLQ_SAFE

#define FOR_EACH_DLQ_SAFE (   q,
 
)    LIST_FOR_EACH_SAFE(dlqueue_t, q, n, &cls.download.queue, entry)

Definition at line 346 of file client.h.

◆ HTTP_CleanupDownloads

#define HTTP_CleanupDownloads ( )    (void)0

Definition at line 998 of file client.h.

◆ HTTP_Init

#define HTTP_Init ( )    (void)0

Definition at line 993 of file client.h.

◆ HTTP_QueueDownload

#define HTTP_QueueDownload (   path,
  type 
)    Q_ERR_NOSYS

Definition at line 996 of file client.h.

◆ HTTP_RunDownloads

#define HTTP_RunDownloads ( )    (void)0

Definition at line 997 of file client.h.

◆ HTTP_SetServer

#define HTTP_SetServer (   url)    (void)0

Definition at line 995 of file client.h.

◆ HTTP_Shutdown

#define HTTP_Shutdown ( )    (void)0

Definition at line 994 of file client.h.

◆ INSTANT_PARTICLE

#define INSTANT_PARTICLE   -10000.0

Definition at line 778 of file client.h.

◆ M_FRAMES

#define M_FRAMES   cls.measure.frames[2]

Definition at line 399 of file client.h.

◆ MAX_CLIENTWEAPONMODELS

#define MAX_CLIENTWEAPONMODELS   20

Definition at line 110 of file client.h.

◆ MAX_EXPLOSIONS

#define MAX_EXPLOSIONS   32

Definition at line 58 of file client.h.

◆ NOEXP_GRENADE

#define NOEXP_GRENADE   1

Definition at line 501 of file client.h.

◆ NOEXP_ROCKET

#define NOEXP_ROCKET   2

Definition at line 502 of file client.h.

◆ NOPART_BLOOD

#define NOPART_BLOOD   16

Definition at line 499 of file client.h.

◆ NOPART_GRENADE_EXPLOSION

#define NOPART_GRENADE_EXPLOSION   1

Definition at line 495 of file client.h.

◆ NOPART_GRENADE_TRAIL

#define NOPART_GRENADE_TRAIL   2

Definition at line 496 of file client.h.

◆ NOPART_ROCKET_EXPLOSION

#define NOPART_ROCKET_EXPLOSION   4

Definition at line 497 of file client.h.

◆ NOPART_ROCKET_TRAIL

#define NOPART_ROCKET_TRAIL   8

Definition at line 498 of file client.h.

◆ P_FRAMES

#define P_FRAMES   cls.measure.frames[3]

Definition at line 400 of file client.h.

◆ PARTICLE_GRAVITY

#define PARTICLE_GRAVITY   120

Definition at line 776 of file client.h.

◆ R_FPS

#define R_FPS   cls.measure.fps[1]

Definition at line 394 of file client.h.

◆ R_FRAMES

#define R_FRAMES   cls.measure.frames[1]

Definition at line 398 of file client.h.

◆ RECENT_ADDR

#define RECENT_ADDR   4

Definition at line 431 of file client.h.

◆ RECENT_MASK

#define RECENT_MASK   (RECENT_ADDR - 1)

Definition at line 432 of file client.h.

◆ SHOWCLAMP

#define SHOWCLAMP (   ...)

Definition at line 532 of file client.h.

◆ SHOWMISS

#define SHOWMISS (   ...)

Definition at line 533 of file client.h.

◆ SHOWNET

#define SHOWNET (   ...)

Definition at line 531 of file client.h.

◆ V_AddLight

#define V_AddLight (   org,
  intensity,
  r,
  g,
 
)

Definition at line 728 of file client.h.

◆ V_AddLightEx

#define V_AddLightEx (   org,
  intensity,
  r,
  g,
  b,
  radius 
)

Definition at line 729 of file client.h.

Typedef Documentation

◆ centity_t

typedef struct centity_s centity_t

◆ cl_sustain_t

typedef struct cl_sustain_s cl_sustain_t

◆ client_state_t

◆ client_static_t

◆ clientinfo_t

typedef struct clientinfo_s clientinfo_t

◆ cparticle_t

typedef struct cparticle_s cparticle_t

Enumeration Type Documentation

◆ connstate_t

Enumerator
ca_uninitialized 
ca_disconnected 
ca_challenging 
ca_connecting 
ca_connected 
ca_loading 
ca_precached 
ca_active 
ca_cinematic 

Definition at line 332 of file client.h.

332  {
334  ca_disconnected, // not talking to a server
335  ca_challenging, // sending getchallenge packets to the server
336  ca_connecting, // sending connect packets to the server
337  ca_connected, // netchan_t established, waiting for svc_serverdata
338  ca_loading, // loading level data
339  ca_precached, // loaded level data, waiting for svc_frame
340  ca_active, // game views should be displayed
341  ca_cinematic // running a cinematic
342 } connstate_t;

◆ dlstate_t

enum dlstate_t
Enumerator
DL_PENDING 
DL_RUNNING 
DL_DONE 

Definition at line 361 of file client.h.

361  {
362  DL_PENDING,
363  DL_RUNNING,
364  DL_DONE
365 } dlstate_t;

◆ dltype_t

enum dltype_t
Enumerator
DL_OTHER 
DL_MAP 
DL_MODEL 

Definition at line 349 of file client.h.

349  {
350  // generic types
351  DL_OTHER,
352  DL_MAP,
353  DL_MODEL,
354 #if USE_CURL
355  // special types
356  DL_LIST,
357  DL_PAK
358 #endif
359 } dltype_t;

◆ load_state_t

Enumerator
LOAD_NONE 
LOAD_MAP 
LOAD_MODELS 
LOAD_IMAGES 
LOAD_CLIENTS 
LOAD_SOUNDS 

Definition at line 606 of file client.h.

606  {
607  LOAD_NONE,
608  LOAD_MAP,
609  LOAD_MODELS,
610  LOAD_IMAGES,
611  LOAD_CLIENTS,
613 } load_state_t;

Function Documentation

◆ Char_Console()

void Char_Console ( int  key)

Definition at line 1229 of file console.c.

1230 {
1231  if (IF_CharEvent(&con.prompt.inputLine, key)) {
1233  }
1234 }

Referenced by Key_Event().

◆ Char_Message()

void Char_Message ( int  key)

Definition at line 1289 of file console.c.

1290 {
1291  IF_CharEvent(&con.chatPrompt.inputLine, key);
1292 }

Referenced by Key_Event().

◆ CL_AddEntities()

void CL_AddEntities ( void  )

Definition at line 1378 of file entities.c.

1379 {
1383  CL_AddTEnts();
1384  CL_AddParticles();
1385 #if USE_DLIGHTS
1386  CL_AddDLights();
1387 #endif
1388 #if USE_LIGHTSTYLES
1389  CL_AddLightStyles();
1390 #endif
1391 #if CL_RTX_SHADERBALLS
1392  CL_AddShaderBalls();
1393 #endif
1395 }

Referenced by V_RenderView().

◆ CL_AddParticles()

void CL_AddParticles ( void  )

Definition at line 1989 of file effects.c.

1990 {
1991  cparticle_t *p, *next;
1992  float alpha;
1993  float time = 0, time2;
1994  int color;
1995  cparticle_t *active, *tail;
1996  particle_t *part;
1997 
1998  active = NULL;
1999  tail = NULL;
2000 
2001  for (p = active_particles; p; p = next) {
2002  next = p->next;
2003 
2004  if (p->alphavel != INSTANT_PARTICLE) {
2005  time = (cl.time - p->time) * 0.001;
2006  alpha = p->alpha + time * p->alphavel;
2007  if (alpha <= 0) {
2008  // faded out
2009  p->next = free_particles;
2010  free_particles = p;
2011  continue;
2012  }
2013  } else {
2014  alpha = p->alpha;
2015  }
2016 
2017  if (r_numparticles >= MAX_PARTICLES)
2018  break;
2019  part = &r_particles[r_numparticles++];
2020 
2021  p->next = NULL;
2022  if (!tail)
2023  active = tail = p;
2024  else {
2025  tail->next = p;
2026  tail = p;
2027  }
2028 
2029  if (alpha > 1.0)
2030  alpha = 1;
2031  color = p->color;
2032 
2033  time2 = time * time;
2034 
2035  part->origin[0] = p->org[0] + p->vel[0] * time + p->accel[0] * time2;
2036  part->origin[1] = p->org[1] + p->vel[1] * time + p->accel[1] * time2;
2037  part->origin[2] = p->org[2] + p->vel[2] * time + p->accel[2] * time2;
2038 
2039  if (color == -1) {
2040  part->rgba.u8[0] = p->rgba.u8[0];
2041  part->rgba.u8[1] = p->rgba.u8[1];
2042  part->rgba.u8[2] = p->rgba.u8[2];
2043  part->rgba.u8[3] = p->rgba.u8[3] * alpha;
2044  }
2045 
2046  part->color = color;
2047  part->brightness = p->brightness;
2048  part->alpha = alpha;
2049  part->radius = 0.f;
2050 
2051  if (p->alphavel == INSTANT_PARTICLE) {
2052  p->alphavel = 0.0;
2053  p->alpha = 0.0;
2054  }
2055  }
2056 
2057  active_particles = active;
2058 }

Referenced by CL_AddEntities().

◆ CL_AddTEnts()

void CL_AddTEnts ( void  )

Definition at line 1445 of file tent.c.

1446 {
1447  CL_AddBeams();
1449  CL_AddExplosions();
1451  CL_AddLasers();
1452 }

Referenced by CL_AddEntities().

◆ CL_AllocParticle()

◆ CL_Begin()

void CL_Begin ( void  )

Definition at line 1757 of file main.c.

1758 {
1759 #if USE_REF == REF_GL
1760  if (!Q_stricmp(cl.gamedir, "gloom")) {
1761  // cheat protect our custom modulate cvars
1762  gl_modulate_world->flags |= CVAR_CHEAT;
1763  gl_modulate_entities->flags |= CVAR_CHEAT;
1764  gl_brightness->flags |= CVAR_CHEAT;
1765  }
1766 #endif
1767 
1768  Cvar_FixCheats();
1769 
1770  CL_PrepRefresh();
1776 
1777 #if USE_FPS
1778  CL_UpdateRateSetting();
1779 #endif
1780 
1781  CL_ClientCommand(va("begin %i\n", precache_spawncount));
1782 
1789 }

Referenced by CL_RequestNextDownload().

◆ CL_BFGExplosionParticles()

void CL_BFGExplosionParticles ( vec3_t  org)

Definition at line 1905 of file effects.c.

1906 {
1907  int i, j;
1908  cparticle_t *p;
1909 
1910  const int count = 256 * cl_particle_num_factor->value;
1911 
1912  for (i = 0; i < count; i++) {
1913  p = CL_AllocParticle();
1914  if (!p)
1915  return;
1916 
1917  p->time = cl.time;
1918 
1919  p->color = 0xd0 + (rand() & 7);
1921 
1922  for (j = 0; j < 3; j++) {
1923  p->org[j] = org[j] + ((rand() % 32) - 16);
1924  p->vel[j] = (rand() % 384) - 192;
1925  }
1926 
1927  p->accel[0] = p->accel[1] = 0;
1928  p->accel[2] = -PARTICLE_GRAVITY;
1929  p->alpha = 1.0;
1930 
1931  p->alphavel = -0.8 / (0.5 + frand() * 0.3);
1932  }
1933 }

Referenced by CL_ParseTEnt().

◆ CL_BfgParticles()

void CL_BfgParticles ( entity_t *  ent)

Definition at line 1847 of file effects.c.

1848 {
1849  int i;
1850  cparticle_t *p;
1851  float angle;
1852  float sp, sy, cp, cy;
1853  vec3_t forward;
1854  float dist = 64;
1855  vec3_t v;
1856  float ltime;
1857 
1858  const int count = NUMVERTEXNORMALS * cl_particle_num_factor->value;
1859 
1860  ltime = (float)cl.time / 1000.0;
1861  for (i = 0; i < count; i++) {
1862  angle = ltime * avelocities[i][0];
1863  sy = sin(angle);
1864  cy = cos(angle);
1865  angle = ltime * avelocities[i][1];
1866  sp = sin(angle);
1867  cp = cos(angle);
1868 
1869  forward[0] = cp * cy;
1870  forward[1] = cp * sy;
1871  forward[2] = -sp;
1872 
1873  p = CL_AllocParticle();
1874  if (!p)
1875  return;
1876 
1877  p->time = cl.time;
1878 
1879  dist = sin(ltime + i) * 64;
1880  p->org[0] = ent->origin[0] + bytedirs[i][0] * dist + forward[0] * BEAMLENGTH;
1881  p->org[1] = ent->origin[1] + bytedirs[i][1] * dist + forward[1] * BEAMLENGTH;
1882  p->org[2] = ent->origin[2] + bytedirs[i][2] * dist + forward[2] * BEAMLENGTH;
1883 
1884  VectorClear(p->vel);
1885  VectorClear(p->accel);
1886 
1887  VectorSubtract(p->org, ent->origin, v);
1888  dist = VectorLength(v) / 90.0;
1889 
1890  p->color = floor(0xd0 + dist * 7);
1892 
1893  p->alpha = 1.0 - dist;
1895  }
1896 }

Referenced by CL_AddPacketEntities().

◆ CL_BigTeleportParticles()

void CL_BigTeleportParticles ( vec3_t  org)

Definition at line 1256 of file effects.c.

1257 {
1258  static const byte colortable[4] = {2 * 8, 13 * 8, 21 * 8, 18 * 8};
1259  int i;
1260  cparticle_t *p;
1261  float angle, dist;
1262 
1263  for (i = 0; i < 4096; i++) {
1264  p = CL_AllocParticle();
1265  if (!p)
1266  return;
1267 
1268  p->time = cl.time;
1269 
1270  p->color = colortable[rand() & 3];
1271  p->brightness = 1.0f;
1272 
1273  angle = M_PI * 2 * (rand() & 1023) / 1023.0;
1274  dist = rand() & 31;
1275  p->org[0] = org[0] + cos(angle) * dist;
1276  p->vel[0] = cos(angle) * (70 + (rand() & 63));
1277  p->accel[0] = -cos(angle) * 100;
1278 
1279  p->org[1] = org[1] + sin(angle) * dist;
1280  p->vel[1] = sin(angle) * (70 + (rand() & 63));
1281  p->accel[1] = -sin(angle) * 100;
1282 
1283  p->org[2] = org[2] + 8 + (rand() % 90);
1284  p->vel[2] = -100 + (rand() & 31);
1285  p->accel[2] = PARTICLE_GRAVITY * 4;
1286  p->alpha = 1.0;
1287 
1288  p->alphavel = -0.3 / (0.5 + frand() * 0.3);
1289  }
1290 }

Referenced by CL_ParseTEnt().

◆ CL_BlasterParticles()

void CL_BlasterParticles ( vec3_t  org,
vec3_t  dir 
)

Definition at line 1300 of file effects.c.

1301 {
1302  int i, j;
1303  cparticle_t *p;
1304  float d;
1305 
1306  const int count = 40 * cl_particle_num_factor->value;
1307 
1308  for (i = 0; i < count; i++) {
1309  p = CL_AllocParticle();
1310  if (!p)
1311  return;
1312 
1313  p->time = cl.time;
1314 
1315  p->color = 0xe0 + (rand() & 7);
1317 
1318  d = rand() & 15;
1319  for (j = 0; j < 3; j++) {
1320  p->org[j] = org[j] + ((rand() & 7) - 4) + d * dir[j];
1321  p->vel[j] = dir[j] * 30 + crand() * 40;
1322  }
1323 
1324  p->accel[0] = p->accel[1] = 0;
1325  p->accel[2] = -PARTICLE_GRAVITY;
1326  p->alpha = 1.0;
1327 
1328  p->alphavel = -1.0 / (0.5 + frand() * 0.3);
1329  }
1330 }

Referenced by CL_ParseTEnt().

◆ CL_BlasterParticles2()

void CL_BlasterParticles2 ( vec3_t  org,
vec3_t  dir,
unsigned int  color 
)

Definition at line 761 of file newfx.c.

762 {
763  int i, j;
764  cparticle_t *p;
765  float d;
766  int count;
767 
768  count = 40;
769  for (i = 0; i < count; i++) {
770  p = CL_AllocParticle();
771  if (!p)
772  return;
773 
774  p->time = cl.time;
775  p->color = color + (rand() & 7);
776 
777  d = rand() & 15;
778  for (j = 0; j < 3; j++) {
779  p->org[j] = org[j] + ((rand() & 7) - 4) + d * dir[j];
780  p->vel[j] = dir[j] * 30 + crand() * 40;
781  }
782 
783  p->accel[0] = p->accel[1] = 0;
784  p->accel[2] = -PARTICLE_GRAVITY;
785  p->alpha = 1.0;
786 
787  p->alphavel = -1.0 / (0.5 + frand() * 0.3);
788  }
789 }

Referenced by CL_ParseTEnt().

◆ CL_BlasterTrail()

void CL_BlasterTrail ( vec3_t  start,
vec3_t  end 
)

Definition at line 1339 of file effects.c.

1340 {
1341  vec3_t move;
1342  vec3_t vec;
1343  float len;
1344  int j;
1345  cparticle_t *p;
1346  int dec;
1347 
1348  VectorCopy(start, move);
1349  VectorSubtract(end, start, vec);
1350  len = VectorNormalize(vec);
1351 
1352  dec = 5;
1353  VectorScale(vec, 5, vec);
1354 
1355  // FIXME: this is a really silly way to have a loop
1356  while (len > 0) {
1357  len -= dec;
1358 
1359  p = CL_AllocParticle();
1360  if (!p)
1361  return;
1362  VectorClear(p->accel);
1363 
1364  p->time = cl.time;
1365 
1366  p->alpha = 1.0;
1367  p->alphavel = -1.0 / (0.3 + frand() * 0.2);
1368 
1369  p->color = 0xe0;
1371 
1372  for (j = 0; j < 3; j++) {
1373  p->org[j] = move[j] + crand();
1374  p->vel[j] = crand() * 5;
1375  p->accel[j] = 0;
1376  }
1377 
1378  VectorAdd(move, vec, move);
1379  }
1380 }

Referenced by CL_AddPacketEntities().

◆ CL_BlasterTrail2()

void CL_BlasterTrail2 ( vec3_t  start,
vec3_t  end 
)

Definition at line 798 of file newfx.c.

799 {
800  vec3_t move;
801  vec3_t vec;
802  float len;
803  int j;
804  cparticle_t *p;
805  int dec;
806 
807  VectorCopy(start, move);
808  VectorSubtract(end, start, vec);
809  len = VectorNormalize(vec);
810 
811  dec = 5;
812  VectorScale(vec, 5, vec);
813 
814  // FIXME: this is a really silly way to have a loop
815  while (len > 0) {
816  len -= dec;
817 
818  p = CL_AllocParticle();
819  if (!p)
820  return;
821  VectorClear(p->accel);
822 
823  p->time = cl.time;
824 
825  p->alpha = 1.0;
826  p->alphavel = -1.0 / (0.3 + frand() * 0.2);
827  p->color = 0xd0;
828  for (j = 0; j < 3; j++) {
829  p->org[j] = move[j] + crand();
830  p->vel[j] = crand() * 5;
831  p->accel[j] = 0;
832  }
833 
834  VectorAdd(move, vec, move);
835  }
836 }

Referenced by CL_AddPacketEntities().

◆ CL_BloodParticleEffect()

void CL_BloodParticleEffect ( vec3_t  org,
vec3_t  dir,
int  color,
int  count 
)

Definition at line 1006 of file effects.c.

1007 {
1008  int i, j;
1009  cparticle_t *p;
1010  float d;
1011 
1012  // add decal:
1013  decal_t dec = {
1014  .pos = {org[0],org[1],org[2]},
1015  .dir = {dir[0],dir[1],dir[2]},
1016  .spread = 0.25f,
1017  .length = 350};
1018  R_AddDecal(&dec);
1019 
1020  float a[3] = {dir[1], -dir[2], dir[0]};
1021  float b[3] = {-dir[2], dir[0], dir[1]};
1022 
1023  count *= cl_particle_num_factor->value;
1024 
1025  for (i = 0; i < count; i++) {
1026  p = CL_AllocParticle();
1027  if (!p)
1028  return;
1029 
1030  p->time = cl.time;
1031 
1032  p->color = color + (rand() & 7);
1033  p->brightness = 0.5f;
1034 
1035  d = (rand() & 31) * 10.0f;
1036  for (j = 0; j < 3; j++) {
1037  p->org[j] = org[j] + ((rand() & 7) - 4) + d * (dir[j]
1038  + a[j] * 0.5f*((rand() & 31) / 32.0f - .5f)
1039  + b[j] * 0.5f*((rand() & 31) / 32.0f - .5f));
1040 
1041  p->vel[j] = 10.0f*dir[j] + crand() * 20;
1042  }
1043  // fake gravity
1044  p->org[2] -= d*d * .001f;
1045 
1046  p->accel[0] = p->accel[1] = 0;
1047  p->accel[2] = -PARTICLE_GRAVITY;
1048  p->alpha = 0.5;
1049 
1050  p->alphavel = -1.0 / (0.5 + frand() * 0.3);
1051  }
1052 }

Referenced by CL_ParseTEnt().

◆ CL_BubbleTrail()

void CL_BubbleTrail ( vec3_t  start,
vec3_t  end 
)

Definition at line 1718 of file effects.c.

1719 {
1720  vec3_t move;
1721  vec3_t vec;
1722  float len;
1723  int i, j;
1724  cparticle_t *p;
1725  float dec;
1726 
1727  VectorCopy(start, move);
1728  VectorSubtract(end, start, vec);
1729  len = VectorNormalize(vec);
1730 
1731  dec = 32;
1732  VectorScale(vec, dec, vec);
1733 
1734  for (i = 0; i < len; i += dec) {
1735  p = CL_AllocParticle();
1736  if (!p)
1737  return;
1738 
1739  VectorClear(p->accel);
1740  p->time = cl.time;
1741 
1742  p->alpha = 1.0;
1743  p->alphavel = -1.0 / (1 + frand() * 0.2);
1744 
1745  p->color = 4 + (rand() & 7);
1746  p->brightness = 1.0f;
1747 
1748  for (j = 0; j < 3; j++) {
1749  p->org[j] = move[j] + crand() * 2;
1750  p->vel[j] = crand() * 5;
1751  }
1752  p->vel[2] += 6;
1753 
1754  VectorAdd(move, vec, move);
1755  }
1756 }

Referenced by CL_ParseTEnt().

◆ CL_BubbleTrail2()

void CL_BubbleTrail2 ( vec3_t  start,
vec3_t  end,
int  dist 
)

Definition at line 228 of file newfx.c.

229 {
230  vec3_t move;
231  vec3_t vec;
232  float len;
233  int i, j;
234  cparticle_t *p;
235  float dec;
236 
237  VectorCopy(start, move);
238  VectorSubtract(end, start, vec);
239  len = VectorNormalize(vec);
240 
241  dec = dist;
242  VectorScale(vec, dec, vec);
243 
244  for (i = 0; i < len; i += dec) {
245  p = CL_AllocParticle();
246  if (!p)
247  return;
248 
249  VectorClear(p->accel);
250  p->time = cl.time;
251 
252  p->alpha = 1.0;
253  p->alphavel = -1.0 / (1 + frand() * 0.1);
254  p->color = 4 + (rand() & 7);
255  for (j = 0; j < 3; j++) {
256  p->org[j] = move[j] + crand() * 2;
257  p->vel[j] = crand() * 10;
258  }
259  p->org[2] -= 4;
260  p->vel[2] += 20;
261 
262  VectorAdd(move, vec, move);
263  }
264 }

Referenced by CL_ParseTEnt().

◆ CL_CalcViewValues()

void CL_CalcViewValues ( void  )

Definition at line 1251 of file entities.c.

1252 {
1253  player_state_t *ps, *ops;
1254  vec3_t viewoffset;
1255  float lerp;
1256 
1257  if (!cl.frame.valid) {
1258  return;
1259  }
1260 
1261  // find states to interpolate between
1262  ps = &cl.frame.ps;
1263  ops = &cl.oldframe.ps;
1264 
1265  lerp = cl.lerpfrac;
1266 
1267  // calculate the origin
1268  if (!cls.demo.playback && cl_predict->integer && !(ps->pmove.pm_flags & PMF_NO_PREDICTION)) {
1269  // use predicted values
1270  unsigned delta = cls.realtime - cl.predicted_step_time;
1271  float backlerp = lerp - 1.0;
1272 
1273  VectorMA(cl.predicted_origin, backlerp, cl.prediction_error, cl.refdef.vieworg);
1274 
1275  // smooth out stair climbing
1276  if (cl.predicted_step < 127 * 0.125f) {
1277  delta <<= 1; // small steps
1278  }
1279  if (delta < 100) {
1280  cl.refdef.vieworg[2] -= cl.predicted_step * (100 - delta) * 0.01f;
1281  }
1282  } else {
1283  // just use interpolated values
1284  cl.refdef.vieworg[0] = ops->pmove.origin[0] * 0.125f +
1285  lerp * (ps->pmove.origin[0] - ops->pmove.origin[0]) * 0.125f;
1286  cl.refdef.vieworg[1] = ops->pmove.origin[1] * 0.125f +
1287  lerp * (ps->pmove.origin[1] - ops->pmove.origin[1]) * 0.125f;
1288  cl.refdef.vieworg[2] = ops->pmove.origin[2] * 0.125f +
1289  lerp * (ps->pmove.origin[2] - ops->pmove.origin[2]) * 0.125f;
1290  }
1291 
1292  // if not running a demo or on a locked frame, add the local angle movement
1293  if (cls.demo.playback) {
1294  LerpAngles(ops->viewangles, ps->viewangles, lerp, cl.refdef.viewangles);
1295  } else if (ps->pmove.pm_type < PM_DEAD) {
1296  // use predicted values
1297  VectorCopy(cl.predicted_angles, cl.refdef.viewangles);
1298  } else if (ops->pmove.pm_type < PM_DEAD && cls.serverProtocol > PROTOCOL_VERSION_DEFAULT) {
1299  // lerp from predicted angles, since enhanced servers
1300  // do not send viewangles each frame
1301  LerpAngles(cl.predicted_angles, ps->viewangles, lerp, cl.refdef.viewangles);
1302  } else {
1303  // just use interpolated values
1304  LerpAngles(ops->viewangles, ps->viewangles, lerp, cl.refdef.viewangles);
1305  }
1306 
1307 #if USE_SMOOTH_DELTA_ANGLES
1308  cl.delta_angles[0] = LerpShort(ops->pmove.delta_angles[0], ps->pmove.delta_angles[0], lerp);
1309  cl.delta_angles[1] = LerpShort(ops->pmove.delta_angles[1], ps->pmove.delta_angles[1], lerp);
1310  cl.delta_angles[2] = LerpShort(ops->pmove.delta_angles[2], ps->pmove.delta_angles[2], lerp);
1311 #endif
1312 
1313  // don't interpolate blend color
1314  Vector4Copy(ps->blend, cl.refdef.blend);
1315 
1316 #if USE_FPS
1317  ps = &cl.keyframe.ps;
1318  ops = &cl.oldkeyframe.ps;
1319 
1320  lerp = cl.keylerpfrac;
1321 #endif
1322 
1323  // interpolate field of view
1324  cl.fov_x = lerp_client_fov(ops->fov, ps->fov, lerp);
1325  cl.fov_y = V_CalcFov(cl.fov_x, 4, 3);
1326 
1327  LerpVector(ops->viewoffset, ps->viewoffset, lerp, viewoffset);
1328 
1329  AngleVectors(cl.refdef.viewangles, cl.v_forward, cl.v_right, cl.v_up);
1330 
1331  VectorCopy(cl.refdef.vieworg, cl.playerEntityOrigin);
1332  VectorCopy(cl.refdef.viewangles, cl.playerEntityAngles);
1333 
1334  if (cl.playerEntityAngles[PITCH] > 180) {
1335  cl.playerEntityAngles[PITCH] -= 360;
1336  }
1337 
1338  cl.playerEntityAngles[PITCH] = cl.playerEntityAngles[PITCH] / 3;
1339 
1340  VectorAdd(cl.refdef.vieworg, viewoffset, cl.refdef.vieworg);
1341 
1342  VectorCopy(cl.refdef.vieworg, listener_origin);
1343  VectorCopy(cl.v_forward, listener_forward);
1344  VectorCopy(cl.v_right, listener_right);
1345  VectorCopy(cl.v_up, listener_up);
1346 }

Referenced by CL_AddEntities(), and CL_Frame().

◆ CL_CheckDownloadExtension()

qboolean CL_CheckDownloadExtension ( const char *  ext)

Definition at line 494 of file download.c.

495 {
496  static const char allowed[][4] = {
497  "pcx", "wal", "wav", "md2", "sp2", "tga", "png",
498  "jpg", "bsp", "ent", "txt", "dm2", "loc", "md3"
499  };
500  int i;
501 
502  for (i = 0; i < q_countof(allowed); i++)
503  if (!Q_stricmp(ext, allowed[i]))
504  return qtrue;
505 
506  return qfalse;
507 }

Referenced by check_and_queue_download(), and check_file_len().

◆ CL_CheckForIgnore()

qboolean CL_CheckForIgnore ( const char *  s)

Definition at line 2043 of file main.c.

2044 {
2045  char buffer[MAX_STRING_CHARS];
2046  ignore_t *ignore;
2047 
2048  if (LIST_EMPTY(&cl_ignores)) {
2049  return qfalse;
2050  }
2051 
2052  Q_strlcpy(buffer, s, sizeof(buffer));
2053  COM_strclr(buffer);
2054 
2055  LIST_FOR_EACH(ignore_t, ignore, &cl_ignores, entry) {
2056  if (Com_WildCmp(ignore->match, buffer)) {
2057  ignore->hits++;
2058  return qtrue;
2059  }
2060  }
2061 
2062  return qfalse;
2063 }

Referenced by CL_ParsePrint().

◆ CL_CheckForPause()

void CL_CheckForPause ( void  )

Definition at line 3056 of file main.c.

3057 {
3058  if (cls.state != ca_active) {
3059  // only pause when active
3060  Cvar_Set("cl_paused", "0");
3061  Cvar_Set("sv_paused", "0");
3062  return;
3063  }
3064 
3065  if (cls.key_dest & (KEY_CONSOLE | KEY_MENU)) {
3066  // only pause in single player
3067  if (cl_paused->integer == 0 && cl_autopause->integer) {
3068  Cvar_Set("cl_paused", "1");
3069  }
3070  } else if (cl_paused->integer == 1) {
3071  // only resume after automatic pause
3072  Cvar_Set("cl_paused", "0");
3073  }
3074 
3075  // hack for demo playback pause/unpause
3076  if (cls.demo.playback) {
3077  // don't pause when running timedemo!
3078  if (cl_paused->integer && !com_timedemo->integer) {
3079  if (!sv_paused->integer) {
3080  Cvar_Set("sv_paused", "1");
3081  IN_Activate();
3082  }
3083  } else {
3084  if (sv_paused->integer) {
3085  Cvar_Set("sv_paused", "0");
3086  IN_Activate();
3087  }
3088  }
3089  }
3090 }

Referenced by CL_Changing_f(), CL_ClearState(), CL_Disconnect(), CL_Pause_f(), Key_SetDest(), and set_active_state().

◆ CL_CheckForResend()

void CL_CheckForResend ( void  )

Definition at line 387 of file main.c.

388 {
389  char tail[MAX_QPATH];
390  char userinfo[MAX_INFO_STRING];
391  int maxmsglen;
392 
393  if (cls.demo.playback) {
394  return;
395  }
396 
397  // if the local server is running and we aren't
398  // then connect
399  if (cls.state < ca_connecting && sv_running->integer > ss_loading) {
400  strcpy(cls.servername, "localhost");
401  cls.serverAddress.type = NA_LOOPBACK;
402  cls.serverProtocol = cl_protocol->integer;
403  if (cls.serverProtocol < PROTOCOL_VERSION_DEFAULT ||
404  cls.serverProtocol > PROTOCOL_VERSION_Q2PRO) {
405  cls.serverProtocol = PROTOCOL_VERSION_Q2PRO;
406  }
407 
408  // we don't need a challenge on the localhost
411  cls.connect_count = 0;
412 
413  cls.passive = qfalse;
414 
415  Con_Popup(qtrue);
416  UI_OpenMenu(UIMENU_NONE);
417  }
418 
419  // resend if we haven't gotten a reply yet
421  return;
422  }
423 
425  return;
426  }
427 
428  cls.connect_time = cls.realtime; // for retransmit requests
429  cls.connect_count++;
430 
431  if (cls.state == ca_challenging) {
432  Com_Printf("Requesting challenge... %i\n", cls.connect_count);
433  OOB_PRINT(NS_CLIENT, &cls.serverAddress, "getchallenge\n");
434  return;
435  }
436 
437  //
438  // We have gotten a challenge from the server, so try and connect.
439  //
440  Com_Printf("Requesting connection... %i\n", cls.connect_count);
441 
443 
444  // use maximum allowed msglen for loopback
445  maxmsglen = net_maxmsglen->integer;
446  if (NET_IsLocalAddress(&cls.serverAddress)) {
447  maxmsglen = MAX_PACKETLEN_WRITABLE;
448  }
449 
450  // add protocol dependent stuff
451  switch (cls.serverProtocol) {
452  case PROTOCOL_VERSION_R1Q2:
453  Q_snprintf(tail, sizeof(tail), " %d %d",
454  maxmsglen, PROTOCOL_VERSION_R1Q2_CURRENT);
455  cls.quakePort = net_qport->integer & 0xff;
456  break;
457  case PROTOCOL_VERSION_Q2PRO:
458  Q_snprintf(tail, sizeof(tail), " %d %d %d %d",
459  maxmsglen, net_chantype->integer, USE_ZLIB,
460  PROTOCOL_VERSION_Q2PRO_CURRENT);
461  cls.quakePort = net_qport->integer & 0xff;
462  break;
463  default:
464  tail[0] = 0;
465  cls.quakePort = net_qport->integer;
466  break;
467  }
468 
469  Cvar_BitInfo(userinfo, CVAR_USERINFO);
470  Netchan_OutOfBand(NS_CLIENT, &cls.serverAddress,
471  "connect %i %i %i \"%s\"%s\n", cls.serverProtocol, cls.quakePort,
472  cls.challenge, userinfo, tail);
473 }

Referenced by CL_Connect_f(), CL_ConnectionlessPacket(), CL_Frame(), and CL_ParseReconnect().

◆ CL_CheckPredictionError()

void CL_CheckPredictionError ( void  )

Definition at line 27 of file predict.c.

28 {
29  int frame;
30  int delta[3];
31  unsigned cmd;
32  int len;
33 
34  if (!cls.netchan) {
35  return;
36  }
37 
38  if (sv_paused->integer) {
39  VectorClear(cl.prediction_error);
40  return;
41  }
42 
43  if (!cl_predict->integer || (cl.frame.ps.pmove.pm_flags & PMF_NO_PREDICTION))
44  return;
45 
46  // calculate the last usercmd_t we sent that the server has processed
47  frame = cls.netchan->incoming_acknowledged & CMD_MASK;
48  cmd = cl.history[frame].cmdNumber;
49 
50  // compare what the server returned with what we had predicted it to be
51  VectorSubtract(cl.frame.ps.pmove.origin, cl.predicted_origins[cmd & CMD_MASK], delta);
52 
53  // save the prediction error for interpolation
54  len = abs(delta[0]) + abs(delta[1]) + abs(delta[2]);
55  if (len < 1 || len > 640) {
56  // > 80 world units is a teleport or something
57  VectorClear(cl.prediction_error);
58  return;
59  }
60 
61  SHOWMISS("prediction miss on %i: %i (%d %d %d)\n",
62  cl.frame.number, len, delta[0], delta[1], delta[2]);
63 
64  // don't predict steps against server returned data
65  if (cl.predicted_step_frame <= cmd)
66  cl.predicted_step_frame = cmd + 1;
67 
68  VectorCopy(cl.frame.ps.pmove.origin, cl.predicted_origins[cmd & CMD_MASK]);
69 
70  // save for error interpolation
71  VectorScale(delta, 0.125f, cl.prediction_error);
72 }

Referenced by CL_DeltaFrame().

◆ CL_CleanupDemos()

void CL_CleanupDemos ( void  )

Definition at line 1179 of file demo.c.

1180 {
1181  demosnap_t *snap, *next;
1182  size_t total;
1183 
1184  if (cls.demo.recording) {
1185  CL_Stop_f();
1186  }
1187 
1188  if (cls.demo.playback) {
1190 
1191  if (com_timedemo->integer && cls.demo.time_frames) {
1192  unsigned msec = Sys_Milliseconds();
1193 
1194  if (msec > cls.demo.time_start) {
1195  float sec = (msec - cls.demo.time_start) * 0.001f;
1196  float fps = cls.demo.time_frames / sec;
1197 
1198  Com_Printf("%u frames, %3.1f seconds: %3.1f fps\n",
1199  cls.demo.time_frames, sec, fps);
1200  }
1201  }
1202  }
1203 
1204  total = 0;
1205  LIST_FOR_EACH_SAFE(demosnap_t, snap, next, &cls.demo.snapshots, entry) {
1206  total += snap->msglen;
1207  Z_Free(snap);
1208  }
1209 
1210  if (total)
1211  Com_DPrintf("Freed %"PRIz" bytes of snaps\n", total);
1212 
1213  memset(&cls.demo, 0, sizeof(cls.demo));
1214 
1215  List_Init(&cls.demo.snapshots);
1216 }

Referenced by CL_Disconnect().

◆ CL_CleanupDownloads()

void CL_CleanupDownloads ( void  )

Definition at line 136 of file download.c.

137 {
138  dlqueue_t *q, *n;
139 
141 
142  FOR_EACH_DLQ_SAFE(q, n) {
143  Z_Free(q);
144  }
145 
146  List_Init(&cls.download.queue);
147  cls.download.pending = 0;
148 
149  cls.download.current = NULL;
150  cls.download.percent = 0;
151  cls.download.position = 0;
152 
153  if (cls.download.file) {
155  cls.download.file = 0;
156  }
157 
158  cls.download.temp[0] = 0;
159 
160 #if USE_ZLIB
161  inflateEnd(&cls.download.z);
162 #endif
163 }

Referenced by CL_Disconnect().

◆ CL_ClearEffects()

void CL_ClearEffects ( void  )

Definition at line 2067 of file effects.c.

2068 {
2070 #if USE_DLIGHTS
2071  CL_ClearDlights();
2072 #endif
2073 }

Referenced by CL_ClearState(), and CL_Seek_f().

◆ CL_ClearState()

void CL_ClearState ( void  )

Definition at line 699 of file main.c.

700 {
701  S_StopAllSounds();
702  CL_ClearEffects();
703 #if USE_LIGHTSTYLES
704  CL_ClearLightStyles();
705 #endif
706  CL_ClearTEnts();
708 
709  // wipe the entire cl structure
710  BSP_Free(cl.bsp);
711  memset(&cl, 0, sizeof(cl));
712  memset(&cl_entities, 0, sizeof(cl_entities));
713 
714  if (cls.state > ca_connected) {
718  }
719 
720  // unprotect game cvar
721  fs_game->flags &= ~CVAR_ROM;
722 
723 #if USE_REF == REF_GL
724  // unprotect our custom modulate cvars
725  if(gl_modulate_world) gl_modulate_world->flags &= ~CVAR_CHEAT;
726  if(gl_modulate_entities) gl_modulate_entities->flags &= ~CVAR_CHEAT;
727  if(gl_brightness) gl_brightness->flags &= ~CVAR_CHEAT;
728 #endif
729 }

Referenced by CL_Disconnect(), and CL_ParseServerData().

◆ CL_ClearTEnts()

void CL_ClearTEnts ( void  )

Definition at line 1459 of file tent.c.

1460 {
1461  CL_ClearBeams();
1463  CL_ClearLasers();
1464  CL_ClearSustains();
1465 }

Referenced by CL_ClearState(), and CL_Seek_f().

◆ CL_ClientCommand()

void CL_ClientCommand ( const char *  string)

Definition at line 299 of file main.c.

300 {
301  if (!cls.netchan) {
302  return;
303  }
304 
305  Com_DDPrintf("%s: %s\n", __func__, string);
306 
307  MSG_WriteByte(clc_stringcmd);
308  MSG_WriteString(string);
309  MSG_FlushTo(&cls.netchan->message);
310 }

Referenced by CL_Begin(), CL_ConnectionlessPacket(), CL_ForwardToServer(), CL_ForwardToServer_f(), CL_HandleDownload(), CL_Reconnect_f(), Con_Say(), HTTP_QueueDownload(), Key_Event(), SCR_FinishCinematic(), and start_udp_download().

◆ CL_ColorExplosionParticles()

void CL_ColorExplosionParticles ( vec3_t  org,
int  color,
int  run 
)

Definition at line 690 of file newfx.c.

691 {
692  int i, j;
693  cparticle_t *p;
694 
695  for (i = 0; i < 128; i++) {
696  p = CL_AllocParticle();
697  if (!p)
698  return;
699 
700  p->time = cl.time;
701  p->color = color + (rand() % run);
702 
703  for (j = 0; j < 3; j++) {
704  p->org[j] = org[j] + ((rand() % 32) - 16);
705  p->vel[j] = (rand() % 256) - 128;
706  }
707 
708  p->accel[0] = p->accel[1] = 0;
709  p->accel[2] = -PARTICLE_GRAVITY;
710  p->alpha = 1.0;
711 
712  p->alphavel = -0.4 / (0.6 + frand() * 0.2);
713  }
714 }

Referenced by CL_ParseTEnt().

◆ CL_DebugTrail()

void CL_DebugTrail ( vec3_t  start,
vec3_t  end 
)

Definition at line 63 of file newfx.c.

64 {
65  vec3_t move;
66  vec3_t vec;
67  float len;
68  cparticle_t *p;
69  float dec;
70  vec3_t right, up;
71 
72  VectorCopy(start, move);
73  VectorSubtract(end, start, vec);
74  len = VectorNormalize(vec);
75 
76  MakeNormalVectors(vec, right, up);
77 
78  dec = 3;
79  VectorScale(vec, dec, vec);
80  VectorCopy(start, move);
81 
82  while (len > 0) {
83  len -= dec;
84 
85  p = CL_AllocParticle();
86  if (!p)
87  return;
88 
89  p->time = cl.time;
90  VectorClear(p->accel);
91  VectorClear(p->vel);
92  p->alpha = 1.0;
93  p->alphavel = -0.1;
94  p->color = 0x74 + (rand() & 7);
95  VectorCopy(move, p->org);
96  VectorAdd(move, vec, move);
97  }
98 }

Referenced by CL_ParseTEnt().

◆ CL_DeltaFrame()

void CL_DeltaFrame ( void  )

Definition at line 358 of file entities.c.

359 {
360  centity_t *ent;
361  entity_state_t *state;
362  int i, j;
363  int framenum;
364  int prevstate = cls.state;
365 
366  // getting a valid frame message ends the connection process
367  if (cls.state == ca_precached)
369 
370  // set server time
371  framenum = cl.frame.number - cl.serverdelta;
372  cl.servertime = framenum * CL_FRAMETIME;
373 #if USE_FPS
374  cl.keyservertime = (framenum / cl.framediv) * BASE_FRAMETIME;
375 #endif
376 
377  // rebuild the list of solid entities for this frame
378  cl.numSolidEntities = 0;
379 
380  // initialize position of the player's own entity from playerstate.
381  // this is needed in situations when player entity is invisible, but
382  // server sends an effect referencing it's origin (such as MZ_LOGIN, etc)
383  ent = &cl_entities[cl.frame.clientNum + 1];
385 
386  for (i = 0; i < cl.frame.numEntities; i++) {
387  j = (cl.frame.firstEntity + i) & PARSE_ENTITIES_MASK;
388  state = &cl.entityStates[j];
389 
390  // set current and prev
391  entity_update(state);
392 
393  // fire events
394  entity_event(state->number);
395  }
396 
399  }
400 
401  if (prevstate == ca_precached)
402  CL_GTV_Resume();
403  else
405 
406  if (cls.demo.playback) {
407  // this delta has nothing to do with local viewangles,
408  // clear it to avoid interfering with demo freelook hack
409  VectorClear(cl.frame.ps.pmove.delta_angles);
410  }
411 
412  if (cl.oldframe.ps.pmove.pm_type != cl.frame.ps.pmove.pm_type) {
413  IN_Activate();
414  }
415 
417 
418 #if USE_FPS
419  if (CL_FRAMESYNC)
420  player_update(&cl.oldkeyframe, &cl.keyframe, cl.framediv);
421 #endif
422 
424 
426 }

Referenced by CL_ParseFrame(), and CL_Seek_f().

◆ CL_DemoFrame()

void CL_DemoFrame ( int  msec)

Definition at line 1223 of file demo.c.

1224 {
1225  if (cls.state < ca_connected) {
1226  return;
1227  }
1228 
1229  if (cls.state != ca_active) {
1230  parse_next_message(0);
1231  return;
1232  }
1233 
1234  if (com_timedemo->integer) {
1235  parse_next_message(0);
1236  cl.time = cl.servertime;
1237  cls.demo.time_frames++;
1238  return;
1239  }
1240 
1241  // wait at the end of demo
1242  if (cls.demo.eof) {
1243  if (!cl_demowait->integer)
1244  finish_demo(0);
1245  return;
1246  }
1247 
1248  // cl.time has already been advanced for this client frame
1249  // read the next frame to start lerp cycle again
1250  while (cl.servertime < cl.time) {
1251  if (parse_next_message(cl_demowait->integer))
1252  break;
1253  if (cls.state != ca_active)
1254  break;
1255  }
1256 }

Referenced by CL_Frame().

◆ CL_DiminishingTrail()

void CL_DiminishingTrail ( vec3_t  start,
vec3_t  end,
centity_t old,
int  flags 
)

Definition at line 1484 of file effects.c.

1485 {
1486  vec3_t move;
1487  vec3_t vec;
1488  float len;
1489  int j;
1490  cparticle_t *p;
1491  float dec;
1492  float orgscale;
1493  float velscale;
1494 
1495  VectorCopy(start, move);
1496  VectorSubtract(end, start, vec);
1497  len = VectorNormalize(vec);
1498 
1499  dec = 0.5;
1500  VectorScale(vec, dec, vec);
1501 
1502  if (old->trailcount > 900) {
1503  orgscale = 4;
1504  velscale = 15;
1505  } else if (old->trailcount > 800) {
1506  orgscale = 2;
1507  velscale = 10;
1508  } else {
1509  orgscale = 1;
1510  velscale = 5;
1511  }
1512 
1513  while (len > 0) {
1514  len -= dec;
1515 
1516  // drop less particles as it flies
1517  if ((rand() & 1023) < old->trailcount) {
1518  p = CL_AllocParticle();
1519  if (!p)
1520  return;
1521  VectorClear(p->accel);
1522 
1523  p->time = cl.time;
1524 
1525  if (flags & EF_GIB) {
1526  p->alpha = 1.0;
1527  p->alphavel = -1.0 / (1 + frand() * 0.4);
1528 
1529  p->color = 0xe8 + (rand() & 7);
1530  p->brightness = 1.0f;
1531 
1532  for (j = 0; j < 3; j++) {
1533  p->org[j] = move[j] + crand() * orgscale;
1534  p->vel[j] = crand() * velscale;
1535  p->accel[j] = 0;
1536  }
1537  p->vel[2] -= PARTICLE_GRAVITY;
1538  } else if (flags & EF_GREENGIB) {
1539  p->alpha = 1.0;
1540  p->alphavel = -1.0 / (1 + frand() * 0.4);
1541 
1542  p->color = 0xdb + (rand() & 7);
1543  p->brightness = 1.0f;
1544 
1545  for (j = 0; j < 3; j++) {
1546  p->org[j] = move[j] + crand() * orgscale;
1547  p->vel[j] = crand() * velscale;
1548  p->accel[j] = 0;
1549  }
1550  p->vel[2] -= PARTICLE_GRAVITY;
1551  } else {
1552  p->alpha = 1.0;
1553  p->alphavel = -1.0 / (1 + frand() * 0.2);
1554 
1555  p->color = 4 + (rand() & 7);
1556  p->brightness = 1.0f;
1557 
1558  for (j = 0; j < 3; j++) {
1559  p->org[j] = move[j] + crand() * orgscale;
1560  p->vel[j] = crand() * velscale;
1561  }
1562  p->accel[2] = 20;
1563  }
1564  }
1565 
1566  old->trailcount -= 5;
1567  if (old->trailcount < 100)
1568  old->trailcount = 100;
1569  VectorAdd(move, vec, move);
1570  }
1571 }

Referenced by CL_AddPacketEntities(), and CL_RocketTrail().

◆ CL_Disconnect()

void CL_Disconnect ( error_type_t  type)

Definition at line 740 of file main.c.

741 {
742  if (!cls.state) {
743  return;
744  }
745 
746  SCR_EndLoadingPlaque(); // get rid of loading plaque
747 
748  SCR_ClearChatHUD_f(); // clear chat HUD on server change
749 
751  EXEC_TRIGGER(cl_disconnectcmd);
752  }
753 
754 #if 0
755  if (cls.ref_initialized) {
756  R_CinematicSetPalette(NULL);
757  }
758 #endif
759 
760  //cls.connect_time = 0;
761  //cls.connect_count = 0;
762  cls.passive = qfalse;
763 #if USE_ICMP
764  cls.errorReceived = qfalse;
765 #endif
766 
767  if (cls.netchan) {
768  // send a disconnect message to the server
769  MSG_WriteByte(clc_stringcmd);
770  MSG_WriteData("disconnect", 11);
771 
772  cls.netchan->Transmit(cls.netchan, msg_write.cursize, msg_write.data, 3);
773 
775 
777  cls.netchan = NULL;
778  }
779 
780  // stop playback and/or recording
781  CL_CleanupDemos();
782 
783  // stop download
785 
786  CL_ClearState();
787 
788  CL_GTV_Suspend();
789 
792 
793  if (type == ERR_DISCONNECT) {
794  UI_OpenMenu(UIMENU_DEFAULT);
795  } else {
796  UI_OpenMenu(UIMENU_NONE);
797  }
798 
800 
802 }

Referenced by CL_Connect_f(), CL_ParseReconnect(), CL_PassiveConnect_f(), CL_PlayDemo_f(), CL_Reconnect_f(), CL_Shutdown(), Com_Error(), finish_demo(), and SV_InitGame().

◆ CL_EmitDemoFrame()

void CL_EmitDemoFrame ( void  )

Definition at line 186 of file demo.c.

187 {
188  server_frame_t *oldframe;
189  int lastframe;
190 
191  if (!cl.frame.valid)
192  return;
193 
194  // the first frame is delta uncompressed
195  if (cls.demo.last_server_frame == -1) {
196  oldframe = NULL;
197  lastframe = -1;
198  } else {
199  oldframe = &cl.frames[cls.demo.last_server_frame & UPDATE_MASK];
200  lastframe = FRAME_PRE;
201  if (oldframe->number != cls.demo.last_server_frame || !oldframe->valid ||
202  cl.numEntityStates - oldframe->firstEntity > MAX_PARSE_ENTITIES) {
203  oldframe = NULL;
204  lastframe = -1;
205  }
206  }
207 
208  // emit and flush frame
209  emit_delta_frame(oldframe, &cl.frame, lastframe, FRAME_CUR);
210 
211  if (cls.demo.buffer.cursize + msg_write.cursize > cls.demo.buffer.maxsize) {
212  Com_DPrintf("Demo frame overflowed (%"PRIz" + %"PRIz" > %"PRIz")\n",
213  cls.demo.buffer.cursize, msg_write.cursize, cls.demo.buffer.maxsize);
215 
216  // warn the user if drop rate is too high
217  if (cls.demo.frames_written < 10 && cls.demo.frames_dropped == 50)
218  Com_WPrintf("Too many demo frames don't fit into %"PRIz" bytes.\n"
219  "Try to increase 'cl_demomsglen' value and restart recording.\n",
220  cls.demo.buffer.maxsize);
221  } else {
222  SZ_Write(&cls.demo.buffer, msg_write.data, msg_write.cursize);
225  }
226 
228 }

Referenced by CL_DeltaFrame(), and resume_record().

◆ CL_EmitDemoSnapshot()

void CL_EmitDemoSnapshot ( void  )

Definition at line 773 of file demo.c.

774 {
775  demosnap_t *snap;
776  off_t pos;
777  char *from, *to;
778  size_t len;
779  server_frame_t *lastframe, *frame;
780  int i, j, lastnum;
781 
782  if (cl_demosnaps->integer <= 0)
783  return;
784 
785  if (cls.demo.frames_read < cls.demo.last_snapshot + cl_demosnaps->integer * 10)
786  return;
787 
788  if (!cl.frame.valid)
789  return;
790 
791  if (!cls.demo.file_size)
792  return;
793 
794  pos = FS_Tell(cls.demo.playback);
795  if (pos < cls.demo.file_offset)
796  return;
797 
798  // write all the backups, since we can't predict what frame the next
799  // delta will come from
800  lastframe = NULL;
801  lastnum = -1;
802  for (i = 0; i < UPDATE_BACKUP; i++) {
803  j = cl.frame.number - (UPDATE_BACKUP - 1) + i;
804  frame = &cl.frames[j & UPDATE_MASK];
805  if (frame->number != j || !frame->valid ||
806  cl.numEntityStates - frame->firstEntity > MAX_PARSE_ENTITIES) {
807  continue;
808  }
809 
810  emit_delta_frame(lastframe, frame, lastnum, j);
811  lastframe = frame;
812  lastnum = frame->number;
813  }
814 
815  // write configstrings
816  for (i = 0; i < MAX_CONFIGSTRINGS; i++) {
817  from = cl.baseconfigstrings[i];
818  to = cl.configstrings[i];
819 
820  if (!strcmp(from, to))
821  continue;
822 
823  len = strlen(to);
824  if (len > MAX_QPATH)
825  len = MAX_QPATH;
826 
827  MSG_WriteByte(svc_configstring);
828  MSG_WriteShort(i);
829  MSG_WriteData(to, len);
830  MSG_WriteByte(0);
831  }
832 
833  // write layout
836 
837  snap = Z_Malloc(sizeof(*snap) + msg_write.cursize - 1);
838  snap->framenum = cls.demo.frames_read;
839  snap->filepos = pos;
840  snap->msglen = msg_write.cursize;
841  memcpy(snap->data, msg_write.data, msg_write.cursize);
842  List_Append(&cls.demo.snapshots, &snap->entry);
843 
844  Com_DPrintf("[%d] snaplen %"PRIz"\n", cls.demo.frames_read, msg_write.cursize);
845 
847 
849 }

Referenced by CL_Seek_f(), and parse_next_message().

◆ CL_ExplosionParticles()

void CL_ExplosionParticles ( vec3_t  org)

Definition at line 1221 of file effects.c.

1222 {
1223  int i, j;
1224  cparticle_t *p;
1225 
1226  const int count = 256 * cl_particle_num_factor->value;
1227 
1228  for (i = 0; i < count; i++) {
1229  p = CL_AllocParticle();
1230  if (!p)
1231  return;
1232 
1233  p->time = cl.time;
1234 
1235  p->color = 0xe0 + (rand() & 7);
1237 
1238  for (j = 0; j < 3; j++) {
1239  p->org[j] = org[j] + ((rand() % 32) - 16);
1240  p->vel[j] = (rand() % 384) - 192;
1241  }
1242 
1243  p->accel[0] = p->accel[1] = 0;
1244  p->accel[2] = -PARTICLE_GRAVITY;
1245  p->alpha = 1.0;
1246 
1247  p->alphavel = -0.8 / (0.5 + frand() * 0.3);
1248  }
1249 }

Referenced by CL_ParseTEnt().

◆ CL_FinalizeCmd()

void CL_FinalizeCmd ( void  )

Definition at line 790 of file input.c.

791 {
792  vec3_t move;
793 
794  // command buffer ticks in sync with cl_maxfps
795  if (cmd_buffer.waitCount > 0) {
796  cmd_buffer.waitCount--;
797  }
798  if (cl_cmdbuf.waitCount > 0) {
799  cl_cmdbuf.waitCount--;
800  }
801 
802  if (cls.state != ca_active) {
803  return; // not talking to a server
804  }
805 
806  if (sv_paused->integer) {
807  return;
808  }
809 
810 //
811 // figure button bits
812 //
813  if (in_attack.state & 3)
814  cl.cmd.buttons |= BUTTON_ATTACK;
815  if (in_use.state & 3)
816  cl.cmd.buttons |= BUTTON_USE;
817 
818  in_attack.state &= ~2;
819  in_use.state &= ~2;
820 
821  if (cls.key_dest == KEY_GAME && Key_AnyKeyDown()) {
822  cl.cmd.buttons |= BUTTON_ANY;
823  }
824 
825  if (cl.cmd.msec > 250) {
826  cl.cmd.msec = 100; // time was unreasonable
827  }
828 
829  // rebuild the movement vector
830  VectorClear(move);
831 
832  // get basic movement from keyboard
833  CL_BaseMove(move);
834 
835  // add mouse forward/side movement
836  move[0] += cl.mousemove[0];
837  move[1] += cl.mousemove[1];
838 
839  // clamp to server defined max speed
840  CL_ClampSpeed(move);
841 
842  // store the movement vector
843  cl.cmd.forwardmove = move[0];
844  cl.cmd.sidemove = move[1];
845  cl.cmd.upmove = move[2];
846 
847  // clear all states
848  cl.mousemove[0] = 0;
849  cl.mousemove[1] = 0;
850 
851  KeyClear(&in_right);
852  KeyClear(&in_left);
853 
856 
857  KeyClear(&in_up);
858  KeyClear(&in_down);
859 
861  KeyClear(&in_back);
862 
865 
866  cl.cmd.impulse = in_impulse;
867  in_impulse = 0;
868 
869  // save this command off for prediction
870  cl.cmdNumber++;
871  cl.cmds[cl.cmdNumber & CMD_MASK] = cl.cmd;
872 
873  // clear pending cmd
874  memset(&cl.cmd, 0, sizeof(cl.cmd));
875 }

Referenced by CL_Frame().

◆ CL_FinishDownload()

void CL_FinishDownload ( dlqueue_t q)

Definition at line 115 of file download.c.

116 {
117  if (q->state == DL_DONE) {
118  Com_Error(ERR_DROP, "%s: already done", __func__);
119  }
120  if (!cls.download.pending) {
121  Com_Error(ERR_DROP, "%s: bad pending count", __func__);
122  }
123 
124  q->state = DL_DONE;
125  cls.download.pending--;
126  Com_DPrintf("%s: %s [%d]\n", __func__, q->path, cls.download.pending);
127 }

Referenced by abort_downloads(), finish_download(), finish_udp_download(), rescan_queue(), start_download(), and start_udp_download().

◆ CL_FirstDemoFrame()

void CL_FirstDemoFrame ( void  )

Definition at line 876 of file demo.c.

877 {
878  ssize_t len, ofs;
879 
880  Com_DPrintf("[%d] first frame\n", cl.frame.number);
881 
882  // save base configstrings
884 
885  // obtain file length and offset of the second frame
886  len = FS_Length(cls.demo.playback);
887  ofs = FS_Tell(cls.demo.playback);
888  if (len > 0 && ofs > 0) {
889  cls.demo.file_offset = ofs;
890  cls.demo.file_size = len - ofs;
891  }
892 
893  // begin timedemo
894  if (com_timedemo->integer) {
895  cls.demo.time_frames = 0;
897  }
898 
899  // force initial snapshot
900  cls.demo.last_snapshot = INT_MIN;
901 }

Referenced by set_active_state().

◆ CL_FlagTrail()

void CL_FlagTrail ( vec3_t  start,
vec3_t  end,
int  color 
)

Definition at line 1436 of file effects.c.

1437 {
1438  vec3_t move;
1439  vec3_t vec;
1440  float len;
1441  int j;
1442  cparticle_t *p;
1443  int dec;
1444 
1445  VectorCopy(start, move);
1446  VectorSubtract(end, start, vec);
1447  len = VectorNormalize(vec);
1448 
1449  dec = 5;
1450  VectorScale(vec, 5, vec);
1451 
1452  while (len > 0) {
1453  len -= dec;
1454 
1455  p = CL_AllocParticle();
1456  if (!p)
1457  return;
1458  VectorClear(p->accel);
1459 
1460  p->time = cl.time;
1461 
1462  p->alpha = 1.0;
1463  p->alphavel = -1.0 / (0.8 + frand() * 0.2);
1464 
1465  p->color = color;
1466  p->brightness = 1.0f;
1467 
1468  for (j = 0; j < 3; j++) {
1469  p->org[j] = move[j] + crand() * 16;
1470  p->vel[j] = crand() * 5;
1471  p->accel[j] = 0;
1472  }
1473 
1474  VectorAdd(move, vec, move);
1475  }
1476 }

Referenced by CL_AddPacketEntities().

◆ CL_FlyEffect()

void CL_FlyEffect ( centity_t ent,
vec3_t  origin 
)

Definition at line 1815 of file effects.c.

1816 {
1817  int n;
1818  int count;
1819  int starttime;
1820 
1821  if (ent->fly_stoptime < cl.time) {
1822  starttime = cl.time;
1823  ent->fly_stoptime = cl.time + 60000;
1824  } else {
1825  starttime = ent->fly_stoptime - 60000;
1826  }
1827 
1828  n = cl.time - starttime;
1829  if (n < 20000)
1830  count = n * 162 / 20000.0;
1831  else {
1832  n = ent->fly_stoptime - cl.time;
1833  if (n < 20000)
1834  count = n * 162 / 20000.0;
1835  else
1836  count = 162;
1837  }
1838 
1839  CL_FlyParticles(origin, count);
1840 }

Referenced by CL_AddPacketEntities().

◆ CL_ForceWall()

void CL_ForceWall ( vec3_t  start,
vec3_t  end,
int  color 
)

Definition at line 143 of file newfx.c.

144 {
145  vec3_t move;
146  vec3_t vec;
147  float len;
148  int j;
149  cparticle_t *p;
150 
151  VectorCopy(start, move);
152  VectorSubtract(end, start, vec);
153  len = VectorNormalize(vec);
154 
155  VectorScale(vec, 4, vec);
156 
157  // FIXME: this is a really silly way to have a loop
158  while (len > 0) {
159  len -= 4;
160 
161  if (frand() > 0.3) {
162  p = CL_AllocParticle();
163  if (!p)
164  return;
165  VectorClear(p->accel);
166 
167  p->time = cl.time;
168 
169  p->alpha = 1.0;
170  p->alphavel = -1.0 / (3.0 + frand() * 0.5);
171  p->color = color;
172  for (j = 0; j < 3; j++) {
173  p->org[j] = move[j] + crand() * 3;
174  p->accel[j] = 0;
175  }
176  p->vel[0] = 0;
177  p->vel[1] = 0;
178  p->vel[2] = -40 - (crand() * 10);
179  }
180 
181  VectorAdd(move, vec, move);
182  }
183 }

Referenced by CL_ParseTEnt().

◆ CL_GenericParticleEffect()

void CL_GenericParticleEffect ( vec3_t  org,
vec3_t  dir,
int  color,
int  count,
int  numcolors,
int  dirspread,
float  alphavel 
)

Definition at line 191 of file newfx.c.

192 {
193  int i, j;
194  cparticle_t *p;
195  float d;
196 
197  for (i = 0; i < count; i++) {
198  p = CL_AllocParticle();
199  if (!p)
200  return;
201 
202  p->time = cl.time;
203  if (numcolors > 1)
204  p->color = color + (rand() & numcolors);
205  else
206  p->color = color;
207 
208  d = rand() & dirspread;
209  for (j = 0; j < 3; j++) {
210  p->org[j] = org[j] + ((rand() & 7) - 4) + d * dir[j];
211  p->vel[j] = crand() * 20;
212  }
213 
214  p->accel[0] = p->accel[1] = 0;
215  p->accel[2] = -PARTICLE_GRAVITY;
216  p->alpha = 1.0;
217 
218  p->alphavel = -1.0 / (0.5 + frand() * alphavel);
219  }
220 }

◆ CL_GetDemoInfo()

demoInfo_t* CL_GetDemoInfo ( const char *  path,
demoInfo_t *  info 
)

Definition at line 1091 of file demo.c.

1092 {
1093  qhandle_t f;
1094  int c, index;
1095  char string[MAX_QPATH];
1096  int clientNum, type;
1097 
1098  FS_FOpenFile(path, &f, FS_MODE_READ);
1099  if (!f) {
1100  return NULL;
1101  }
1102 
1103  type = read_first_message(f);
1104  if (type < 0) {
1105  goto fail;
1106  }
1107 
1108  if (type == 0) {
1109  if (MSG_ReadByte() != svc_serverdata) {
1110  goto fail;
1111  }
1112  if (MSG_ReadLong() != PROTOCOL_VERSION_DEFAULT) {
1113  goto fail;
1114  }
1115  MSG_ReadLong();
1116  MSG_ReadByte();
1117  MSG_ReadString(NULL, 0);
1118  clientNum = MSG_ReadShort();
1119  MSG_ReadString(NULL, 0);
1120 
1121  while (1) {
1122  c = MSG_ReadByte();
1123  if (c == -1) {
1124  if (read_next_message(f) <= 0) {
1125  break;
1126  }
1127  continue; // parse new message
1128  }
1129  if (c != svc_configstring) {
1130  break;
1131  }
1132  index = MSG_ReadShort();
1133  if (index < 0 || index >= MAX_CONFIGSTRINGS) {
1134  goto fail;
1135  }
1136  MSG_ReadString(string, sizeof(string));
1137  parse_info_string(info, clientNum, index, string);
1138  }
1139 
1140  info->mvd = qfalse;
1141  } else {
1142  if ((MSG_ReadByte() & SVCMD_MASK) != mvd_serverdata) {
1143  goto fail;
1144  }
1145  if (MSG_ReadLong() != PROTOCOL_VERSION_MVD) {
1146  goto fail;
1147  }
1148  MSG_ReadShort();
1149  MSG_ReadLong();
1150  MSG_ReadString(NULL, 0);
1151  clientNum = MSG_ReadShort();
1152 
1153  while (1) {
1154  index = MSG_ReadShort();
1155  if (index == MAX_CONFIGSTRINGS) {
1156  break;
1157  }
1158  if (index < 0 || index >= MAX_CONFIGSTRINGS) {
1159  goto fail;
1160  }
1161  MSG_ReadString(string, sizeof(string));
1162  parse_info_string(info, clientNum, index, string);
1163  }
1164 
1165  info->mvd = qtrue;
1166  }
1167 
1168  FS_FCloseFile(f);
1169  return info;
1170 
1171 fail:
1172  FS_FCloseFile(f);
1173  return NULL;
1174 
1175 }

Referenced by BuildName().

◆ CL_GetEntitySoundOrigin()

void CL_GetEntitySoundOrigin ( int  ent,
vec3_t  org 
)

Definition at line 1404 of file entities.c.

1405 {
1406  centity_t *ent;
1407  mmodel_t *cm;
1408  vec3_t mid;
1409 
1410  if (entnum < 0 || entnum >= MAX_EDICTS) {
1411  Com_Error(ERR_DROP, "%s: bad entnum: %d", __func__, entnum);
1412  }
1413 
1414  if (!entnum || entnum == listener_entnum) {
1415  // should this ever happen?
1416  VectorCopy(listener_origin, org);
1417  return;
1418  }
1419 
1420  // interpolate origin
1421  // FIXME: what should be the sound origin point for RF_BEAM entities?
1422  ent = &cl_entities[entnum];
1423  LerpVector(ent->prev.origin, ent->current.origin, cl.lerpfrac, org);
1424 
1425  // offset the origin for BSP models
1426  if (ent->current.solid == PACKED_BSP) {
1427  cm = cl.model_clip[ent->current.modelindex];
1428  if (cm) {
1429  VectorAvg(cm->mins, cm->maxs, mid);
1430  VectorAdd(org, mid, org);
1431  }
1432  }
1433 }

Referenced by AL_AddLoopSounds(), and AL_Spatialize().

◆ CL_HandleDownload()

void CL_HandleDownload ( byte *  data,
int  size,
int  percent,
int  compressed 
)

Definition at line 424 of file download.c.

425 {
427  qerror_t ret;
428 
429  if (!q) {
430  Com_Error(ERR_DROP, "%s: no download requested", __func__);
431  }
432 
433  if (size == -1) {
434  if (!percent) {
435  finish_udp_download("FAIL");
436  } else {
437  finish_udp_download("STOP");
438  }
439  return;
440  }
441 
442  // open the file if not opened yet
443  if (!cls.download.file) {
444  ret = FS_FOpenFile(cls.download.temp, &cls.download.file, FS_MODE_WRITE);
445  if (!cls.download.file) {
446  Com_EPrintf("[UDP] Couldn't open %s for writing: %s\n",
448  finish_udp_download(NULL);
449  return;
450  }
451  }
452 
453  if (compressed) {
454  if (inflate_udp_download(data, size, compressed))
455  return;
456  } else {
457  if (write_udp_download(data, size))
458  return;
459  }
460 
461  if (percent != 100) {
462  // request next block
463  // change display routines by zoid
464  cls.download.percent = percent;
465  cls.download.position += size;
466 
467  CL_ClientCommand("nextdl");
468  } else {
469  // close the file before renaming
471  cls.download.file = 0;
472 
473  // rename the temp file to its final name
474  ret = FS_RenameFile(cls.download.temp, q->path);
475  if (ret) {
476  Com_EPrintf("[UDP] Couldn't rename %s to %s: %s\n",
477  cls.download.temp, q->path, Q_ErrorString(ret));
478  finish_udp_download(NULL);
479  } else {
480  finish_udp_download("DONE");
481  }
482  }
483 }

Referenced by CL_ParseDownload().

◆ CL_Heatbeam()

void CL_Heatbeam ( vec3_t  start,
vec3_t  end 
)

Definition at line 266 of file newfx.c.

267 {
268  vec3_t move;
269  vec3_t vec;
270  float len;
271  int j;
272  cparticle_t *p;
273  int i;
274  float c, s;
275  vec3_t dir;
276  float ltime;
277  float step = 32.0, rstep;
278  float start_pt;
279  float rot;
280  float variance;
281  vec3_t end;
282 
283  VectorMA(start, 4096, forward, end);
284 
285  VectorCopy(start, move);
286  VectorSubtract(end, start, vec);
287  len = VectorNormalize(vec);
288 
289  ltime = (float) cl.time / 1000.0;
290  start_pt = fmod(ltime * 96.0, step);
291  VectorMA(move, start_pt, vec, move);
292 
293  VectorScale(vec, step, vec);
294 
295  rstep = M_PI / 10.0;
296  for (i = start_pt; i < len; i += step) {
297  if (i > step * 5) // don't bother after the 5th ring
298  break;
299 
300  for (rot = 0; rot < M_PI * 2; rot += rstep) {
301  p = CL_AllocParticle();
302  if (!p)
303  return;
304 
305  p->time = cl.time;
306  VectorClear(p->accel);
307  variance = 0.5;
308  c = cos(rot) * variance;
309  s = sin(rot) * variance;
310 
311  // trim it so it looks like it's starting at the origin
312  if (i < 10) {
313  VectorScale(cl.v_right, c * (i / 10.0), dir);
314  VectorMA(dir, s * (i / 10.0), cl.v_up, dir);
315  } else {
316  VectorScale(cl.v_right, c, dir);
317  VectorMA(dir, s, cl.v_up, dir);
318  }
319 
320  p->alpha = 0.5;
321  p->alphavel = -1000.0;
322  p->color = 223 - (rand() & 7);
323  for (j = 0; j < 3; j++) {
324  p->org[j] = move[j] + dir[j] * 3;
325  p->vel[j] = 0;
326  }
327  }
328 
329  VectorAdd(move, vec, move);
330  }
331 }

Referenced by CL_AddPlayerBeams().

◆ CL_IgnoreDownload()

qboolean CL_IgnoreDownload ( const char *  path)

Definition at line 95 of file download.c.

96 {
97  string_entry_t *entry;
98 
99  for (entry = cls.download.ignores; entry; entry = entry->next) {
100  if (Com_WildCmp(entry->string, path)) {
101  return qtrue;
102  }
103  }
104 
105  return qfalse;
106 }

Referenced by check_and_queue_download(), and check_file_len().

◆ CL_Init()

void CL_Init ( void  )

Definition at line 3414 of file main.c.

3415 {
3416  if (dedicated->integer) {
3417  return; // nothing running on the client
3418  }
3419 
3420  if (cl_running->integer) {
3421  return;
3422  }
3423 
3424  // all archived variables will now be loaded
3425 
3426  // start with full screen console
3427  cls.key_dest = KEY_CONSOLE;
3428 
3429 #ifdef _WIN32
3430  CL_InitRefresh();
3431  S_Init(); // sound must be initialized after window is created
3432 #else
3433  S_Init();
3434  CL_InitRefresh();
3435 #endif
3436 
3437  CL_InitLocal();
3438  IN_Init();
3439 
3440 #if USE_ZLIB
3441  if (inflateInit2(&cls.z, -MAX_WBITS) != Z_OK) {
3442  Com_Error(ERR_FATAL, "%s: inflateInit2() failed", __func__);
3443  }
3444 #endif
3445 
3447 
3448  HTTP_Init();
3449 
3450  UI_OpenMenu(UIMENU_DEFAULT);
3451 
3452  Con_PostInit();
3453  Con_RunConsole();
3454 
3455  cl_cmdbuf.from = FROM_STUFFTEXT;
3456  cl_cmdbuf.text = cl_cmdbuf_text;
3457  cl_cmdbuf.maxsize = sizeof(cl_cmdbuf_text);
3459 
3460  Cvar_Set("cl_running", "1");
3461 }

Referenced by Qcommon_Init().

◆ CL_InitAscii()

void CL_InitAscii ( void  )

Definition at line 370 of file ascii.c.

371 {
372  Cmd_AddCommand("aashot", SCR_ScoreShot_f);
373  Cmd_AddCommand("aadump", SCR_ScoreDump_f);
374 }

Referenced by CL_InitLocal().

◆ CL_InitDemos()

void CL_InitDemos ( void  )

Definition at line 1273 of file demo.c.

1274 {
1275  cl_demosnaps = Cvar_Get("cl_demosnaps", "10", 0);
1276  cl_demomsglen = Cvar_Get("cl_demomsglen", va("%d", MAX_PACKETLEN_WRITABLE_DEFAULT), 0);
1277  cl_demowait = Cvar_Get("cl_demowait", "0", 0);
1278 
1280  List_Init(&cls.demo.snapshots);
1281 }

Referenced by CL_InitLocal().

◆ CL_InitDownloads()

void CL_InitDownloads ( void  )

Definition at line 937 of file download.c.

938 {
939  Cmd_AddCommand("download", CL_Download_f);
940 
941  List_Init(&cls.download.queue);
942 }

Referenced by CL_InitLocal().

◆ CL_InitEffects()

void CL_InitEffects ( void  )

Definition at line 2075 of file effects.c.

2076 {
2077  int i, j;
2078 
2079  for (i = 0; i < NUMVERTEXNORMALS; i++)
2080  for (j = 0; j < 3; j++)
2081  avelocities[i][j] = (rand() & 255) * 0.01f;
2082 
2083 }

Referenced by CL_InitLocal().

◆ CL_InitRefresh()

void CL_InitRefresh ( void  )

Definition at line 289 of file refresh.c.

290 {
291  char *modelist;
292 
293  if (cls.ref_initialized) {
294  return;
295  }
296 
297  vid_display = Cvar_Get("vid_display", "0", CVAR_ARCHIVE | CVAR_REFRESH);
298  vid_displaylist = Cvar_Get("vid_displaylist", "\"<unknown>\" 0", CVAR_ROM);
299 
300  Com_SetLastError(NULL);
301 
302  modelist = VID_GetDefaultModeList();
303  if (!modelist) {
304  Com_Error(ERR_FATAL, "Couldn't initialize refresh: %s", Com_GetLastError());
305  }
306 
307  // Create the video variables so we know how to start the graphics drivers
308 
309  vid_rtx = Cvar_Get("vid_rtx",
310 #if REF_VKPT
311  "1",
312 #else
313  "0",
314 #endif
315  CVAR_REFRESH | CVAR_ARCHIVE);
316 
317  vid_fullscreen = Cvar_Get("vid_fullscreen", "0", CVAR_ARCHIVE);
318  _vid_fullscreen = Cvar_Get("_vid_fullscreen", "1", CVAR_ARCHIVE);
319  vid_modelist = Cvar_Get("vid_modelist", modelist, 0);
320  vid_geometry = Cvar_Get("vid_geometry", VID_GEOMETRY, CVAR_ARCHIVE);
321 
322  Z_Free(modelist);
323 
324  if (vid_fullscreen->integer) {
325  Cvar_Set("_vid_fullscreen", vid_fullscreen->string);
326  } else if (!_vid_fullscreen->integer) {
327  Cvar_Set("_vid_fullscreen", "1");
328  }
329 
330  Com_SetLastError(NULL);
331 
332 #if REF_GL && REF_VKPT
333  if (vid_rtx->integer)
335  else
337 #elif REF_GL
339 #elif REF_VKPT
341 #else
342 #error "REF_GL and REF_VKPT are both disabled, at least one has to be enableds"
343 #endif
344 
345  if (!R_Init(qtrue)) {
346  Com_Error(ERR_FATAL, "Couldn't initialize refresh: %s", Com_GetLastError());
347  }
348 
349  cls.ref_initialized = qtrue;
350 
354 
355  mode_changed = 0;
356 
357  FX_Init();
358 
359  // Initialize the rest of graphics subsystems
360  V_Init();
361  SCR_Init();
362  UI_Init();
363 
366 
367  cvar_modified &= ~(CVAR_FILES | CVAR_REFRESH);
368 }

Referenced by CL_Init(), and CL_RestartRefresh().

◆ CL_InitTEnts()

void CL_InitTEnts ( void  )

Definition at line 1467 of file tent.c.

1468 {
1469  cl_railtrail_type = Cvar_Get("cl_railtrail_type", "0", 0);
1470  cl_railtrail_time = Cvar_Get("cl_railtrail_time", "1.0", 0);
1471  cl_railcore_color = Cvar_Get("cl_railcore_color", "red", 0);
1473  cl_railcore_color->generator = Com_Color_g;
1475  cl_railcore_width = Cvar_Get("cl_railcore_width", "2", 0);
1476  cl_railspiral_color = Cvar_Get("cl_railspiral_color", "blue", 0);
1478  cl_railspiral_color->generator = Com_Color_g;
1480  cl_railspiral_radius = Cvar_Get("cl_railspiral_radius", "3", 0);
1481 }

Referenced by CL_InitLocal().

◆ CL_IonripperTrail()

void CL_IonripperTrail ( vec3_t  start,
vec3_t  end 
)

Definition at line 843 of file newfx.c.

844 {
845  vec3_t move;
846  vec3_t vec;
847  float len;
848  int j;
849  cparticle_t *p;
850  int dec;
851  int left = 0;
852 
853  VectorCopy(start, move);
854  VectorSubtract(ent, start, vec);
855  len = VectorNormalize(vec);
856 
857  dec = 5;
858  VectorScale(vec, 5, vec);
859 
860  while (len > 0) {
861  len -= dec;
862 
863  p = CL_AllocParticle();
864  if (!p)
865  return;
866  VectorClear(p->accel);
867 
868  p->time = cl.time;
869  p->alpha = 0.5;
870  p->alphavel = -1.0 / (0.3 + frand() * 0.2);
871  p->color = 0xe4 + (rand() & 3);
872 
873  for (j = 0; j < 3; j++) {
874  p->org[j] = move[j];
875  p->accel[j] = 0;
876  }
877  if (left) {
878  left = 0;
879  p->vel[0] = 10;
880  } else {
881  left = 1;
882  p->vel[0] = -10;
883  }
884 
885  p->vel[1] = 0;
886  p->vel[2] = 0;
887 
888  VectorAdd(move, vec, move);
889  }
890 }

Referenced by CL_AddPacketEntities().

◆ CL_ItemRespawnParticles()

void CL_ItemRespawnParticles ( vec3_t  org)

Definition at line 1183 of file effects.c.

1184 {
1185  int i, j;
1186  cparticle_t *p;
1187 
1188  const int count = 64 * cl_particle_num_factor->value;
1189 
1190  for (i = 0; i < count; i++) {
1191  p = CL_AllocParticle();
1192  if (!p)
1193  return;
1194 
1195  p->time = cl.time;
1196 
1197  p->color = 0xd4 + (rand() & 3); // green
1198  p->brightness = 1.0f;
1199 
1200  p->org[0] = org[0] + crand() * 8;
1201  p->org[1] = org[1] + crand() * 8;
1202  p->org[2] = org[2] + crand() * 8;
1203 
1204  for (j = 0; j < 3; j++)
1205  p->vel[j] = crand() * 8;
1206 
1207  p->accel[0] = p->accel[1] = 0;
1208  p->accel[2] = -PARTICLE_GRAVITY * 0.2;
1209  p->alpha = 1.0;
1210 
1211  p->alphavel = -1.0 / (1.0 + frand() * 0.3);
1212  }
1213 }

Referenced by entity_event().

◆ CL_LoadClientinfo()

void CL_LoadClientinfo ( clientinfo_t ci,
const char *  s 
)

Definition at line 104 of file precache.c.

105 {
106  int i;
107  char model_name[MAX_QPATH];
108  char skin_name[MAX_QPATH];
109  char model_filename[MAX_QPATH];
110  char skin_filename[MAX_QPATH];
111  char weapon_filename[MAX_QPATH];
112  char icon_filename[MAX_QPATH];
113 
114  CL_ParsePlayerSkin(ci->name, model_name, skin_name, s);
115 
116  // model file
117  Q_concat(model_filename, sizeof(model_filename),
118  "players/", model_name, "/tris.md2", NULL);
119  ci->model = R_RegisterModel(model_filename);
120  if (!ci->model && Q_stricmp(model_name, "male")) {
121  strcpy(model_name, "male");
122  strcpy(model_filename, "players/male/tris.md2");
123  ci->model = R_RegisterModel(model_filename);
124  }
125 
126  // skin file
127  Q_concat(skin_filename, sizeof(skin_filename),
128  "players/", model_name, "/", skin_name, ".pcx", NULL);
129  ci->skin = R_RegisterSkin(skin_filename);
130 
131  // if we don't have the skin and the model was female,
132  // see if athena skin exists
133  if (!ci->skin && !Q_stricmp(model_name, "female")) {
134  strcpy(skin_name, "athena");
135  strcpy(skin_filename, "players/female/athena.pcx");
136  ci->skin = R_RegisterSkin(skin_filename);
137  }
138 
139  // if we don't have the skin and the model wasn't male,
140  // see if the male has it (this is for CTF's skins)
141  if (!ci->skin && Q_stricmp(model_name, "male")) {
142  // change model to male
143  strcpy(model_name, "male");
144  strcpy(model_filename, "players/male/tris.md2");
145  ci->model = R_RegisterModel(model_filename);
146 
147  // see if the skin exists for the male model
148  Q_concat(skin_filename, sizeof(skin_filename),
149  "players/male/", skin_name, ".pcx", NULL);
150  ci->skin = R_RegisterSkin(skin_filename);
151  }
152 
153  // if we still don't have a skin, it means that the male model
154  // didn't have it, so default to grunt
155  if (!ci->skin) {
156  // see if the skin exists for the male model
157  strcpy(skin_name, "grunt");
158  strcpy(skin_filename, "players/male/grunt.pcx");
159  ci->skin = R_RegisterSkin(skin_filename);
160  }
161 
162  // weapon file
163  for (i = 0; i < cl.numWeaponModels; i++) {
164  Q_concat(weapon_filename, sizeof(weapon_filename),
165  "players/", model_name, "/", cl.weaponModels[i], NULL);
166  ci->weaponmodel[i] = R_RegisterModel(weapon_filename);
167  if (!ci->weaponmodel[i] && !Q_stricmp(model_name, "cyborg")) {
168  // try male
169  Q_concat(weapon_filename, sizeof(weapon_filename),
170  "players/male/", cl.weaponModels[i], NULL);
171  ci->weaponmodel[i] = R_RegisterModel(weapon_filename);
172  }
173  }
174 
175  // icon file
176  Q_concat(icon_filename, sizeof(icon_filename),
177  "/players/", model_name, "/", skin_name, "_i.pcx", NULL);
178  ci->icon = R_RegisterPic2(icon_filename);
179 
180  strcpy(ci->model_name, model_name);
181  strcpy(ci->skin_name, skin_name);
182 
183  // base info should be at least partially valid
184  if (ci == &cl.baseclientinfo)
185  return;
186 
187  // must have loaded all data types to be valid
188  if (!ci->skin || !ci->icon || !ci->model || !ci->weaponmodel[0]) {
189  ci->skin = 0;
190  ci->icon = 0;
191  ci->model = 0;
192  ci->weaponmodel[0] = 0;
193  ci->model_name[0] = 0;
194  ci->skin_name[0] = 0;
195  }
196 }

Referenced by cl_noskins_changed(), CL_PrepRefresh(), CL_Skins_f(), and CL_UpdateConfigstring().

◆ CL_LoadDownloadIgnores()

void CL_LoadDownloadIgnores ( void  )

Definition at line 173 of file download.c.

174 {
175  string_entry_t *entry, *next;
176  char *raw, *data, *p;
177  int count, line;
178  ssize_t len;
179 
180  // free previous entries
181  for (entry = cls.download.ignores; entry; entry = next) {
182  next = entry->next;
183  Z_Free(entry);
184  }
185 
186  cls.download.ignores = NULL;
187 
188  // load new list
189  len = FS_LoadFile(CL_DOWNLOAD_IGNORES, (void **)&raw);
190  if (!raw) {
191  if (len != Q_ERR_NOENT)
192  Com_EPrintf("Couldn't load %s: %s\n",
194  return;
195  }
196 
197  count = 0;
198  line = 1;
199  data = raw;
200 
201  while (*data) {
202  p = strchr(data, '\n');
203  if (p) {
204  if (p > data && *(p - 1) == '\r')
205  *(p - 1) = 0;
206  *p = 0;
207  }
208 
209  // ignore empty lines and comments
210  if (*data && *data != '#' && *data != '/') {
211  len = strlen(data);
212  if (len < MAX_QPATH) {
213  entry = Z_Malloc(sizeof(*entry) + len);
214  memcpy(entry->string, data, len + 1);
215  entry->next = cls.download.ignores;
216  cls.download.ignores = entry;
217  count++;
218  } else {
219  Com_WPrintf("Oversize filter on line %d in %s\n",
220  line, CL_DOWNLOAD_IGNORES);
221  }
222  }
223 
224  if (!p)
225  break;
226 
227  data = p + 1;
228  line++;
229  }
230 
231  Com_DPrintf("Loaded %d filters from %s\n", count, CL_DOWNLOAD_IGNORES);
232 
233  FS_FreeFile(raw);
234 }

Referenced by CL_Init(), and CL_RestartFilesystem().

◆ CL_LoadState()

void CL_LoadState ( load_state_t  state)

Definition at line 541 of file console.c.

542 {
543  con.loadstate = state;
545  VID_PumpEvents();
546 }

Referenced by CL_Begin(), CL_Precache_f(), CL_PrepRefresh(), CL_RestartFilesystem(), and CL_RestartRefresh().

◆ CL_MonsterPlasma_Shell()

void CL_MonsterPlasma_Shell ( vec3_t  origin)

Definition at line 493 of file newfx.c.

494 {
495  vec3_t dir;
496  int i;
497  cparticle_t *p;
498 
499  for (i = 0; i < 40; i++) {
500  p = CL_AllocParticle();
501  if (!p)
502  return;
503  VectorClear(p->accel);
504 
505  p->time = cl.time;
506 
507  p->alpha = 1.0;
509  p->color = 0xe0;
510 
511  dir[0] = crand();
512  dir[1] = crand();
513  dir[2] = crand();
514  VectorNormalize(dir);
515 
516  VectorMA(origin, 10, dir, p->org);
517  }
518 }

Referenced by CL_AddPlayerBeams().

◆ CL_MuzzleFlash()

void CL_MuzzleFlash ( void  )

Definition at line 257 of file effects.c.

258 {
259 #if USE_DLIGHTS
260  vec3_t fv, rv;
261  cdlight_t *dl;
262 #endif
263  centity_t *pl;
264  float volume;
265  char soundname[MAX_QPATH];
266 
267 #ifdef _DEBUG
268  if (developer->integer)
269  CL_CheckEntityPresent(mz.entity, "muzzleflash");
270 #endif
271 
272  pl = &cl_entities[mz.entity];
273 
274 #if USE_DLIGHTS
275  dl = CL_AllocDlight(mz.entity);
276  VectorCopy(pl->current.origin, dl->origin);
277  AngleVectors(pl->current.angles, fv, rv, NULL);
278  VectorMA(dl->origin, 18, fv, dl->origin);
279  VectorMA(dl->origin, 16, rv, dl->origin);
280  if (mz.silenced)
281  dl->radius = 100 + (rand() & 31);
282  else
283  dl->radius = 200 + (rand() & 31);
284  //dl->minlight = 32;
285  dl->die = cl.time; // + 0.1;
286 #define DL_COLOR(r, g, b) VectorSet(dl->color, r, g, b)
287 #define DL_RADIUS(r) (dl->radius = r)
288 #define DL_DIE(t) (dl->die = cl.time + t)
289 #else
290 #define DL_COLOR(r, g, b)
291 #define DL_RADIUS(r)
292 #define DL_DIE(t)
293 #endif
294 
295  if (mz.silenced)
296  volume = 0.2;
297  else
298  volume = 1;
299 
300  switch (mz.weapon) {
301  case MZ_BLASTER:
302  DL_COLOR(1, 1, 0);
303  S_StartSound(NULL, mz.entity, CHAN_WEAPON, S_RegisterSound("weapons/blastf1a.wav"), volume, ATTN_NORM, 0);
304  break;
305  case MZ_BLUEHYPERBLASTER:
306  DL_COLOR(0, 0, 1);
307  S_StartSound(NULL, mz.entity, CHAN_WEAPON, S_RegisterSound("weapons/hyprbf1a.wav"), volume, ATTN_NORM, 0);
308  break;
309  case MZ_HYPERBLASTER:
310  DL_COLOR(1, 1, 0);
311  S_StartSound(NULL, mz.entity, CHAN_WEAPON, S_RegisterSound("weapons/hyprbf1a.wav"), volume, ATTN_NORM, 0);
312  break;
313  case MZ_MACHINEGUN:
314  DL_COLOR(1, 1, 0);
315  Q_snprintf(soundname, sizeof(soundname), "weapons/machgf%ib.wav", (rand() % 5) + 1);
316  S_StartSound(NULL, mz.entity, CHAN_WEAPON, S_RegisterSound(soundname), volume, ATTN_NORM, 0);
317  break;
318  case MZ_SHOTGUN:
319  DL_COLOR(1, 1, 0);
320  S_StartSound(NULL, mz.entity, CHAN_WEAPON, S_RegisterSound("weapons/shotgf1b.wav"), volume, ATTN_NORM, 0);
321  S_StartSound(NULL, mz.entity, CHAN_AUTO, S_RegisterSound("weapons/shotgr1b.wav"), volume, ATTN_NORM, 0.1);
322  break;
323  case MZ_SSHOTGUN:
324  DL_COLOR(1, 1, 0);
325  S_StartSound(NULL, mz.entity, CHAN_WEAPON, S_RegisterSound("weapons/sshotf1b.wav"), volume, ATTN_NORM, 0);
326  break;
327  case MZ_CHAINGUN1:
328  DL_RADIUS(200 + (rand() & 31));
329  DL_COLOR(1, 0.25, 0);
330  Q_snprintf(soundname, sizeof(soundname), "weapons/machgf%ib.wav", (rand() % 5) + 1);
331  S_StartSound(NULL, mz.entity, CHAN_WEAPON, S_RegisterSound(soundname), volume, ATTN_NORM, 0);
332  break;
333  case MZ_CHAINGUN2:
334  DL_RADIUS(225 + (rand() & 31));
335  DL_COLOR(1, 0.5, 0);
336  DL_DIE(0.1); // long delay
337  Q_snprintf(soundname, sizeof(soundname), "weapons/machgf%ib.wav", (rand() % 5) + 1);
338  S_StartSound(NULL, mz.entity, CHAN_WEAPON, S_RegisterSound(soundname), volume, ATTN_NORM, 0);
339  Q_snprintf(soundname, sizeof(soundname), "weapons/machgf%ib.wav", (rand() % 5) + 1);
340  S_StartSound(NULL, mz.entity, CHAN_WEAPON, S_RegisterSound(soundname), volume, ATTN_NORM, 0.05);
341  break;
342  case MZ_CHAINGUN3:
343  DL_RADIUS(250 + (rand() & 31));
344  DL_COLOR(1, 1, 0);
345  DL_DIE(0.1); // long delay
346  Q_snprintf(soundname, sizeof(soundname), "weapons/machgf%ib.wav", (rand() % 5) + 1);
347  S_StartSound(NULL, mz.entity, CHAN_WEAPON, S_RegisterSound(soundname), volume, ATTN_NORM, 0);
348  Q_snprintf(soundname, sizeof(soundname), "weapons/machgf%ib.wav", (rand() % 5) + 1);
349  S_StartSound(NULL, mz.entity, CHAN_WEAPON, S_RegisterSound(soundname), volume, ATTN_NORM, 0.033);
350  Q_snprintf(soundname, sizeof(soundname), "weapons/machgf%ib.wav", (rand() % 5) + 1);
351  S_StartSound(NULL, mz.entity, CHAN_WEAPON, S_RegisterSound(soundname), volume, ATTN_NORM, 0.066);
352  break;
353  case MZ_RAILGUN:
354  DL_COLOR(0.5, 0.5, 1.0);
355  S_StartSound(NULL, mz.entity, CHAN_WEAPON, S_RegisterSound("weapons/railgf1a.wav"), volume, ATTN_NORM, 0);
356  break;
357  case MZ_ROCKET:
358  DL_COLOR(1, 0.5, 0.2);
359  S_StartSound(NULL, mz.entity, CHAN_WEAPON, S_RegisterSound("weapons/rocklf1a.wav"), volume, ATTN_NORM, 0);
360  S_StartSound(NULL, mz.entity, CHAN_AUTO, S_RegisterSound("weapons/rocklr1b.wav"), volume, ATTN_NORM, 0.1);
361  break;
362  case MZ_GRENADE:
363  DL_COLOR(1, 0.5, 0);
364  S_StartSound(NULL, mz.entity, CHAN_WEAPON, S_RegisterSound("weapons/grenlf1a.wav"), volume, ATTN_NORM, 0);
365  S_StartSound(NULL, mz.entity, CHAN_AUTO, S_RegisterSound("weapons/grenlr1b.wav"), volume, ATTN_NORM, 0.1);
366  break;
367  case MZ_BFG:
368  DL_COLOR(0, 1, 0);
369  S_StartSound(NULL, mz.entity, CHAN_WEAPON, S_RegisterSound("weapons/bfg__f1y.wav"), volume, ATTN_NORM, 0);
370  break;
371  case MZ_LOGIN:
372  DL_COLOR(0, 1, 0);
373  DL_DIE(1.0);
374  S_StartSound(NULL, mz.entity, CHAN_WEAPON, S_RegisterSound("weapons/grenlf1a.wav"), 1, ATTN_NORM, 0);
375  CL_LogoutEffect(pl->current.origin, mz.weapon);
376  break;
377  case MZ_LOGOUT:
378  DL_COLOR(1, 0, 0);
379  DL_DIE(1.0);
380  S_StartSound(NULL, mz.entity, CHAN_WEAPON, S_RegisterSound("weapons/grenlf1a.wav"), 1, ATTN_NORM, 0);
381  CL_LogoutEffect(pl->current.origin, mz.weapon);
382  break;
383  case MZ_RESPAWN:
384  DL_COLOR(1, 1, 0);
385  DL_DIE(1.0);
386  S_StartSound(NULL, mz.entity, CHAN_WEAPON, S_RegisterSound("weapons/grenlf1a.wav"), 1, ATTN_NORM, 0);
387  CL_LogoutEffect(pl->current.origin, mz.weapon);
388  break;
389  case MZ_PHALANX:
390  DL_COLOR(1, 0.5, 0.5);
391  S_StartSound(NULL, mz.entity, CHAN_WEAPON, S_RegisterSound("weapons/plasshot.wav"), volume, ATTN_NORM, 0);
392  break;
393  case MZ_IONRIPPER:
394  DL_COLOR(1, 0.5, 0.5);
395  S_StartSound(NULL, mz.entity, CHAN_WEAPON, S_RegisterSound("weapons/rippfiref.wav"), volume, ATTN_NORM, 0);
396  break;
397 
398  case MZ_ETF_RIFLE:
399  DL_COLOR(0.9, 0.7, 0);
400  S_StartSound(NULL, mz.entity, CHAN_WEAPON, S_RegisterSound("weapons/nail1.wav"), volume, ATTN_NORM, 0);
401  break;
402  case MZ_SHOTGUN2:
403  DL_COLOR(1, 1, 0);
404  S_StartSound(NULL, mz.entity, CHAN_WEAPON, S_RegisterSound("weapons/shotg2.wav"), volume, ATTN_NORM, 0);
405  break;
406  case MZ_HEATBEAM:
407  DL_COLOR(1, 1, 0);
408  DL_DIE(100);
409 // S_StartSound (NULL, mz.entity, CHAN_WEAPON, S_RegisterSound("weapons/bfg__l1a.wav"), volume, ATTN_NORM, 0);
410  break;
411  case MZ_BLASTER2:
412  DL_COLOR(0, 1, 0);
413  // FIXME - different sound for blaster2 ??
414  S_StartSound(NULL, mz.entity, CHAN_WEAPON, S_RegisterSound("weapons/blastf1a.wav"), volume, ATTN_NORM, 0);
415  break;
416  case MZ_TRACKER:
417  // negative flashes handled the same in gl/soft until CL_AddDLights
418  DL_COLOR(-1, -1, -1);
419  S_StartSound(NULL, mz.entity, CHAN_WEAPON, S_RegisterSound("weapons/disint2.wav"), volume, ATTN_NORM, 0);
420  break;
421  case MZ_NUKE1:
422  DL_COLOR(1, 0, 0);
423  DL_DIE(100);
424  break;
425  case MZ_NUKE2:
426  DL_COLOR(1, 1, 0);
427  DL_DIE(100);
428  break;
429  case MZ_NUKE4:
430  DL_COLOR(0, 0, 1);
431  DL_DIE(100);
432  break;
433  case MZ_NUKE8:
434  DL_COLOR(0, 1, 1);
435  DL_DIE(100);
436  break;
437 
438  // Q2RTX
439  case MZ_FLARE:
440  DL_RADIUS(0);
441  S_StartSound(NULL, mz.entity, CHAN_WEAPON, S_RegisterSound("weapons/flaregun.wav"), volume, ATTN_NORM, 0);
442  break;
443  // Q2RTX
444  }
445 
446  if (vid_rtx->integer)
447  {
448  // don't add muzzle flashes in RTX mode
449  DL_RADIUS(0.f);
450  }
451 }

Referenced by CL_ParseServerMessage().

◆ CL_MuzzleFlash2()

void CL_MuzzleFlash2 ( void  )

Definition at line 459 of file effects.c.

460 {
461  centity_t *ent;
462  vec3_t origin;
463  const vec_t *ofs;
464 #if USE_DLIGHTS
465  cdlight_t *dl;
466 #endif
467  vec3_t forward, right;
468  char soundname[MAX_QPATH];
469 
470  // locate the origin
471  ent = &cl_entities[mz.entity];
472  AngleVectors(ent->current.angles, forward, right, NULL);
474  origin[0] = ent->current.origin[0] + forward[0] * ofs[0] + right[0] * ofs[1];
475  origin[1] = ent->current.origin[1] + forward[1] * ofs[0] + right[1] * ofs[1];
476  origin[2] = ent->current.origin[2] + forward[2] * ofs[0] + right[2] * ofs[1] + ofs[2];
477 
478 #if USE_DLIGHTS
479  dl = CL_AllocDlight(mz.entity);
480  VectorCopy(origin, dl->origin);
481  dl->radius = 200 + (rand() & 31);
482  //dl->minlight = 32;
483  dl->die = cl.time; // + 0.1;
484 #endif
485 
486  switch (mz.weapon) {
487  case MZ2_INFANTRY_MACHINEGUN_1:
488  case MZ2_INFANTRY_MACHINEGUN_2:
489  case MZ2_INFANTRY_MACHINEGUN_3:
490  case MZ2_INFANTRY_MACHINEGUN_4:
491  case MZ2_INFANTRY_MACHINEGUN_5:
492  case MZ2_INFANTRY_MACHINEGUN_6:
493  case MZ2_INFANTRY_MACHINEGUN_7:
494  case MZ2_INFANTRY_MACHINEGUN_8:
495  case MZ2_INFANTRY_MACHINEGUN_9:
496  case MZ2_INFANTRY_MACHINEGUN_10:
497  case MZ2_INFANTRY_MACHINEGUN_11:
498  case MZ2_INFANTRY_MACHINEGUN_12:
499  case MZ2_INFANTRY_MACHINEGUN_13:
500  DL_COLOR(1, 1, 0);
503  S_StartSound(NULL, mz.entity, CHAN_WEAPON, S_RegisterSound("infantry/infatck1.wav"), 1, ATTN_NORM, 0);
504  break;
505 
506  case MZ2_SOLDIER_MACHINEGUN_1:
507  case MZ2_SOLDIER_MACHINEGUN_2:
508  case MZ2_SOLDIER_MACHINEGUN_3:
509  case MZ2_SOLDIER_MACHINEGUN_4:
510  case MZ2_SOLDIER_MACHINEGUN_5:
511  case MZ2_SOLDIER_MACHINEGUN_6:
512  case MZ2_SOLDIER_MACHINEGUN_7:
513  case MZ2_SOLDIER_MACHINEGUN_8:
514  DL_COLOR(1, 1, 0);
517  S_StartSound(NULL, mz.entity, CHAN_WEAPON, S_RegisterSound("soldier/solatck3.wav"), 1, ATTN_NORM, 0);
518  break;
519 
520  case MZ2_GUNNER_MACHINEGUN_1:
521  case MZ2_GUNNER_MACHINEGUN_2:
522  case MZ2_GUNNER_MACHINEGUN_3:
523  case MZ2_GUNNER_MACHINEGUN_4:
524  case MZ2_GUNNER_MACHINEGUN_5:
525  case MZ2_GUNNER_MACHINEGUN_6:
526  case MZ2_GUNNER_MACHINEGUN_7:
527  case MZ2_GUNNER_MACHINEGUN_8:
528  DL_COLOR(1, 1, 0);
531  S_StartSound(NULL, mz.entity, CHAN_WEAPON, S_RegisterSound("gunner/gunatck2.wav"), 1, ATTN_NORM, 0);
532  break;
533 
534  case MZ2_ACTOR_MACHINEGUN_1:
535  case MZ2_SUPERTANK_MACHINEGUN_1:
536  case MZ2_SUPERTANK_MACHINEGUN_2:
537  case MZ2_SUPERTANK_MACHINEGUN_3:
538  case MZ2_SUPERTANK_MACHINEGUN_4:
539  case MZ2_SUPERTANK_MACHINEGUN_5:
540  case MZ2_SUPERTANK_MACHINEGUN_6:
541  case MZ2_TURRET_MACHINEGUN:
542  DL_COLOR(1, 1, 0);
545  S_StartSound(NULL, mz.entity, CHAN_WEAPON, S_RegisterSound("infantry/infatck1.wav"), 1, ATTN_NORM, 0);
546  break;
547 
548  case MZ2_BOSS2_MACHINEGUN_L1:
549  case MZ2_BOSS2_MACHINEGUN_L2:
550  case MZ2_BOSS2_MACHINEGUN_L3:
551  case MZ2_BOSS2_MACHINEGUN_L4:
552  case MZ2_BOSS2_MACHINEGUN_L5:
553  case MZ2_CARRIER_MACHINEGUN_L1:
554  case MZ2_CARRIER_MACHINEGUN_L2:
555  DL_COLOR(1, 1, 0);
558  S_StartSound(NULL, mz.entity, CHAN_WEAPON, S_RegisterSound("infantry/infatck1.wav"), 1, ATTN_NONE, 0);
559  break;
560 
561  case MZ2_SOLDIER_BLASTER_1:
562  case MZ2_SOLDIER_BLASTER_2:
563  case MZ2_SOLDIER_BLASTER_3:
564  case MZ2_SOLDIER_BLASTER_4:
565  case MZ2_SOLDIER_BLASTER_5:
566  case MZ2_SOLDIER_BLASTER_6:
567  case MZ2_SOLDIER_BLASTER_7:
568  case MZ2_SOLDIER_BLASTER_8:
569  case MZ2_TURRET_BLASTER:
570  DL_COLOR(1, 1, 0);
571  S_StartSound(NULL, mz.entity, CHAN_WEAPON, S_RegisterSound("soldier/solatck2.wav"), 1, ATTN_NORM, 0);
572  break;
573 
574  case MZ2_FLYER_BLASTER_1:
575  case MZ2_FLYER_BLASTER_2:
576  DL_COLOR(1, 1, 0);
577  S_StartSound(NULL, mz.entity, CHAN_WEAPON, S_RegisterSound("flyer/flyatck3.wav"), 1, ATTN_NORM, 0);
578  break;
579 
580  case MZ2_MEDIC_BLASTER_1:
581  DL_COLOR(1, 1, 0);
582  S_StartSound(NULL, mz.entity, CHAN_WEAPON, S_RegisterSound("medic/medatck1.wav"), 1, ATTN_NORM, 0);
583  break;
584 
585  case MZ2_HOVER_BLASTER_1:
586  DL_COLOR(1, 1, 0);
587  S_StartSound(NULL, mz.entity, CHAN_WEAPON, S_RegisterSound("hover/hovatck1.wav"), 1, ATTN_NORM, 0);
588  break;
589 
590  case MZ2_FLOAT_BLASTER_1:
591  DL_COLOR(1, 1, 0);
592  S_StartSound(NULL, mz.entity, CHAN_WEAPON, S_RegisterSound("floater/fltatck1.wav"), 1, ATTN_NORM, 0);
593  break;
594 
595  case MZ2_SOLDIER_SHOTGUN_1:
596  case MZ2_SOLDIER_SHOTGUN_2:
597  case MZ2_SOLDIER_SHOTGUN_3:
598  case MZ2_SOLDIER_SHOTGUN_4:
599  case MZ2_SOLDIER_SHOTGUN_5:
600  case MZ2_SOLDIER_SHOTGUN_6:
601  case MZ2_SOLDIER_SHOTGUN_7:
602  case MZ2_SOLDIER_SHOTGUN_8:
603  DL_COLOR(1, 1, 0);
605  S_StartSound(NULL, mz.entity, CHAN_WEAPON, S_RegisterSound("soldier/solatck1.wav"), 1, ATTN_NORM, 0);
606  break;
607 
608  case MZ2_TANK_BLASTER_1:
609  case MZ2_TANK_BLASTER_2:
610  case MZ2_TANK_BLASTER_3:
611  DL_COLOR(1, 1, 0);
612  S_StartSound(NULL, mz.entity, CHAN_WEAPON, S_RegisterSound("tank/tnkatck3.wav"), 1, ATTN_NORM, 0);
613  break;
614 
615  case MZ2_TANK_MACHINEGUN_1:
616  case MZ2_TANK_MACHINEGUN_2:
617  case MZ2_TANK_MACHINEGUN_3:
618  case MZ2_TANK_MACHINEGUN_4:
619  case MZ2_TANK_MACHINEGUN_5:
620  case MZ2_TANK_MACHINEGUN_6:
621  case MZ2_TANK_MACHINEGUN_7:
622  case MZ2_TANK_MACHINEGUN_8:
623  case MZ2_TANK_MACHINEGUN_9:
624  case MZ2_TANK_MACHINEGUN_10:
625  case MZ2_TANK_MACHINEGUN_11:
626  case MZ2_TANK_MACHINEGUN_12:
627  case MZ2_TANK_MACHINEGUN_13:
628  case MZ2_TANK_MACHINEGUN_14:
629  case MZ2_TANK_MACHINEGUN_15:
630  case MZ2_TANK_MACHINEGUN_16:
631  case MZ2_TANK_MACHINEGUN_17:
632  case MZ2_TANK_MACHINEGUN_18:
633  case MZ2_TANK_MACHINEGUN_19:
634  DL_COLOR(1, 1, 0);
637  Q_snprintf(soundname, sizeof(soundname), "tank/tnkatk2%c.wav", 'a' + rand() % 5);
638  S_StartSound(NULL, mz.entity, CHAN_WEAPON, S_RegisterSound(soundname), 1, ATTN_NORM, 0);
639  break;
640 
641  case MZ2_CHICK_ROCKET_1:
642  case MZ2_TURRET_ROCKET:
643  DL_COLOR(1, 0.5, 0.2);
644  S_StartSound(NULL, mz.entity, CHAN_WEAPON, S_RegisterSound("chick/chkatck2.wav"), 1, ATTN_NORM, 0);
645  break;
646 
647  case MZ2_TANK_ROCKET_1:
648  case MZ2_TANK_ROCKET_2:
649  case MZ2_TANK_ROCKET_3:
650  DL_COLOR(1, 0.5, 0.2);
651  S_StartSound(NULL, mz.entity, CHAN_WEAPON, S_RegisterSound("tank/tnkatck1.wav"), 1, ATTN_NORM, 0);
652  break;
653 
654  case MZ2_SUPERTANK_ROCKET_1:
655  case MZ2_SUPERTANK_ROCKET_2:
656  case MZ2_SUPERTANK_ROCKET_3:
657  case MZ2_BOSS2_ROCKET_1:
658  case MZ2_BOSS2_ROCKET_2:
659  case MZ2_BOSS2_ROCKET_3:
660  case MZ2_BOSS2_ROCKET_4:
661  case MZ2_CARRIER_ROCKET_1:
662 // case MZ2_CARRIER_ROCKET_2:
663 // case MZ2_CARRIER_ROCKET_3:
664 // case MZ2_CARRIER_ROCKET_4:
665  DL_COLOR(1, 0.5, 0.2);
666  S_StartSound(NULL, mz.entity, CHAN_WEAPON, S_RegisterSound("tank/rocket.wav"), 1, ATTN_NORM, 0);
667  break;
668 
669  case MZ2_GUNNER_GRENADE_1:
670  case MZ2_GUNNER_GRENADE_2:
671  case MZ2_GUNNER_GRENADE_3:
672  case MZ2_GUNNER_GRENADE_4:
673  DL_COLOR(1, 0.5, 0);
674  S_StartSound(NULL, mz.entity, CHAN_WEAPON, S_RegisterSound("gunner/gunatck3.wav"), 1, ATTN_NORM, 0);
675  break;
676 
677  case MZ2_GLADIATOR_RAILGUN_1:
678  case MZ2_CARRIER_RAILGUN:
679  case MZ2_WIDOW_RAIL:
680  DL_COLOR(0.5, 0.5, 1.0);
681  break;
682 
683  case MZ2_MAKRON_BFG:
684  DL_COLOR(0.5, 1, 0.5);
685  //S_StartSound (NULL, mz.entity, CHAN_WEAPON, S_RegisterSound("makron/bfg_firef.wav"), 1, ATTN_NORM, 0);
686  break;
687 
688  case MZ2_MAKRON_BLASTER_1:
689  case MZ2_MAKRON_BLASTER_2:
690  case MZ2_MAKRON_BLASTER_3:
691  case MZ2_MAKRON_BLASTER_4:
692  case MZ2_MAKRON_BLASTER_5:
693  case MZ2_MAKRON_BLASTER_6:
694  case MZ2_MAKRON_BLASTER_7:
695  case MZ2_MAKRON_BLASTER_8:
696  case MZ2_MAKRON_BLASTER_9:
697  case MZ2_MAKRON_BLASTER_10:
698  case MZ2_MAKRON_BLASTER_11:
699  case MZ2_MAKRON_BLASTER_12:
700  case MZ2_MAKRON_BLASTER_13:
701  case MZ2_MAKRON_BLASTER_14:
702  case MZ2_MAKRON_BLASTER_15:
703  case MZ2_MAKRON_BLASTER_16:
704  case MZ2_MAKRON_BLASTER_17:
705  DL_COLOR(1, 1, 0);
706  S_StartSound(NULL, mz.entity, CHAN_WEAPON, S_RegisterSound("makron/blaster.wav"), 1, ATTN_NORM, 0);
707  break;
708 
709  case MZ2_JORG_MACHINEGUN_L1:
710  case MZ2_JORG_MACHINEGUN_L2:
711  case MZ2_JORG_MACHINEGUN_L3:
712  case MZ2_JORG_MACHINEGUN_L4:
713  case MZ2_JORG_MACHINEGUN_L5:
714  case MZ2_JORG_MACHINEGUN_L6:
715  DL_COLOR(1, 1, 0);
718  S_StartSound(NULL, mz.entity, CHAN_WEAPON, S_RegisterSound("boss3/xfiref.wav"), 1, ATTN_NORM, 0);
719  break;
720 
721  case MZ2_JORG_MACHINEGUN_R1:
722  case MZ2_JORG_MACHINEGUN_R2:
723  case MZ2_JORG_MACHINEGUN_R3:
724  case MZ2_JORG_MACHINEGUN_R4:
725  case MZ2_JORG_MACHINEGUN_R5:
726  case MZ2_JORG_MACHINEGUN_R6:
727  DL_COLOR(1, 1, 0);
730  break;
731 
732  case MZ2_JORG_BFG_1:
733  DL_COLOR(0.5, 1, 0.5);
734  break;
735 
736  case MZ2_BOSS2_MACHINEGUN_R1:
737  case MZ2_BOSS2_MACHINEGUN_R2:
738  case MZ2_BOSS2_MACHINEGUN_R3:
739  case MZ2_BOSS2_MACHINEGUN_R4:
740  case MZ2_BOSS2_MACHINEGUN_R5:
741  case MZ2_CARRIER_MACHINEGUN_R1:
742  case MZ2_CARRIER_MACHINEGUN_R2:
743  DL_COLOR(1, 1, 0);
746  break;
747 
748  case MZ2_STALKER_BLASTER:
749  case MZ2_DAEDALUS_BLASTER:
750  case MZ2_MEDIC_BLASTER_2:
751  case MZ2_WIDOW_BLASTER:
752  case MZ2_WIDOW_BLASTER_SWEEP1:
753  case MZ2_WIDOW_BLASTER_SWEEP2:
754  case MZ2_WIDOW_BLASTER_SWEEP3:
755  case MZ2_WIDOW_BLASTER_SWEEP4:
756  case MZ2_WIDOW_BLASTER_SWEEP5:
757  case MZ2_WIDOW_BLASTER_SWEEP6:
758  case MZ2_WIDOW_BLASTER_SWEEP7:
759  case MZ2_WIDOW_BLASTER_SWEEP8:
760  case MZ2_WIDOW_BLASTER_SWEEP9:
761  case MZ2_WIDOW_BLASTER_100:
762  case MZ2_WIDOW_BLASTER_90:
763  case MZ2_WIDOW_BLASTER_80:
764  case MZ2_WIDOW_BLASTER_70:
765  case MZ2_WIDOW_BLASTER_60:
766  case MZ2_WIDOW_BLASTER_50:
767  case MZ2_WIDOW_BLASTER_40:
768  case MZ2_WIDOW_BLASTER_30:
769  case MZ2_WIDOW_BLASTER_20:
770  case MZ2_WIDOW_BLASTER_10:
771  case MZ2_WIDOW_BLASTER_0:
772  case MZ2_WIDOW_BLASTER_10L:
773  case MZ2_WIDOW_BLASTER_20L:
774  case MZ2_WIDOW_BLASTER_30L:
775  case MZ2_WIDOW_BLASTER_40L:
776  case MZ2_WIDOW_BLASTER_50L:
777  case MZ2_WIDOW_BLASTER_60L:
778  case MZ2_WIDOW_BLASTER_70L:
779  case MZ2_WIDOW_RUN_1:
780  case MZ2_WIDOW_RUN_2:
781  case MZ2_WIDOW_RUN_3:
782  case MZ2_WIDOW_RUN_4:
783  case MZ2_WIDOW_RUN_5:
784  case MZ2_WIDOW_RUN_6:
785  case MZ2_WIDOW_RUN_7:
786  case MZ2_WIDOW_RUN_8:
787  DL_COLOR(0, 1, 0);
788  S_StartSound(NULL, mz.entity, CHAN_WEAPON, S_RegisterSound("tank/tnkatck3.wav"), 1, ATTN_NORM, 0);
789  break;
790 
791  case MZ2_WIDOW_DISRUPTOR:
792  DL_COLOR(-1, -1, -1);
793  S_StartSound(NULL, mz.entity, CHAN_WEAPON, S_RegisterSound("weapons/disint2.wav"), 1, ATTN_NORM, 0);
794  break;
795 
796  case MZ2_WIDOW_PLASMABEAM:
797  case MZ2_WIDOW2_BEAMER_1:
798  case MZ2_WIDOW2_BEAMER_2:
799  case MZ2_WIDOW2_BEAMER_3:
800  case MZ2_WIDOW2_BEAMER_4:
801  case MZ2_WIDOW2_BEAMER_5:
802  case MZ2_WIDOW2_BEAM_SWEEP_1:
803  case MZ2_WIDOW2_BEAM_SWEEP_2:
804  case MZ2_WIDOW2_BEAM_SWEEP_3:
805  case MZ2_WIDOW2_BEAM_SWEEP_4:
806  case MZ2_WIDOW2_BEAM_SWEEP_5:
807  case MZ2_WIDOW2_BEAM_SWEEP_6:
808  case MZ2_WIDOW2_BEAM_SWEEP_7:
809  case MZ2_WIDOW2_BEAM_SWEEP_8:
810  case MZ2_WIDOW2_BEAM_SWEEP_9:
811  case MZ2_WIDOW2_BEAM_SWEEP_10:
812  case MZ2_WIDOW2_BEAM_SWEEP_11:
813  DL_RADIUS(300 + (rand() & 100));
814  DL_COLOR(1, 1, 0);
815  DL_DIE(200);
816  break;
817  }
818 }

Referenced by CL_ParseServerMessage().

◆ CL_Nukeblast()

void CL_Nukeblast ( cl_sustain_t self)

Definition at line 551 of file newfx.c.

552 {
553  static const byte colortable[4] = {110, 112, 114, 116};
554  vec3_t dir;
555  int i;
556  cparticle_t *p;
557  float ratio;
558 
559  ratio = 1.0 - (((float)self->endtime - (float)cl.time) / 1000.0);
560 
561  for (i = 0; i < 700; i++) {
562  p = CL_AllocParticle();
563  if (!p)
564  return;
565  VectorClear(p->accel);
566 
567  p->time = cl.time;
568 
569  p->alpha = 1.0;
571  p->color = colortable[rand() & 3];
572 
573  dir[0] = crand();
574  dir[1] = crand();
575  dir[2] = crand();
576  VectorNormalize(dir);
577 
578  VectorMA(self->org, (200.0 * ratio), dir, p->org);
579  }
580 }

Referenced by CL_ParseNuke().

◆ CL_OldRailTrail()

void CL_OldRailTrail ( void  )

Definition at line 1632 of file effects.c.

1633 {
1634  vec3_t move;
1635  vec3_t vec;
1636  float len;
1637  int j;
1638  cparticle_t *p;
1639  float dec;
1640  vec3_t right, up;
1641  int i;
1642  float d, c, s;
1643  vec3_t dir;
1644  byte clr = 0x74;
1645 
1646  VectorCopy(te.pos1, move);
1647  VectorSubtract(te.pos2, te.pos1, vec);
1648  len = VectorNormalize(vec);
1649 
1650  MakeNormalVectors(vec, right, up);
1651 
1652  for (i = 0; i < len; i++) {
1653  p = CL_AllocParticle();
1654  if (!p)
1655  return;
1656 
1657  p->time = cl.time;
1658  VectorClear(p->accel);
1659 
1660  d = i * 0.1;
1661  c = cos(d);
1662  s = sin(d);
1663 
1664  VectorScale(right, c, dir);
1665  VectorMA(dir, s, up, dir);
1666 
1667  p->alpha = 1.0;
1668  p->alphavel = -1.0 / (1 + frand() * 0.2);
1669 
1670  p->color = clr + (rand() & 7);
1672 
1673  for (j = 0; j < 3; j++) {
1674  p->org[j] = move[j] + dir[j] * 3;
1675  p->vel[j] = dir[j] * 6;
1676  }
1677 
1678  VectorAdd(move, vec, move);
1679  }
1680 
1681  dec = 0.75;
1682  VectorScale(vec, dec, vec);
1683  VectorCopy(te.pos1, move);
1684 
1685  while (len > 0) {
1686  len -= dec;
1687 
1688  p = CL_AllocParticle();
1689  if (!p)
1690  return;
1691 
1692  p->time = cl.time;
1693  VectorClear(p->accel);
1694 
1695  p->alpha = 1.0;
1696  p->alphavel = -1.0 / (0.6 + frand() * 0.2);
1697 
1698  p->color = rand() & 15;
1699  p->brightness = 1.0f;
1700 
1701  for (j = 0; j < 3; j++) {
1702  p->org[j] = move[j] + crand() * 3;
1703  p->vel[j] = crand() * 3;
1704  p->accel[j] = 0;
1705  }
1706 
1707  VectorAdd(move, vec, move);
1708  }
1709 }

Referenced by CL_RailTrail().

◆ CL_ParsePlayerSkin()

void CL_ParsePlayerSkin ( char *  name,
char *  model,
char *  skin,
const char *  s 
)

Definition at line 35 of file precache.c.

36 {
37  size_t len;
38  char *t;
39 
40  // configstring parsing guarantees that playerskins can never
41  // overflow, but still check the length to be entirely fool-proof
42  len = strlen(s);
43  if (len >= MAX_QPATH) {
44  Com_Error(ERR_DROP, "%s: oversize playerskin", __func__);
45  }
46 
47  // isolate the player's name
48  t = strchr(s, '\\');
49  if (t) {
50  len = t - s;
51  strcpy(model, t + 1);
52  } else {
53  len = 0;
54  strcpy(model, s);
55  }
56 
57  // copy the player's name
58  if (name) {
59  memcpy(name, s, len);
60  name[len] = 0;
61  }
62 
63  // isolate the model name
64  t = strchr(model, '/');
65  if (!t)
66  t = strchr(model, '\\');
67  if (!t)
68  goto default_model;
69  *t = 0;
70 
71  // isolate the skin name
72  strcpy(skin, t + 1);
73 
74  // fix empty model to male
75  if (t == model)
76  strcpy(model, "male");
77 
78  // apply restrictions on skins
79  if (cl_noskins->integer == 2 || !COM_IsPath(skin))
80  goto default_skin;
81 
82  if (cl_noskins->integer || !COM_IsPath(model))
83  goto default_model;
84 
85  return;
86 
87 default_skin:
88  if (!Q_stricmp(model, "female")) {
89  strcpy(model, "female");
90  strcpy(skin, "athena");
91  } else {
92 default_model:
93  strcpy(model, "male");
94  strcpy(skin, "grunt");
95  }
96 }

Referenced by check_player(), and CL_LoadClientinfo().

◆ CL_ParseServerMessage()

void CL_ParseServerMessage ( void  )

Definition at line 1168 of file parse.c.

1169 {
1170  int cmd, extrabits;
1171  size_t readcount;
1172  int index, bits;
1173 
1174 #ifdef _DEBUG
1175  if (cl_shownet->integer == 1) {
1176  Com_LPrintf(PRINT_DEVELOPER, "%"PRIz" ", msg_read.cursize);
1177  } else if (cl_shownet->integer > 1) {
1178  Com_LPrintf(PRINT_DEVELOPER, "------------------\n");
1179  }
1180 #endif
1181 
1182 //
1183 // parse the message
1184 //
1185  while (1) {
1186  if (msg_read.readcount > msg_read.cursize) {
1187  Com_Error(ERR_DROP, "%s: read past end of server message", __func__);
1188  }
1189 
1190  readcount = msg_read.readcount;
1191 
1192  if ((cmd = MSG_ReadByte()) == -1) {
1193  SHOWNET(1, "%3"PRIz":END OF MESSAGE\n", msg_read.readcount - 1);
1194  break;
1195  }
1196 
1197  extrabits = cmd >> SVCMD_BITS;
1198  cmd &= SVCMD_MASK;
1199 
1200 #ifdef _DEBUG
1201  if (cl_shownet->integer > 1) {
1202  MSG_ShowSVC(cmd);
1203  }
1204 #endif
1205 
1206  // other commands
1207  switch (cmd) {
1208  default:
1209 badbyte:
1210  Com_Error(ERR_DROP, "%s: illegible server message: %d", __func__, cmd);
1211  break;
1212 
1213  case svc_nop:
1214  break;
1215 
1216  case svc_disconnect:
1217  Com_Error(ERR_DISCONNECT, "Server disconnected");
1218  break;
1219 
1220  case svc_reconnect:
1222  return;
1223 
1224  case svc_print:
1225  CL_ParsePrint();
1226  break;
1227 
1228  case svc_centerprint:
1230  break;
1231 
1232  case svc_stufftext:
1234  break;
1235 
1236  case svc_serverdata:
1238  continue;
1239 
1240  case svc_configstring:
1241  index = MSG_ReadShort();
1242  CL_ParseConfigstring(index);
1243  break;
1244 
1245  case svc_sound:
1248  break;
1249 
1250  case svc_spawnbaseline:
1251  index = MSG_ParseEntityBits(&bits);
1252  CL_ParseBaseline(index, bits);
1253  break;
1254 
1255  case svc_temp_entity:
1257  CL_ParseTEnt();
1258  break;
1259 
1260  case svc_muzzleflash:
1261  CL_ParseMuzzleFlashPacket(MZ_SILENCED);
1262  CL_MuzzleFlash();
1263  break;
1264 
1265  case svc_muzzleflash2:
1267  CL_MuzzleFlash2();
1268  break;
1269 
1270  case svc_download:
1271  CL_ParseDownload(cmd);
1272  continue;
1273 
1274  case svc_frame:
1275  CL_ParseFrame(extrabits);
1276  continue;
1277 
1278  case svc_inventory:
1280  break;
1281 
1282  case svc_layout:
1283  CL_ParseLayout();
1284  break;
1285 
1286  case svc_zpacket:
1287  if (cls.serverProtocol < PROTOCOL_VERSION_R1Q2) {
1288  goto badbyte;
1289  }
1290  CL_ParseZPacket();
1291  continue;
1292 
1293  case svc_zdownload:
1294  if (cls.serverProtocol < PROTOCOL_VERSION_R1Q2) {
1295  goto badbyte;
1296  }
1297  CL_ParseDownload(cmd);
1298  continue;
1299 
1300  case svc_gamestate:
1301  if (cls.serverProtocol != PROTOCOL_VERSION_Q2PRO) {
1302  goto badbyte;
1303  }
1305  continue;
1306 
1307  case svc_setting:
1308  if (cls.serverProtocol < PROTOCOL_VERSION_R1Q2) {
1309  goto badbyte;
1310  }
1311  CL_ParseSetting();
1312  continue;
1313  }
1314 
1315  // if recording demos, copy off protocol invariant stuff
1316  if (cls.demo.recording && !cls.demo.paused) {
1317  size_t len = msg_read.readcount - readcount;
1318 
1319  // it is very easy to overflow standard 1390 bytes
1320  // demo frame with modern servers... attempt to preserve
1321  // reliable messages at least, assuming they come first
1322  if (cls.demo.buffer.cursize + len < cls.demo.buffer.maxsize) {
1323  SZ_Write(&cls.demo.buffer, msg_read.data + readcount, len);
1324  } else {
1326  }
1327  }
1328 
1329  // if running GTV server, add current message
1330  CL_GTV_WriteMessage(msg_read.data + readcount,
1331  msg_read.readcount - readcount);
1332  }
1333 }

Referenced by CL_PacketEvent(), CL_ParseZPacket(), CL_PlayDemo_f(), and parse_next_message().

◆ CL_ParseTEnt()

void CL_ParseTEnt ( void  )

Definition at line 1069 of file tent.c.

1070 {
1071  explosion_t *ex;
1072  int r;
1073 
1074  switch (te.type) {
1075  case TE_BLOOD: // bullet hitting flesh
1076  if (!(cl_disable_particles->integer & NOPART_BLOOD))
1077  {
1078  // CL_ParticleEffect(te.pos1, te.dir, 0xe8, 60);
1079  CL_BloodParticleEffect(te.pos1, te.dir, 0xe8, 1000);
1080  }
1081  break;
1082 
1083  case TE_GUNSHOT: // bullet hitting wall
1084  case TE_SPARKS:
1085  case TE_BULLET_SPARKS:
1086  if (te.type == TE_GUNSHOT)
1087  CL_ParticleEffect(te.pos1, te.dir, 0, 40);
1088  else
1089  CL_ParticleEffect(te.pos1, te.dir, 0xe0, 6);
1090 
1091  if (te.type != TE_SPARKS) {
1093 
1094  // impact sound
1095  r = rand() & 15;
1096  if (r == 1)
1097  S_StartSound(te.pos1, 0, 0, cl_sfx_ric1, 1, ATTN_NORM, 0);
1098  else if (r == 2)
1099  S_StartSound(te.pos1, 0, 0, cl_sfx_ric2, 1, ATTN_NORM, 0);
1100  else if (r == 3)
1101  S_StartSound(te.pos1, 0, 0, cl_sfx_ric3, 1, ATTN_NORM, 0);
1102  }
1103  break;
1104 
1105  case TE_SCREEN_SPARKS:
1106  case TE_SHIELD_SPARKS:
1107  if (te.type == TE_SCREEN_SPARKS)
1108  CL_ParticleEffect(te.pos1, te.dir, 0xd0, 40);
1109  else
1110  CL_ParticleEffect(te.pos1, te.dir, 0xb0, 40);
1111  //FIXME : replace or remove this sound
1112  S_StartSound(te.pos1, 0, 0, cl_sfx_lashit, 1, ATTN_NORM, 0);
1113  break;
1114 
1115  case TE_SHOTGUN: // bullet hitting wall
1116  CL_ParticleEffect(te.pos1, te.dir, 0, 20);
1118  break;
1119 
1120  case TE_SPLASH: // bullet hitting water
1121  if (te.color < 0 || te.color > 6)
1122  r = 0x00;
1123  else
1124  r = splash_color[te.color];
1126 
1127  if (te.color == SPLASH_SPARKS) {
1128  r = rand() & 3;
1129  if (r == 0)
1130  S_StartSound(te.pos1, 0, 0, cl_sfx_spark5, 1, ATTN_STATIC, 0);
1131  else if (r == 1)
1132  S_StartSound(te.pos1, 0, 0, cl_sfx_spark6, 1, ATTN_STATIC, 0);
1133  else
1134  S_StartSound(te.pos1, 0, 0, cl_sfx_spark7, 1, ATTN_STATIC, 0);
1135  }
1136  break;
1137 
1138  case TE_LASER_SPARKS:
1140  break;
1141 
1142  case TE_BLUEHYPERBLASTER:
1144  break;
1145 
1146  case TE_BLASTER: // blaster hitting wall
1147  case TE_BLASTER2: // green blaster hitting wall
1148  case TE_FLECHETTE: // flechette
1149  case TE_FLARE: // flare
1150  ex = CL_AllocExplosion();
1151  VectorCopy(te.pos1, ex->ent.origin);
1152  dirtoangles(ex->ent.angles);
1153  ex->type = ex_blaster;
1154  ex->ent.flags = RF_FULLBRIGHT | RF_TRANSLUCENT;
1155  ex->ent.tent_type = te.type;
1156  switch (te.type) {
1157  case TE_BLASTER:
1159  ex->lightcolor[0] = 1;
1160  ex->lightcolor[1] = 1;
1161  break;
1162  case TE_BLASTER2:
1163  CL_BlasterParticles2(te.pos1, te.dir, 0xd0);
1164  ex->ent.skinnum = 1;
1165  ex->lightcolor[1] = 1;
1166  break;
1167  case TE_FLECHETTE:
1168  CL_BlasterParticles2(te.pos1, te.dir, 0x6f); // 75
1169  ex->ent.skinnum = 2;
1170  ex->lightcolor[0] = 0.19;
1171  ex->lightcolor[1] = 0.41;
1172  ex->lightcolor[2] = 0.75;
1173  break;
1174  case TE_FLARE:
1175  CL_BlasterParticles2(te.pos1, te.dir, 0xd0);
1176  ex->lightcolor[0] = 1;
1177  ex->lightcolor[1] = 1;
1178  ex->type = ex_flare;
1179  break;
1180  }
1181  ex->start = cl.servertime - CL_FRAMETIME;
1182  ex->light = 150;
1183  ex->ent.model = cl_mod_explode;
1184  ex->frames = 4;
1185 
1186  if (te.type != TE_FLARE)
1187  {
1188  S_StartSound(te.pos1, 0, 0, cl_sfx_lashit, 1, ATTN_NORM, 0);
1189  }
1190  else
1191  {
1192  // te.count is set to 1 on the first tick of the flare, 0 afterwards
1193  if (te.count!=0)
1194  S_StartSound(NULL, te.entity1, 0, cl_sfx_flare, 0.5, ATTN_NORM, 0);
1195  }
1196  break;
1197 
1198  case TE_RAILTRAIL: // railgun effect
1199  CL_RailTrail();
1200  S_StartSound(te.pos2, 0, 0, cl_sfx_railg, 1, ATTN_NORM, 0);
1201  break;
1202 
1203  case TE_GRENADE_EXPLOSION:
1204  case TE_GRENADE_EXPLOSION_WATER:
1205  ex = CL_PlainExplosion(qfalse);
1206  if (!cl_explosion_sprites->integer)
1207  {
1208  ex->frames = 19;
1209  ex->baseframe = 30;
1210  }
1211  if (cl_disable_explosions->integer & NOEXP_GRENADE)
1212  ex->type = ex_light;
1213 
1216 
1217  if (te.type == TE_GRENADE_EXPLOSION_WATER)
1218  S_StartSound(te.pos1, 0, 0, cl_sfx_watrexp, 1, ATTN_NORM, 0);
1219  else
1220  S_StartSound(te.pos1, 0, 0, cl_sfx_grenexp, 1, ATTN_NORM, 0);
1221  break;
1222 
1223  case TE_EXPLOSION2:
1224  ex = CL_PlainExplosion(qfalse);
1225  if (!cl_explosion_sprites->integer)
1226  {
1227  ex->frames = 19;
1228  ex->baseframe = 30;
1229  }
1231  S_StartSound(te.pos1, 0, 0, cl_sfx_grenexp, 1, ATTN_NORM, 0);
1232  break;
1233 
1234  case TE_PLASMA_EXPLOSION:
1235  CL_PlainExplosion(qfalse);
1237  S_StartSound(te.pos1, 0, 0, cl_sfx_rockexp, 1, ATTN_NORM, 0);
1238  break;
1239 
1240  case TE_ROCKET_EXPLOSION:
1241  case TE_ROCKET_EXPLOSION_WATER:
1242  ex = CL_PlainExplosion(qfalse);
1243  if (cl_disable_explosions->integer & NOEXP_ROCKET)
1244  ex->type = ex_light;
1245 
1248 
1249  if (te.type == TE_ROCKET_EXPLOSION_WATER)
1250  S_StartSound(te.pos1, 0, 0, cl_sfx_watrexp, 1, ATTN_NORM, 0);
1251  else
1252  S_StartSound(te.pos1, 0, 0, cl_sfx_rockexp, 1, ATTN_NORM, 0);
1253  break;
1254 
1255  case TE_EXPLOSION1:
1256  CL_PlainExplosion(qfalse);
1258  S_StartSound(te.pos1, 0, 0, cl_sfx_rockexp, 1, ATTN_NORM, 0);
1259  break;
1260 
1261  case TE_EXPLOSION1_NP:
1262  CL_PlainExplosion(qfalse);
1263  S_StartSound(te.pos1, 0, 0, cl_sfx_rockexp, 1, ATTN_NORM, 0);
1264  break;
1265 
1266  case TE_EXPLOSION1_BIG:
1267  ex = CL_PlainExplosion(qtrue);
1268  S_StartSound(te.pos1, 0, 0, cl_sfx_rockexp, 1, ATTN_NORM, 0);
1269  break;
1270 
1271  case TE_BFG_EXPLOSION:
1272  ex = CL_AllocExplosion();
1273  VectorCopy(te.pos1, ex->ent.origin);
1274  ex->type = ex_poly;
1275  ex->ent.flags = RF_FULLBRIGHT;
1276  ex->start = cl.servertime - CL_FRAMETIME;
1277  ex->light = 350;
1278  ex->lightcolor[0] = 0.0;
1279  ex->lightcolor[1] = 1.0;
1280  ex->lightcolor[2] = 0.0;
1281  ex->ent.model = cl_mod_bfg_explo;
1282  ex->ent.flags |= RF_TRANSLUCENT;
1283  ex->ent.alpha = 0.80;
1284  ex->frames = 4;
1285  break;
1286 
1287  case TE_BFG_BIGEXPLOSION:
1289  break;
1290 
1291  case TE_BFG_LASER:
1292  CL_ParseLaser(0xd0d1d2d3);
1293  break;
1294 
1295  case TE_BUBBLETRAIL:
1297  break;
1298 
1299  case TE_PARASITE_ATTACK:
1300  case TE_MEDIC_CABLE_ATTACK:
1301  VectorClear(te.offset);
1302  te.entity2 = 0;
1304  break;
1305 
1306  case TE_BOSSTPORT: // boss teleporting to station
1308  S_StartSound(te.pos1, 0, 0, S_RegisterSound("misc/bigtele.wav"), 1, ATTN_NONE, 0);
1309  break;
1310 
1311  case TE_GRAPPLE_CABLE:
1312  te.entity2 = 0;
1314  break;
1315 
1316  case TE_WELDING_SPARKS:
1318 
1319  ex = CL_AllocExplosion();
1320  VectorCopy(te.pos1, ex->ent.origin);
1321  ex->type = ex_flash;
1322  // note to self
1323  // we need a better no draw flag
1324  ex->ent.flags = RF_BEAM;
1325  ex->start = cl.servertime - CL_FRAMETIME;
1326  ex->light = 100 + (rand() % 75);
1327  ex->lightcolor[0] = 1.0;
1328  ex->lightcolor[1] = 1.0;
1329  ex->lightcolor[2] = 0.3;
1330  ex->ent.model = cl_mod_flash;
1331  ex->frames = 2;
1332  break;
1333 
1334  case TE_GREENBLOOD:
1335  CL_ParticleEffect2(te.pos1, te.dir, 0xdf, 30);
1336  break;
1337 
1338  case TE_TUNNEL_SPARKS:
1340  break;
1341 
1342  case TE_LIGHTNING:
1343  S_StartSound(NULL, te.entity1, CHAN_WEAPON, cl_sfx_lightning, 1, ATTN_NORM, 0);
1344  VectorClear(te.offset);
1346  break;
1347 
1348  case TE_DEBUGTRAIL:
1350  break;
1351 
1352  case TE_PLAIN_EXPLOSION:
1353  CL_PlainExplosion(qfalse);
1354  break;
1355 
1356  case TE_FLASHLIGHT:
1357 #if USE_DLIGHTS
1358  CL_Flashlight(te.entity1, te.pos1);
1359 #endif
1360  break;
1361 
1362  case TE_FORCEWALL:
1364  break;
1365 
1366  case TE_HEATBEAM:
1367  VectorSet(te.offset, 2, 7, -3);
1369  break;
1370 
1371  case TE_MONSTER_HEATBEAM:
1372  VectorClear(te.offset);
1374  break;
1375 
1376  case TE_HEATBEAM_SPARKS:
1377  CL_ParticleSteamEffect(te.pos1, te.dir, 0x8, 50, 60);
1378  S_StartSound(te.pos1, 0, 0, cl_sfx_lashit, 1, ATTN_NORM, 0);
1379  break;
1380 
1381  case TE_HEATBEAM_STEAM:
1382  CL_ParticleSteamEffect(te.pos1, te.dir, 0xE0, 20, 60);
1383  S_StartSound(te.pos1, 0, 0, cl_sfx_lashit, 1, ATTN_NORM, 0);
1384  break;
1385 
1386  case TE_STEAM:
1387  CL_ParseSteam();
1388  break;
1389 
1390  case TE_BUBBLETRAIL2:
1391  CL_BubbleTrail2(te.pos1, te.pos2, 8);
1392  S_StartSound(te.pos1, 0, 0, cl_sfx_lashit, 1, ATTN_NORM, 0);
1393  break;
1394 
1395  case TE_MOREBLOOD:
1396  CL_ParticleEffect(te.pos1, te.dir, 0xe8, 250);
1397  break;
1398 
1399  case TE_CHAINFIST_SMOKE:
1400  VectorSet(te.dir, 0, 0, 1);
1401  CL_ParticleSmokeEffect(te.pos1, te.dir, 0, 20, 20);
1402  break;
1403 
1404  case TE_ELECTRIC_SPARKS:
1405  CL_ParticleEffect(te.pos1, te.dir, 0x75, 40);
1406  //FIXME : replace or remove this sound
1407  S_StartSound(te.pos1, 0, 0, cl_sfx_lashit, 1, ATTN_NORM, 0);
1408  break;
1409 
1410  case TE_TRACKER_EXPLOSION:
1411 #if USE_DLIGHTS
1412  CL_ColorFlash(te.pos1, 0, 150, -1, -1, -1);
1413 #endif
1415  S_StartSound(te.pos1, 0, 0, cl_sfx_disrexp, 1, ATTN_NORM, 0);
1416  break;
1417 
1418  case TE_TELEPORT_EFFECT:
1419  case TE_DBALL_GOAL:
1421  break;
1422 
1423  case TE_WIDOWBEAMOUT:
1424  CL_ParseWidow();
1425  break;
1426 
1427  case TE_NUKEBLAST:
1428  CL_ParseNuke();
1429  break;
1430 
1431  case TE_WIDOWSPLASH:
1432  CL_WidowSplash();
1433  break;
1434 
1435  default:
1436  Com_Error(ERR_DROP, "%s: bad type", __func__);
1437  }
1438 }

Referenced by CL_ParseServerMessage().

◆ CL_ParticleEffect()

void CL_ParticleEffect ( vec3_t  org,
vec3_t  dir,
int  color,
int  count 
)

Definition at line 877 of file effects.c.

878 {
879  vec3_t oy;
880  VectorSet(oy, 0.0f, 1.0f, 0.0f);
881  if (fabs(DotProduct(oy, dir)) > 0.95f)
882  VectorSet(oy, 1.0f, 0.0f, 0.0f);
883 
884  vec3_t ox;
885  CrossProduct(oy, dir, ox);
886 
887  count *= cl_particle_num_factor->value;
888  const int spark_count = count / 10;
889 
890  const float dirt_horizontal_spread = 2.0f;
891  const float dirt_vertical_spread = 1.0f;
892  const float dirt_base_velocity = 40.0f;
893  const float dirt_rand_velocity = 70.0f;
894 
895  const float spark_horizontal_spread = 1.0f;
896  const float spark_vertical_spread = 1.0f;
897  const float spark_base_velocity = 50.0f;
898  const float spark_rand_velocity = 130.0f;
899 
900  for (int i = 0; i < count; i++) {
902  if (!p)
903  return;
904 
905  p->time = cl.time;
906 
907  p->color = color + (rand() & 7);
908  p->brightness = 0.5f;
909 
910  vec3_t origin;
911  VectorCopy(org, origin);
912  VectorMA(origin, dirt_horizontal_spread * crand(), ox, origin);
913  VectorMA(origin, dirt_horizontal_spread * crand(), oy, origin);
914  VectorMA(origin, dirt_vertical_spread * frand() + 1.0f, dir, origin);
915  VectorCopy(origin, p->org);
916 
917  vec3_t velocity;
918  VectorSubtract(origin, org, velocity);
919  VectorNormalize(velocity);
920  VectorScale(velocity, dirt_base_velocity + frand() * dirt_rand_velocity, p->vel);
921 
922  p->accel[0] = p->accel[1] = 0;
923  p->accel[2] = -PARTICLE_GRAVITY;
924  p->alpha = 1.0;
925 
926  p->alphavel = -1.0 / (0.5 + frand() * 0.3);
927  }
928 
929  for (int i = 0; i < spark_count; i++) {
931  if (!p)
932  return;
933 
934  p->time = cl.time;
935 
936  p->color = 0xe0 + (rand() & 7);
938 
939  vec3_t origin;
940  VectorCopy(org, origin);
941  VectorMA(origin, spark_horizontal_spread * crand(), ox, origin);
942  VectorMA(origin, spark_horizontal_spread * crand(), oy, origin);
943  VectorMA(origin, spark_vertical_spread * frand() + 1.0f, dir, origin);
944  VectorCopy(origin, p->org);
945 
946  vec3_t velocity;
947  VectorSubtract(origin, org, velocity);
948  VectorNormalize(velocity);
949  VectorScale(velocity, spark_base_velocity + powf(frand(), 2.0f) * spark_rand_velocity, p->vel);
950 
951  p->accel[0] = p->accel[1] = 0;
952  p->accel[2] = -PARTICLE_GRAVITY;
953  p->alpha = 1.0;
954 
955  p->alphavel = -2.0 / (0.5 + frand() * 0.3);
956  }
957 }

Referenced by CL_MuzzleFlash2(), and CL_ParseTEnt().

◆ CL_ParticleEffect2()

void CL_ParticleEffect2 ( vec3_t  org,
vec3_t  dir,
int  color,
int  count 
)

Definition at line 1060 of file effects.c.

1061 {
1062  int i, j;
1063  cparticle_t *p;
1064  float d;
1065 
1066  count *= cl_particle_num_factor->value;
1067 
1068  for (i = 0; i < count; i++) {
1069  p = CL_AllocParticle();
1070  if (!p)
1071  return;
1072 
1073  p->time = cl.time;
1074 
1075  p->color = color;
1076  p->brightness = 1.0f;
1077 
1078  d = rand() & 7;
1079  for (j = 0; j < 3; j++) {
1080  p->org[j] = org[j] + ((rand() & 7) - 4) + d * dir[j];
1081  p->vel[j] = crand() * 20;
1082  }
1083 
1084  p->accel[0] = p->accel[1] = 0;
1085  p->accel[2] = -PARTICLE_GRAVITY;
1086  p->alpha = 1.0;
1087 
1088  p->alphavel = -1.0 / (0.5 + frand() * 0.3);
1089  }
1090 }

Referenced by CL_ParseTEnt().

◆ CL_ParticleEffect3()

void CL_ParticleEffect3 ( vec3_t  org,
vec3_t  dir,
int  color,
int  count 
)

Definition at line 989 of file newfx.c.

990 {
991  int i, j;
992  cparticle_t *p;
993  float d;
994 
995  for (i = 0; i < count; i++) {
996  p = CL_AllocParticle();
997  if (!p)
998  return;
999 
1000  p->time = cl.time;
1001  p->color = color;
1002 
1003  d = rand() & 7;
1004  for (j = 0; j < 3; j++) {
1005  p->org[j] = org[j] + ((rand() & 7) - 4) + d * dir[j];
1006  p->vel[j] = crand() * 20;
1007  }
1008 
1009  p->accel[0] = p->accel[1] = 0;
1010  p->accel[2] = PARTICLE_GRAVITY;
1011  p->alpha = 1.0;
1012 
1013  p->alphavel = -1.0 / (0.5 + frand() * 0.3);
1014  }
1015 }

Referenced by CL_ParseTEnt().

◆ CL_ParticleEffectWaterSplash()

void CL_ParticleEffectWaterSplash ( vec3_t  org,
vec3_t  dir,
int  color,
int  count 
)

Definition at line 959 of file effects.c.

960 {
961  vec3_t oy;
962  VectorSet(oy, 0.0f, 1.0f, 0.0f);
963  if (fabs(DotProduct(oy, dir)) > 0.95f)
964  VectorSet(oy, 1.0f, 0.0f, 0.0f);
965 
966  vec3_t ox;
967  CrossProduct(oy, dir, ox);
968 
969  count *= cl_particle_num_factor->value;
970 
971  const float water_horizontal_spread = 0.25f;
972  const float water_vertical_spread = 1.0f;
973  const float water_base_velocity = 80.0f;
974  const float water_rand_velocity = 150.0f;
975 
976  for (int i = 0; i < count; i++) {
978  if (!p)
979  return;
980 
981  p->time = cl.time;
982 
983  p->color = color + (rand() & 7);
984  p->brightness = 1.0f;
985 
986  vec3_t origin;
987  VectorCopy(org, origin);
988  VectorMA(origin, water_horizontal_spread * crand(), ox, origin);
989  VectorMA(origin, water_horizontal_spread * crand(), oy, origin);
990  VectorMA(origin, water_vertical_spread * frand() + 1.0f, dir, origin);
991  VectorCopy(origin, p->org);
992 
993  vec3_t velocity;
994  VectorSubtract(origin, org, velocity);
995  VectorNormalize(velocity);
996  VectorScale(velocity, water_base_velocity + frand() * water_rand_velocity, p->vel);
997 
998  p->accel[0] = p->accel[1] = 0;
999  p->accel[2] = -PARTICLE_GRAVITY;
1000  p->alpha = 1.0;
1001 
1002  p->alphavel = -1.0 / (0.5 + frand() * 0.3);
1003  }
1004 }

Referenced by CL_ParseTEnt().

◆ CL_ParticleSmokeEffect()

void CL_ParticleSmokeEffect ( vec3_t  org,
vec3_t  dir,
int  color,
int  count,
int  magnitude 
)

Definition at line 721 of file newfx.c.

722 {
723  int i, j;
724  cparticle_t *p;
725  float d;
726  vec3_t r, u;
727 
728  MakeNormalVectors(dir, r, u);
729 
730  for (i = 0; i < count; i++) {
731  p = CL_AllocParticle();
732  if (!p)
733  return;
734 
735  p->time = cl.time;
736  p->color = color + (rand() & 7);
737 
738  for (j = 0; j < 3; j++) {
739  p->org[j] = org[j] + magnitude * 0.1 * crand();
740  }
741  VectorScale(dir, magnitude, p->vel);
742  d = crand() * magnitude / 3;
743  VectorMA(p->vel, d, r, p->vel);
744  d = crand() * magnitude / 3;
745  VectorMA(p->vel, d, u, p->vel);
746 
747  p->accel[0] = p->accel[1] = p->accel[2] = 0;
748  p->alpha = 1.0;
749 
750  p->alphavel = -1.0 / (0.5 + frand() * 0.3);
751  }
752 }

Referenced by CL_ParseTEnt().

◆ CL_ParticleSteamEffect()

void CL_ParticleSteamEffect ( vec3_t  org,
vec3_t  dir,
int  color,
int  count,
int  magnitude 
)

Definition at line 341 of file newfx.c.

342 {
343  int i, j;
344  cparticle_t *p;
345  float d;
346  vec3_t r, u;
347 
348  MakeNormalVectors(dir, r, u);
349 
350  for (i = 0; i < count; i++) {
351  p = CL_AllocParticle();
352  if (!p)
353  return;
354 
355  p->time = cl.time;
356  p->color = color + (rand() & 7);
357 
358  for (j = 0; j < 3; j++) {
359  p->org[j] = org[j] + magnitude * 0.1 * crand();
360  }
361  VectorScale(dir, magnitude, p->vel);
362  d = crand() * magnitude / 3;
363  VectorMA(p->vel, d, r, p->vel);
364  d = crand() * magnitude / 3;
365  VectorMA(p->vel, d, u, p->vel);
366 
367  p->accel[0] = p->accel[1] = 0;
368  p->accel[2] = -PARTICLE_GRAVITY / 2;
369  p->alpha = 1.0;
370 
371  p->alphavel = -1.0 / (0.5 + frand() * 0.3);
372  }
373 }

Referenced by CL_ParseSteam(), and CL_ParseTEnt().

◆ CL_ParticleSteamEffect2()

void CL_ParticleSteamEffect2 ( cl_sustain_t self)

Definition at line 375 of file newfx.c.

376 {
377  int i, j;
378  cparticle_t *p;
379  float d;
380  vec3_t r, u;
381  vec3_t dir;
382 
383  VectorCopy(self->dir, dir);
384  MakeNormalVectors(dir, r, u);
385 
386  for (i = 0; i < self->count; i++) {
387  p = CL_AllocParticle();
388  if (!p)
389  return;
390 
391  p->time = cl.time;
392  p->color = self->color + (rand() & 7);
393 
394  for (j = 0; j < 3; j++) {
395  p->org[j] = self->org[j] + self->magnitude * 0.1 * crand();
396  }
397  VectorScale(dir, self->magnitude, p->vel);
398  d = crand() * self->magnitude / 3;
399  VectorMA(p->vel, d, r, p->vel);
400  d = crand() * self->magnitude / 3;
401  VectorMA(p->vel, d, u, p->vel);
402 
403  p->accel[0] = p->accel[1] = 0;
404  p->accel[2] = -PARTICLE_GRAVITY / 2;
405  p->alpha = 1.0;
406 
407  p->alphavel = -1.0 / (0.5 + frand() * 0.3);
408  }
409 
410  self->nextthink += self->thinkinterval;
411 }

Referenced by CL_ParseSteam().

◆ CL_PredictAngles()

void CL_PredictAngles ( void  )

Definition at line 168 of file predict.c.

169 {
170  cl.predicted_angles[0] = cl.viewangles[0] + SHORT2ANGLE(cl.frame.ps.pmove.delta_angles[0]);
171  cl.predicted_angles[1] = cl.viewangles[1] + SHORT2ANGLE(cl.frame.ps.pmove.delta_angles[1]);
172  cl.predicted_angles[2] = cl.viewangles[2] + SHORT2ANGLE(cl.frame.ps.pmove.delta_angles[2]);
173 }

Referenced by CL_PredictMovement(), and set_active_state().

◆ CL_PredictMovement()

void CL_PredictMovement ( void  )

Definition at line 175 of file predict.c.

176 {
177  unsigned ack, current, frame;
178  pmove_t pm;
179  int step, oldz;
180 
181  if (cls.state != ca_active) {
182  return;
183  }
184 
185  if (cls.demo.playback) {
186  return;
187  }
188 
189  if (sv_paused->integer) {
190  return;
191  }
192 
193  if (!cl_predict->integer || (cl.frame.ps.pmove.pm_flags & PMF_NO_PREDICTION)) {
194  // just set angles
196  return;
197  }
198 
199  ack = cl.history[cls.netchan->incoming_acknowledged & CMD_MASK].cmdNumber;
200  current = cl.cmdNumber;
201 
202  // if we are too far out of date, just freeze
203  if (current - ack > CMD_BACKUP - 1) {
204  SHOWMISS("%i: exceeded CMD_BACKUP\n", cl.frame.number);
205  return;
206  }
207 
208  if (!cl.cmd.msec && current == ack) {
209  SHOWMISS("%i: not moved\n", cl.frame.number);
210  return;
211  }
212 
213  X86_PUSH_FPCW;
214  X86_SINGLE_FPCW;
215 
216  // copy current state to pmove
217  memset(&pm, 0, sizeof(pm));
218  pm.trace = CL_Trace;
219  pm.pointcontents = CL_PointContents;
220 
221  pm.s = cl.frame.ps.pmove;
222 #if USE_SMOOTH_DELTA_ANGLES
223  VectorCopy(cl.delta_angles, pm.s.delta_angles);
224 #endif
225 
226  // run frames
227  while (++ack <= current) {
228  pm.cmd = cl.cmds[ack & CMD_MASK];
229  Pmove(&pm, &cl.pmp);
230 
231  // save for debug checking
232  VectorCopy(pm.s.origin, cl.predicted_origins[ack & CMD_MASK]);
233  }
234 
235  // run pending cmd
236  if (cl.cmd.msec) {
237  pm.cmd = cl.cmd;
238  pm.cmd.forwardmove = cl.localmove[0];
239  pm.cmd.sidemove = cl.localmove[1];
240  pm.cmd.upmove = cl.localmove[2];
241  Pmove(&pm, &cl.pmp);
242  frame = current;
243 
244  // save for debug checking
245  VectorCopy(pm.s.origin, cl.predicted_origins[(current + 1) & CMD_MASK]);
246  } else {
247  frame = current - 1;
248  }
249 
250  X86_POP_FPCW;
251 
252  if (pm.s.pm_type != PM_SPECTATOR && (pm.s.pm_flags & PMF_ON_GROUND)) {
253  oldz = cl.predicted_origins[cl.predicted_step_frame & CMD_MASK][2];
254  step = pm.s.origin[2] - oldz;
255  if (step > 63 && step < 160) {
256  cl.predicted_step = step * 0.125f;
258  cl.predicted_step_frame = frame + 1; // don't double step
259  }
260  }
261 
262  if (cl.predicted_step_frame < frame) {
263  cl.predicted_step_frame = frame;
264  }
265 
266  // copy results out for rendering
267  VectorScale(pm.s.origin, 0.125f, cl.predicted_origin);
268  VectorScale(pm.s.velocity, 0.125f, cl.predicted_velocity);
269  VectorCopy(pm.viewangles, cl.predicted_angles);
270 }

Referenced by CL_Frame().

◆ CL_PrepRefresh()

void CL_PrepRefresh ( void  )

Definition at line 333 of file precache.c.

334 {
335  int i;
336  char *name;
337 
338  if (!cls.ref_initialized)
339  return;
340  if (!cl.mapname[0])
341  return; // no map loaded
342 
343  // register models, pics, and skins
345 
347 
349 
350 #if CL_RTX_SHADERBALLS
351  cvar_shaderballs = Cvar_Get("cl_shaderballs", "0", 0);
352  if (cvar_shaderballs->integer && vid_rtx->integer)
353  {
354  cl_dev_shaderballs = R_RegisterModel("develop/objects/ShaderBallArray/ShaderBallArray16.MD3");
355  if (cl_dev_shaderballs)
356  Com_Printf("Loaded the ShaderBalls model\n");
357  else
358  Com_WPrintf("Failed to load the ShaderBalls model\n");
359  }
360  else
361  cl_dev_shaderballs = -1;
362 #endif
363 
364  for (i = 2; i < MAX_MODELS; i++) {
365  name = cl.configstrings[CS_MODELS + i];
366  if (!name[0]) {
367  break;
368  }
369  if (name[0] == '#') {
370  continue;
371  }
372  cl.model_draw[i] = R_RegisterModel(name);
373  }
374 
376  for (i = 1; i < MAX_IMAGES; i++) {
377  name = cl.configstrings[CS_IMAGES + i];
378  if (!name[0]) {
379  break;
380  }
381  cl.image_precache[i] = R_RegisterPic2(name);
382  }
383 
385  for (i = 0; i < MAX_CLIENTS; i++) {
386  name = cl.configstrings[CS_PLAYERSKINS + i];
387  if (!name[0]) {
388  continue;
389  }
390  CL_LoadClientinfo(&cl.clientinfo[i], name);
391  }
392 
393  CL_LoadClientinfo(&cl.baseclientinfo, "unnamed\\male/grunt");
394 
395  // set sky textures and speed
396  CL_SetSky();
397 
398  // the renderer can now free unneeded stuff
400 
401  // clear any lines of console text
403 
405 
406  int cdtrack = atoi(cl.configstrings[CS_CDTRACK]);
407  OGG_PlayTrack(cdtrack);
408 }

Referenced by CL_Begin(), CL_Precache_f(), CL_RestartFilesystem(), and CL_RestartRefresh().

◆ CL_QuadTrail()

void CL_QuadTrail ( vec3_t  start,
vec3_t  end 
)

Definition at line 1388 of file effects.c.

1389 {
1390  vec3_t move;
1391  vec3_t vec;
1392  float len;
1393  int j;
1394  cparticle_t *p;
1395  int dec;
1396 
1397  VectorCopy(start, move);
1398  VectorSubtract(end, start, vec);
1399  len = VectorNormalize(vec);
1400 
1401  dec = 5;
1402  VectorScale(vec, 5, vec);
1403 
1404  while (len > 0) {
1405  len -= dec;
1406 
1407  p = CL_AllocParticle();
1408  if (!p)
1409  return;
1410  VectorClear(p->accel);
1411 
1412  p->time = cl.time;
1413 
1414  p->alpha = 1.0;
1415  p->alphavel = -1.0 / (0.8 + frand() * 0.2);
1416 
1417  p->color = 115;
1419 
1420  for (j = 0; j < 3; j++) {
1421  p->org[j] = move[j] + crand() * 16;
1422  p->vel[j] = crand() * 5;
1423  p->accel[j] = 0;
1424  }
1425 
1426  VectorAdd(move, vec, move);
1427  }
1428 }

◆ CL_QueueDownload()

qerror_t CL_QueueDownload ( const char *  path,
dltype_t  type 
)

Definition at line 49 of file download.c.

50 {
51  dlqueue_t *q;
52  size_t len;
53 
54  FOR_EACH_DLQ(q) {
55  // avoid sending duplicate requests
56  if (!FS_pathcmp(path, q->path)) {
57  Com_DPrintf("%s: %s [DUP]\n", __func__, path);
58  return Q_ERR_EXIST;
59  }
60  }
61 
62  len = strlen(path);
63  if (len >= MAX_QPATH) {
64  Com_Error(ERR_DROP, "%s: oversize quake path", __func__);
65  }
66 
67  q = Z_Malloc(sizeof(*q) + len);
68  memcpy(q->path, path, len + 1);
69  q->type = type;
70  q->state = DL_PENDING;
71 
72 #if USE_CURL
73  // paks get bumped to the top and HTTP switches to single downloading.
74  // this prevents someone on 28k dialup trying to do both the main .pak
75  // and referenced configstrings data at once.
76  if (type == DL_PAK)
77  List_Insert(&cls.download.queue, &q->entry);
78  else
79 #endif
80  List_Append(&cls.download.queue, &q->entry);
81 
83  Com_DPrintf("%s: %s [%d]\n", __func__, path, cls.download.pending);
84  return Q_ERR_SUCCESS;
85 }

Referenced by check_and_queue_download(), check_file_len(), and HTTP_QueueDownload().

◆ CL_Quit_f()

void CL_Quit_f ( void  )

◆ CL_RegisterBspModels()

void CL_RegisterBspModels ( void  )

Definition at line 226 of file precache.c.

227 {
228  qerror_t ret;
229  char *name;
230  int i;
231 
232  ret = BSP_Load(cl.configstrings[CS_MODELS + 1], &cl.bsp);
233  if (cl.bsp == NULL) {
234  Com_Error(ERR_DROP, "Couldn't load %s: %s",
235  cl.configstrings[CS_MODELS + 1], Q_ErrorString(ret));
236  }
237 
238 #if USE_MAPCHECKSUM
239  if (cl.bsp->checksum != atoi(cl.configstrings[CS_MAPCHECKSUM])) {
240  if (cls.demo.playback) {
241  Com_WPrintf("Local map version differs from demo: %i != %s\n",
242  cl.bsp->checksum, cl.configstrings[CS_MAPCHECKSUM]);
243  } else {
244  Com_Error(ERR_DROP, "Local map version differs from server: %i != %s",
245  cl.bsp->checksum, cl.configstrings[CS_MAPCHECKSUM]);
246  }
247  }
248 #endif
249 
250  for (i = 1; i < MAX_MODELS; i++) {
251  name = cl.configstrings[CS_MODELS + i];
252  if (!name[0]) {
253  break;
254  }
255  if (name[0] == '*')
256  cl.model_clip[i] = BSP_InlineModel(cl.bsp, name);
257  else
258  cl.model_clip[i] = NULL;
259  }
260 }

Referenced by CL_Precache_f(), and CL_RequestNextDownload().

◆ CL_RegisterInput()

void CL_RegisterInput ( void  )

Definition at line 707 of file input.c.

708 {
709  Cmd_AddCommand("centerview", IN_CenterView);
710 
711  Cmd_AddCommand("+moveup", IN_UpDown);
712  Cmd_AddCommand("-moveup", IN_UpUp);
713  Cmd_AddCommand("+movedown", IN_DownDown);
714  Cmd_AddCommand("-movedown", IN_DownUp);
715  Cmd_AddCommand("+left", IN_LeftDown);
716  Cmd_AddCommand("-left", IN_LeftUp);
717  Cmd_AddCommand("+right", IN_RightDown);
718  Cmd_AddCommand("-right", IN_RightUp);
719  Cmd_AddCommand("+forward", IN_ForwardDown);
720  Cmd_AddCommand("-forward", IN_ForwardUp);
721  Cmd_AddCommand("+back", IN_BackDown);
722  Cmd_AddCommand("-back", IN_BackUp);
723  Cmd_AddCommand("+lookup", IN_LookupDown);
724  Cmd_AddCommand("-lookup", IN_LookupUp);
725  Cmd_AddCommand("+lookdown", IN_LookdownDown);
726  Cmd_AddCommand("-lookdown", IN_LookdownUp);
727  Cmd_AddCommand("+strafe", IN_StrafeDown);
728  Cmd_AddCommand("-strafe", IN_StrafeUp);
729  Cmd_AddCommand("+moveleft", IN_MoveleftDown);
730  Cmd_AddCommand("-moveleft", IN_MoveleftUp);
731  Cmd_AddCommand("+moveright", IN_MoverightDown);
732  Cmd_AddCommand("-moveright", IN_MoverightUp);
733  Cmd_AddCommand("+speed", IN_SpeedDown);
734  Cmd_AddCommand("-speed", IN_SpeedUp);
735  Cmd_AddCommand("+attack", IN_AttackDown);
736  Cmd_AddCommand("-attack", IN_AttackUp);
737  Cmd_AddCommand("+use", IN_UseDown);
738  Cmd_AddCommand("-use", IN_UseUp);
739  Cmd_AddCommand("impulse", IN_Impulse);
740  Cmd_AddCommand("+klook", IN_KLookDown);
741  Cmd_AddCommand("-klook", IN_KLookUp);
742  Cmd_AddCommand("+mlook", IN_MLookDown);
743  Cmd_AddCommand("-mlook", IN_MLookUp);
744 
745  Cmd_AddCommand("in_restart", IN_Restart_f);
746 
747  cl_nodelta = Cvar_Get("cl_nodelta", "0", 0);
748  cl_maxpackets = Cvar_Get("cl_maxpackets", "30", 0);
749  cl_fuzzhack = Cvar_Get("cl_fuzzhack", "0", 0);
750  cl_packetdup = Cvar_Get("cl_packetdup", "1", 0);
751 #ifdef _DEBUG
752  cl_showpackets = Cvar_Get("cl_showpackets", "0", 0);
753 #endif
754  cl_instantpacket = Cvar_Get("cl_instantpacket", "1", 0);
755  cl_batchcmds = Cvar_Get("cl_batchcmds", "1", 0);
756 
757  cl_upspeed = Cvar_Get("cl_upspeed", "200", 0);
758  cl_forwardspeed = Cvar_Get("cl_forwardspeed", "200", 0);
759  cl_sidespeed = Cvar_Get("cl_sidespeed", "200", 0);
760  cl_yawspeed = Cvar_Get("cl_yawspeed", "140", 0);
761  cl_pitchspeed = Cvar_Get("cl_pitchspeed", "150", CVAR_CHEAT);
762  cl_anglespeedkey = Cvar_Get("cl_anglespeedkey", "1.5", CVAR_CHEAT);
763  cl_run = Cvar_Get("cl_run", "1", CVAR_ARCHIVE);
764 
765  freelook = Cvar_Get("freelook", "1", CVAR_ARCHIVE);
766  lookspring = Cvar_Get("lookspring", "0", CVAR_ARCHIVE);
767  lookstrafe = Cvar_Get("lookstrafe", "0", CVAR_ARCHIVE);
768  sensitivity = Cvar_Get("sensitivity", "3", CVAR_ARCHIVE);
769 
770  m_pitch = Cvar_Get("m_pitch", "0.022", CVAR_ARCHIVE);
771  m_invert = Cvar_Get("m_invert", "0", CVAR_ARCHIVE);
772  m_yaw = Cvar_Get("m_yaw", "0.022", 0);
773  m_forward = Cvar_Get("m_forward", "1", 0);
774  m_side = Cvar_Get("m_side", "1", 0);
775  m_filter = Cvar_Get("m_filter", "0", 0);
776  m_accel = Cvar_Get("m_accel", "0", 0);
777  m_autosens = Cvar_Get("m_autosens", "0", 0);
778  m_autosens->changed = m_autosens_changed;
780 }

Referenced by CL_InitLocal().

◆ CL_RegisterSounds()

void CL_RegisterSounds ( void  )

Definition at line 203 of file precache.c.

204 {
205  int i;
206  char *s;
207 
210  for (i = 1; i < MAX_SOUNDS; i++) {
211  s = cl.configstrings[CS_SOUNDS + i];
212  if (!s[0])
213  break;
215  }
217 }

Referenced by CL_Begin(), CL_Precache_f(), CL_RestartFilesystem(), and CL_RestartSound_f().

◆ CL_RegisterTEntModels()

void CL_RegisterTEntModels ( void  )

Definition at line 100 of file tent.c.

101 {
102  cl_mod_explode = R_RegisterModel("models/objects/explode/tris.md2");
103  cl_mod_smoke = R_RegisterModel("models/objects/smoke/tris.md2");
104  cl_mod_flash = R_RegisterModel("models/objects/flash/tris.md2");
105  cl_mod_parasite_segment = R_RegisterModel("models/monsters/parasite/segment/tris.md2");
106  cl_mod_grapple_cable = R_RegisterModel("models/ctf/segment/tris.md2");
107  cl_mod_explo4 = R_RegisterModel("models/objects/r_explode/tris.md2");
108  cl_mod_explosions[0] = R_RegisterModel("sprites/rocket_0.sp2");
109  cl_mod_explosions[1] = R_RegisterModel("sprites/rocket_1.sp2");
110  cl_mod_explosions[2] = R_RegisterModel("sprites/rocket_5.sp2");
111  cl_mod_explosions[3] = R_RegisterModel("sprites/rocket_6.sp2");
112  cl_mod_bfg_explo = R_RegisterModel("sprites/s_bfg2.sp2");
113  cl_mod_powerscreen = R_RegisterModel("models/items/armor/effect/tris.md2");
114  cl_mod_laser = R_RegisterModel("models/objects/laser/tris.md2");
115  cl_mod_dmspot = R_RegisterModel("models/objects/dmspot/tris.md2");
116 
117  cl_mod_lightning = R_RegisterModel("models/proj/lightning/tris.md2");
118  cl_mod_heatbeam = R_RegisterModel("models/proj/beam/tris.md2");
119  cl_mod_explo4_big = R_RegisterModel("models/objects/r_explode2/tris.md2");
120 
121  for (int i = 0; i < sizeof(cl_mod_explosions) / sizeof(*cl_mod_explosions); i++)
122  {
123  model_t* model = MOD_ForHandle(cl_mod_explosions[i]);
124  model->sprite_vertical = qtrue;
125  }
126 }

Referenced by CL_PrepRefresh().

◆ CL_RegisterTEntSounds()

void CL_RegisterTEntSounds ( void  )

Definition at line 64 of file tent.c.

65 {
66  int i;
67  char name[MAX_QPATH];
68 
69  cl_sfx_ric1 = S_RegisterSound("world/ric1.wav");
70  cl_sfx_ric2 = S_RegisterSound("world/ric2.wav");
71  cl_sfx_ric3 = S_RegisterSound("world/ric3.wav");
72  cl_sfx_lashit = S_RegisterSound("weapons/lashit.wav");
73  cl_sfx_flare = S_RegisterSound("weapons/flare.wav");
74  cl_sfx_spark5 = S_RegisterSound("world/spark5.wav");
75  cl_sfx_spark6 = S_RegisterSound("world/spark6.wav");
76  cl_sfx_spark7 = S_RegisterSound("world/spark7.wav");
77  cl_sfx_railg = S_RegisterSound("weapons/railgf1a.wav");
78  cl_sfx_rockexp = S_RegisterSound("weapons/rocklx1a.wav");
79  cl_sfx_grenexp = S_RegisterSound("weapons/grenlx1a.wav");
80  cl_sfx_watrexp = S_RegisterSound("weapons/xpld_wat.wav");
81 
82  S_RegisterSound("player/land1.wav");
83  S_RegisterSound("player/fall2.wav");
84  S_RegisterSound("player/fall1.wav");
85 
86  for (i = 0; i < 4; i++) {
87  Q_snprintf(name, sizeof(name), "player/step%i.wav", i + 1);
89  }
90 
91  cl_sfx_lightning = S_RegisterSound("weapons/tesla.wav");
92  cl_sfx_disrexp = S_RegisterSound("weapons/disrupthit.wav");
93 }

Referenced by CL_RegisterSounds().

◆ CL_RegisterVWepModels()

void CL_RegisterVWepModels ( void  )

Definition at line 269 of file precache.c.

270 {
271  int i;
272  char *name;
273 
274  cl.numWeaponModels = 1;
275  strcpy(cl.weaponModels[0], "weapon.md2");
276 
277  // only default model when vwep is off
278  if (!cl_vwep->integer) {
279  return;
280  }
281 
282  for (i = 2; i < MAX_MODELS; i++) {
283  name = cl.configstrings[CS_MODELS + i];
284  if (!name[0]) {
285  break;
286  }
287  if (name[0] != '#') {
288  continue;
289  }
290 
291  // special player weapon model
292  strcpy(cl.weaponModels[cl.numWeaponModels++], name + 1);
293 
295  break;
296  }
297  }
298 }

Referenced by CL_Precache_f(), CL_Skins_f(), and cl_vwep_changed().

◆ CL_RequestNextDownload()

void CL_RequestNextDownload ( void  )

Definition at line 735 of file download.c.

736 {
737  char fn[MAX_QPATH], *name;
738  size_t len;
739  int i;
740 
741  if (cls.state != ca_connected && cls.state != ca_loading)
742  return;
743 
744  if (allow_download->integer <= 0 || NET_IsLocalAddress(&cls.serverAddress)) {
745  if (precache_check <= PRECACHE_MAP) {
747  }
748 
749  CL_Begin();
750  return;
751  }
752 
753  switch (precache_check) {
754  case PRECACHE_MODELS:
755  // confirm map
756  if (allow_download_maps->integer)
757  check_file(cl.configstrings[CS_MODELS + 1], DL_MAP);
758 
759  // checking for models
760  if (allow_download_models->integer) {
761  for (i = 2; i < MAX_MODELS; i++) {
762  name = cl.configstrings[CS_MODELS + i];
763  if (!name[0]) {
764  break;
765  }
766  if (name[0] == '*' || name[0] == '#') {
767  continue;
768  }
769  check_file(name, DL_MODEL);
770  }
771  }
772 
774  // fall through
775 
776  case PRECACHE_OTHER:
777  if (allow_download_models->integer) {
779  // pending downloads (models), let's wait here before we can check skins.
780  Com_DPrintf("%s: waiting for models...\n", __func__);
781  return;
782  }
783 
784  for (i = 2; i < MAX_MODELS; i++) {
785  name = cl.configstrings[CS_MODELS + i];
786  if (!name[0]) {
787  break;
788  }
789  if (name[0] == '*' || name[0] == '#') {
790  continue;
791  }
792  check_skins(name);
793  }
794  }
795 
796  if (allow_download_sounds->integer) {
797  for (i = 1; i < MAX_SOUNDS; i++) {
798  name = cl.configstrings[CS_SOUNDS + i];
799  if (!name[0]) {
800  break;
801  }
802  if (name[0] == '*') {
803  continue;
804  }
805  if (name[0] == '#') {
806  len = Q_strlcpy(fn, name + 1, sizeof(fn));
807  } else {
808  len = Q_concat(fn, sizeof(fn), "sound/", name, NULL);
809  }
810  check_file_len(fn, len, DL_OTHER);
811  }
812  }
813 
814  if (allow_download_pics->integer) {
815  for (i = 1; i < MAX_IMAGES; i++) {
816  name = cl.configstrings[CS_IMAGES + i];
817  if (!name[0]) {
818  break;
819  }
820  if (name[0] == '/' || name[0] == '\\') {
821  len = Q_strlcpy(fn, name + 1, sizeof(fn));
822  } else {
823  len = Q_concat(fn, sizeof(fn), "pics/", name, ".pcx", NULL);
824  }
825  check_file_len(fn, len, DL_OTHER);
826  }
827  }
828 
829  if (allow_download_players->integer) {
830  // find sexed sounds
832  for (i = 1; i < MAX_SOUNDS; i++) {
833  if (cl.configstrings[CS_SOUNDS + i][0] == '*') {
835  }
836  }
837 
838  for (i = 0; i < MAX_CLIENTS; i++) {
839  name = cl.configstrings[CS_PLAYERSKINS + i];
840  if (!name[0]) {
841  continue;
842  }
843  check_player(name);
844  }
845  }
846 
847  if (allow_download_textures->integer) {
848  static const char env_suf[6][3] = {
849  "rt", "bk", "lf", "ft", "up", "dn"
850  };
851 
852  for (i = 0; i < 6; i++) {
853  len = Q_concat(fn, sizeof(fn), "env/", cl.configstrings[CS_SKY], env_suf[i], ".tga", NULL);
854  check_file_len(fn, len, DL_OTHER);
855  }
856  }
857 
859  // fall through
860 
861  case PRECACHE_MAP:
862  if (downloads_pending(DL_MAP)) {
863  // map might still be downloading?
864  Com_DPrintf("%s: waiting for map...\n", __func__);
865  return;
866  }
867 
868  // load the map file before checking textures
870 
871  if (allow_download_textures->integer) {
872  for (i = 0; i < cl.bsp->numtexinfo; i++) {
873  len = Q_concat(fn, sizeof(fn), "textures/", cl.bsp->texinfo[i].name, ".wal", NULL);
874  check_file_len(fn, len, DL_OTHER);
875  }
876  }
877 
879  // fall through
880 
881  case PRECACHE_FINAL:
883  // pending downloads (possibly textures), let's wait here.
884  Com_DPrintf("%s: waiting for others...\n", __func__);
885  return;
886  }
887 
888  // all done, tell server we are ready
889  CL_Begin();
890  break;
891 
892  default:
893  Com_Error(ERR_DROP, "%s: bad precache_check\n", __func__);
894  }
895 }

Referenced by abort_downloads(), CL_Precache_f(), finish_download(), finish_udp_download(), and start_download().

◆ CL_ResetPrecacheCheck()

void CL_ResetPrecacheCheck ( void  )

Definition at line 897 of file download.c.

898 {
900 }

Referenced by CL_Precache_f().

◆ CL_RestartFilesystem()

void CL_RestartFilesystem ( qboolean  total)

Definition at line 2418 of file main.c.

2419 {
2420  int cls_state;
2421 
2422  if (!cl_running->integer) {
2423  FS_Restart(total);
2424  return;
2425  }
2426 
2427  Com_DPrintf("%s(%d)\n", __func__, total);
2428 
2429  // temporary switch to loading state
2430  cls_state = cls.state;
2431  if (cls.state >= ca_precached) {
2432  cls.state = ca_loading;
2433  }
2434 
2435  Con_Popup(qfalse);
2436 
2437  UI_Shutdown();
2438 
2439  S_StopAllSounds();
2440  S_FreeAllSounds();
2441 
2442  // write current config before changing game directory
2443  CL_WriteConfig();
2444 
2445  if (cls.ref_initialized) {
2446  R_Shutdown(qfalse);
2447 
2448  FS_Restart(total);
2449 
2450  R_Init(qfalse);
2451 
2454  UI_Init();
2455  } else {
2456  FS_Restart(total);
2457  }
2458 
2459  if (cls_state == ca_disconnected) {
2460  UI_OpenMenu(UIMENU_DEFAULT);
2461  } else if (cls_state >= ca_loading && cls_state <= ca_active) {
2463  CL_PrepRefresh();
2467  } else if (cls_state == ca_cinematic) {
2468  cl.image_precache[0] = R_RegisterPic2(cl.mapname);
2469  }
2470 
2472 
2473  // switch back to original state
2474  cls.state = cls_state;
2475 
2476  Con_Close(qfalse);
2477 
2479 
2480  cvar_modified &= ~CVAR_FILES;
2481 }

Referenced by finish_download(), fs_game_changed(), and FS_Restart_f().

◆ CL_RestartRefresh()

void CL_RestartRefresh ( qboolean  total)

Definition at line 2483 of file main.c.

2484 {
2485  int cls_state;
2486 
2487  if (!cls.ref_initialized) {
2488  return;
2489  }
2490 
2491  // temporary switch to loading state
2492  cls_state = cls.state;
2493  if (cls.state >= ca_precached) {
2494  cls.state = ca_loading;
2495  }
2496 
2497  Con_Popup(qfalse);
2498 
2499  S_StopAllSounds();
2500 
2501  if (total) {
2502  IN_Shutdown();
2504  CL_InitRefresh();
2505  IN_Init();
2506  } else {
2507  UI_Shutdown();
2508  R_Shutdown(qfalse);
2509  R_Init(qfalse);
2512  UI_Init();
2513  }
2514 
2515  if (cls_state == ca_disconnected) {
2516  UI_OpenMenu(UIMENU_DEFAULT);
2517  } else if (cls_state >= ca_loading && cls_state <= ca_active) {
2519  CL_PrepRefresh();
2521  } else if (cls_state == ca_cinematic) {
2522  cl.image_precache[0] = R_RegisterPic2(cl.mapname);
2523  }
2524 
2525  // switch back to original state
2526  cls.state = cls_state;
2527 
2528  Con_Close(qfalse);
2529 
2531 
2532  cvar_modified &= ~CVAR_FILES;
2533 }

Referenced by CL_ReloadRefresh_f(), CL_RestartRefresh_f(), and CL_RunRefresh().

◆ CL_RocketTrail()

void CL_RocketTrail ( vec3_t  start,
vec3_t  end,
centity_t old 
)

Definition at line 1579 of file effects.c.

1580 {
1581  vec3_t move;
1582  vec3_t vec;
1583  float len;
1584  int j;
1585  cparticle_t *p;
1586  float dec;
1587 
1588  // smoke
1589  CL_DiminishingTrail(start, end, old, EF_ROCKET);
1590 
1591  // fire
1592  VectorCopy(start, move);
1593  VectorSubtract(end, start, vec);
1594  len = VectorNormalize(vec);
1595 
1596  dec = 1;
1597  VectorScale(vec, dec, vec);
1598 
1599  while (len > 0) {
1600  len -= dec;
1601 
1602  if ((rand() & 7) == 0) {
1603  p = CL_AllocParticle();
1604  if (!p)
1605  return;
1606 
1607  VectorClear(p->accel);
1608  p->time = cl.time;
1609 
1610  p->alpha = 1.0;
1611  p->alphavel = -1.0 / (1 + frand() * 0.2);
1612 
1613  p->color = 0xdc + (rand() & 3);
1615 
1616  for (j = 0; j < 3; j++) {
1617  p->org[j] = move[j] + crand() * 5;
1618  p->vel[j] = crand() * 20;
1619  }
1620  p->accel[2] = -PARTICLE_GRAVITY;
1621  }
1622  VectorAdd(move, vec, move);
1623  }
1624 }

Referenced by CL_AddPacketEntities().

◆ CL_RunParticles()

void CL_RunParticles ( void  )

◆ CL_RunRefresh()

void CL_RunRefresh ( void  )

Definition at line 232 of file refresh.c.

233 {
234  if (!cls.ref_initialized) {
235  return;
236  }
237 
238  VID_PumpEvents();
239 
240  if (mode_changed) {
242  VID_SetMode();
243  if (vid_fullscreen->integer) {
244  Cvar_Set("_vid_fullscreen", vid_fullscreen->string);
245  }
246  } else {
247  if (vid_fullscreen->integer) {
248  if (mode_changed & MODE_MODELIST) {
249  VID_SetMode();
250  }
251  } else {
252  if (mode_changed & MODE_GEOMETRY) {
253  VID_SetMode();
254  }
255  }
256  }
257  mode_changed = 0;
258  }
259 
260  if (cvar_modified & CVAR_REFRESH) {
261  CL_RestartRefresh(qtrue);
262  cvar_modified &= ~CVAR_REFRESH;
263  } else if (cvar_modified & CVAR_FILES) {
264  CL_RestartRefresh(qfalse);
265  cvar_modified &= ~CVAR_FILES;
266  }
267 }

Referenced by CL_ProcessEvents().

◆ CL_SeekDemoMessage()

void CL_SeekDemoMessage ( void  )

Definition at line 1343 of file parse.c.

1344 {
1345  int cmd, extrabits;
1346  int index;
1347 
1348 #ifdef _DEBUG
1349  if (cl_shownet->integer == 1) {
1350  Com_LPrintf(PRINT_DEVELOPER, "%"PRIz" ", msg_read.cursize);
1351  } else if (cl_shownet->integer > 1) {
1352  Com_LPrintf(PRINT_DEVELOPER, "------------------\n");
1353  }
1354 #endif
1355 
1356 //
1357 // parse the message
1358 //
1359  while (1) {
1360  if (msg_read.readcount > msg_read.cursize) {
1361  Com_Error(ERR_DROP, "%s: read past end of server message", __func__);
1362  }
1363 
1364  if ((cmd = MSG_ReadByte()) == -1) {
1365  SHOWNET(1, "%3"PRIz":END OF MESSAGE\n", msg_read.readcount - 1);
1366  break;
1367  }
1368 
1369  extrabits = cmd >> SVCMD_BITS;
1370  cmd &= SVCMD_MASK;
1371 
1372 #ifdef _DEBUG
1373  if (cl_shownet->integer > 1) {
1374  MSG_ShowSVC(cmd);
1375  }
1376 #endif
1377 
1378  // other commands
1379  switch (cmd) {
1380  default:
1381  Com_Error(ERR_DROP, "%s: illegible server message: %d", __func__, cmd);
1382  break;
1383 
1384  case svc_nop:
1385  break;
1386 
1387  case svc_disconnect:
1388  case svc_reconnect:
1389  Com_Error(ERR_DISCONNECT, "Server disconnected");
1390  break;
1391 
1392  case svc_print:
1393  MSG_ReadByte();
1394  // fall thorugh
1395 
1396  case svc_centerprint:
1397  case svc_stufftext:
1398  MSG_ReadString(NULL, 0);
1399  break;
1400 
1401  case svc_configstring:
1402  index = MSG_ReadShort();
1403  CL_ParseConfigstring(index);
1404  break;
1405 
1406  case svc_sound:
1408  break;
1409 
1410  case svc_temp_entity:
1412  break;
1413 
1414  case svc_muzzleflash:
1415  case svc_muzzleflash2:
1417  break;
1418 
1419  case svc_frame:
1420  CL_ParseFrame(extrabits);
1421  continue;
1422 
1423  case svc_inventory:
1425  break;
1426 
1427  case svc_layout:
1428  CL_ParseLayout();
1429  break;
1430 
1431  }
1432  }
1433 }

Referenced by CL_Seek_f().

◆ CL_SendCmd()

void CL_SendCmd ( void  )

Definition at line 1166 of file input.c.

1167 {
1168  if (cls.state < ca_connected) {
1169  return; // not talking to a server
1170  }
1171 
1172  // generate usercmds while playing a demo,
1173  // but do not send them
1174  if (!cls.netchan) {
1175  return;
1176  }
1177 
1178  if (cls.state != ca_active || sv_paused->integer) {
1179  // send a userinfo update if needed
1180  CL_SendUserinfo();
1181 
1182  // just keepalive or update reliable
1183  if (cls.netchan->ShouldUpdate(cls.netchan)) {
1184  CL_SendKeepAlive();
1185  }
1186 
1187  cl.sendPacketNow = qfalse;
1188  return;
1189  }
1190 
1191  // are there any new usercmds to send after all?
1193  return; // nothing to send
1194  }
1195 
1196  // send a userinfo update if needed
1197  CL_SendUserinfo();
1198 
1199  if (cls.serverProtocol == PROTOCOL_VERSION_Q2PRO && cl_batchcmds->integer) {
1201  } else {
1203  }
1204 
1205  cl.sendPacketNow = qfalse;
1206 }

Referenced by CL_Frame().

◆ CL_SendRcon()

void CL_SendRcon ( const netadr_t *  adr,
const char *  pass,
const char *  cmd 
)

Definition at line 637 of file main.c.

638 {
639  NET_Config(NET_CLIENT);
640 
641  CL_AddRequest(adr, REQ_RCON);
642 
643  Netchan_OutOfBand(NS_CLIENT, adr, "rcon \"%s\" %s", pass, cmd);
644 }

Referenced by CL_Rcon_f(), and Con_Action().

◆ CL_Server_g()

const char* CL_Server_g ( const char *  partial,
int  argnum,
int  state 
)

◆ CL_ShutdownRefresh()

void CL_ShutdownRefresh ( void  )

Definition at line 375 of file refresh.c.

376 {
377  if (!cls.ref_initialized) {
378  return;
379  }
380 
381  // Shutdown the rest of graphics subsystems
382  V_Shutdown();
383  SCR_Shutdown();
384  UI_Shutdown();
385 
386  vid_geometry->changed = NULL;
387  vid_fullscreen->changed = NULL;
388  vid_modelist->changed = NULL;
389 
390  R_Shutdown(qtrue);
391 
392  cls.ref_initialized = qfalse;
393 
394  // no longer active
395  cls.active = ACT_MINIMIZED;
396 
397  Z_LeakTest(TAG_RENDERER);
398 }

Referenced by CL_RestartRefresh(), and CL_Shutdown().

◆ CL_SmokeAndFlash()

void CL_SmokeAndFlash ( vec3_t  origin)

Definition at line 207 of file tent.c.

208 {
209  explosion_t *ex;
210 
211  ex = CL_AllocExplosion();
212  VectorCopy(origin, ex->ent.origin);
213  ex->type = ex_misc;
214  ex->frames = 4;
215  ex->ent.flags = RF_TRANSLUCENT | RF_NOSHADOW;
217  ex->ent.model = cl_mod_smoke;
218 
219  ex = CL_AllocExplosion();
220  VectorCopy(origin, ex->ent.origin);
221  ex->type = ex_flash;
222  ex->ent.flags = RF_FULLBRIGHT;
223  ex->frames = 2;
225  ex->ent.model = cl_mod_flash;
226 }

Referenced by CL_MuzzleFlash2(), and CL_ParseTEnt().

◆ CL_SmokeTrail()

void CL_SmokeTrail ( vec3_t  start,
vec3_t  end,
int  colorStart,
int  colorRun,
int  spacing 
)

Definition at line 105 of file newfx.c.

106 {
107  vec3_t move;
108  vec3_t vec;
109  float len;
110  int j;
111  cparticle_t *p;
112 
113  VectorCopy(start, move);
114  VectorSubtract(end, start, vec);
115  len = VectorNormalize(vec);
116 
117  VectorScale(vec, spacing, vec);
118 
119  // FIXME: this is a really silly way to have a loop
120  while (len > 0) {
121  len -= spacing;
122 
123  p = CL_AllocParticle();
124  if (!p)
125  return;
126  VectorClear(p->accel);
127 
128  p->time = cl.time;
129 
130  p->alpha = 1.0;
131  p->alphavel = -1.0 / (1 + frand() * 0.5);
132  p->color = colorStart + (rand() % colorRun);
133  for (j = 0; j < 3; j++) {
134  p->org[j] = move[j] + crand() * 3;
135  p->accel[j] = 0;
136  }
137  p->vel[2] = 20 + crand() * 5;
138 
139  VectorAdd(move, vec, move);
140  }
141 }

◆ CL_StartNextDownload()

void CL_StartNextDownload ( void  )

Definition at line 294 of file download.c.

295 {
296  dlqueue_t *q;
297 
299  return;
300  }
301 
302  FOR_EACH_DLQ(q) {
303  if (q->state == DL_PENDING) {
304  if (start_udp_download(q)) {
305  break;
306  }
307  }
308  }
309 }

Referenced by abort_downloads(), check_file_len(), and finish_udp_download().

◆ CL_Stop_f()

void CL_Stop_f ( void  )

Definition at line 268 of file demo.c.

269 {
270  uint32_t msglen;
271  char buffer[MAX_QPATH];
272 
273  if (!cls.demo.recording) {
274  Com_Printf("Not recording a demo.\n");
275  return;
276  }
277 
278 // finish up
279  msglen = (uint32_t)-1;
280  FS_Write(&msglen, 4, cls.demo.recording);
281 
282  format_demo_size(buffer, sizeof(buffer));
283 
284 // close demofile
286  cls.demo.recording = 0;
287  cls.demo.paused = qfalse;
288  cls.demo.frames_written = 0;
289  cls.demo.frames_dropped = 0;
290  cls.demo.others_dropped = 0;
291 
292 // print some statistics
293  Com_Printf("Stopped demo (%s).\n", buffer);
294 
295 // tell the server we finished recording
297 }

Referenced by CL_Changing_f(), CL_CleanupDemos(), and CL_WriteDemoMessage().

◆ CL_TagTrail()

void CL_TagTrail ( vec3_t  start,
vec3_t  end,
int  color 
)

Definition at line 646 of file newfx.c.

647 {
648  vec3_t move;
649  vec3_t vec;
650  float len;
651  int j;
652  cparticle_t *p;
653  int dec;
654 
655  VectorCopy(start, move);
656  VectorSubtract(end, start, vec);
657  len = VectorNormalize(vec);
658 
659  dec = 5;
660  VectorScale(vec, 5, vec);
661 
662  while (len >= 0) {
663  len -= dec;
664 
665  p = CL_AllocParticle();
666  if (!p)
667  return;
668  VectorClear(p->accel);
669 
670  p->time = cl.time;
671 
672  p->alpha = 1.0;
673  p->alphavel = -1.0 / (0.8 + frand() * 0.2);
674  p->color = color;
675  for (j = 0; j < 3; j++) {
676  p->org[j] = move[j] + crand() * 16;
677  p->vel[j] = crand() * 5;
678  p->accel[j] = 0;
679  }
680 
681  VectorAdd(move, vec, move);
682  }
683 }

Referenced by CL_AddPacketEntities().

◆ CL_TeleporterParticles()

void CL_TeleporterParticles ( vec3_t  org)

Definition at line 1098 of file effects.c.

1099 {
1100  int i, j;
1101  cparticle_t *p;
1102 
1103  const int count = 8 * cl_particle_num_factor->value;
1104 
1105  for (i = 0; i < count; i++) {
1106  p = CL_AllocParticle();
1107  if (!p)
1108  return;
1109 
1110  p->time = cl.time;
1111 
1112  p->color = 0xdb;
1113  p->brightness = 1.0f;
1114 
1115  for (j = 0; j < 2; j++) {
1116  p->org[j] = org[j] - 16 + (rand() & 31);
1117  p->vel[j] = crand() * 14;
1118  }
1119 
1120  p->org[2] = org[2] - 8 + (rand() & 7);
1121  p->vel[2] = 80 + (rand() & 7);
1122 
1123  p->accel[0] = p->accel[1] = 0;
1124  p->accel[2] = -PARTICLE_GRAVITY;
1125  p->alpha = 1.0;
1126 
1127  p->alphavel = -0.5;
1128  }
1129 }

Referenced by entity_event().

◆ CL_TeleportParticles()

void CL_TeleportParticles ( vec3_t  org)

Definition at line 1942 of file effects.c.

1943 {
1944  int i, j, k;
1945  cparticle_t *p;
1946  float vel;
1947  vec3_t dir;
1948 
1949  for (i = -16; i <= 16; i += 4)
1950  for (j = -16; j <= 16; j += 4)
1951  for (k = -16; k <= 32; k += 4) {
1952  p = CL_AllocParticle();
1953  if (!p)
1954  return;
1955 
1956  p->time = cl.time;
1957 
1958  p->color = 7 + (rand() & 7);
1959  p->brightness = 1.0f;
1960 
1961  p->alpha = 1.0;
1962  p->alphavel = -1.0 / (0.3 + (rand() & 7) * 0.02);
1963 
1964  p->org[0] = org[0] + i + (rand() & 3);
1965  p->org[1] = org[1] + j + (rand() & 3);
1966  p->org[2] = org[2] + k + (rand() & 3);
1967 
1968  dir[0] = j * 8;
1969  dir[1] = i * 8;
1970  dir[2] = k * 8;
1971 
1972  VectorNormalize(dir);
1973  vel = 50 + (rand() & 63);
1974  VectorScale(dir, vel, p->vel);
1975 
1976  p->accel[0] = p->accel[1] = 0;
1977  p->accel[2] = -PARTICLE_GRAVITY;
1978  }
1979 }

Referenced by CL_ParseTEnt(), and entity_event().

◆ CL_Tracker_Explode()

void CL_Tracker_Explode ( vec3_t  origin)

Definition at line 611 of file newfx.c.

612 {
613  vec3_t dir, backdir;
614  int i;
615  cparticle_t *p;
616 
617  for (i = 0; i < 300; i++) {
618  p = CL_AllocParticle();
619  if (!p)
620  return;
621  VectorClear(p->accel);
622 
623  p->time = cl.time;
624 
625  p->alpha = 1.0;
626  p->alphavel = -1.0;
627  p->color = 0;
628 
629  dir[0] = crand();
630  dir[1] = crand();
631  dir[2] = crand();
632  VectorNormalize(dir);
633  VectorScale(dir, -1, backdir);
634 
635  VectorMA(origin, 64, dir, p->org);
636  VectorScale(backdir, 64, p->vel);
637  }
638 }

◆ CL_Tracker_Shell()

void CL_Tracker_Shell ( vec3_t  origin)

Definition at line 466 of file newfx.c.

467 {
468  vec3_t dir;
469  int i;
470  cparticle_t *p;
471 
472  for (i = 0; i < 300; i++) {
473  p = CL_AllocParticle();
474  if (!p)
475  return;
476  VectorClear(p->accel);
477 
478  p->time = cl.time;
479 
480  p->alpha = 1.0;
482  p->color = 0;
483 
484  dir[0] = crand();
485  dir[1] = crand();
486  dir[2] = crand();
487  VectorNormalize(dir);
488 
489  VectorMA(origin, 40, dir, p->org);
490  }
491 }

Referenced by CL_AddPacketEntities().

◆ CL_TrackerTrail()

void CL_TrackerTrail ( vec3_t  start,
vec3_t  end,
int  particleColor 
)

Definition at line 418 of file newfx.c.

419 {
420  vec3_t move;
421  vec3_t vec;
422  vec3_t forward, right, up, angle_dir;
423  float len;
424  int j;
425  cparticle_t *p;
426  int dec;
427  float dist;
428 
429  VectorCopy(start, move);
430  VectorSubtract(end, start, vec);
431  len = VectorNormalize(vec);
432 
433  VectorCopy(vec, forward);
434  vectoangles2(forward, angle_dir);
435  AngleVectors(angle_dir, forward, right, up);
436 
437  dec = 3;
438  VectorScale(vec, 3, vec);
439 
440  // FIXME: this is a really silly way to have a loop
441  while (len > 0) {
442  len -= dec;
443 
444  p = CL_AllocParticle();
445  if (!p)
446  return;
447  VectorClear(p->accel);
448 
449  p->time = cl.time;
450 
451  p->alpha = 1.0;
452  p->alphavel = -2.0;
453  p->color = particleColor;
454  dist = DotProduct(move, forward);
455  VectorMA(move, 8 * cos(dist), up, p->org);
456  for (j = 0; j < 3; j++) {
457  p->vel[j] = 0;
458  p->accel[j] = 0;
459  }
460  p->vel[2] = 5;
461 
462  VectorAdd(move, vec, move);
463  }
464 }

Referenced by CL_AddPacketEntities().

◆ CL_TrapParticles()

void CL_TrapParticles ( entity_t *  ent)

Definition at line 897 of file newfx.c.

898 {
899  vec3_t move;
900  vec3_t vec;
901  vec3_t start, end;
902  float len;
903  int j;
904  cparticle_t *p;
905  int dec;
906 
907  ent->origin[2] -= 14;
908  VectorCopy(ent->origin, start);
909  VectorCopy(ent->origin, end);
910  end[2] += 64;
911 
912  VectorCopy(start, move);
913  VectorSubtract(end, start, vec);
914  len = VectorNormalize(vec);
915 
916  dec = 5;
917  VectorScale(vec, 5, vec);
918 
919  // FIXME: this is a really silly way to have a loop
920  while (len > 0) {
921  len -= dec;
922 
923  p = CL_AllocParticle();
924  if (!p)
925  return;
926  VectorClear(p->accel);
927 
928  p->time = cl.time;
929 
930  p->alpha = 1.0;
931  p->alphavel = -1.0 / (0.3 + frand() * 0.2);
932  p->color = 0xe0;
933  for (j = 0; j < 3; j++) {
934  p->org[j] = move[j] + crand();
935  p->vel[j] = crand() * 15;
936  p->accel[j] = 0;
937  }
938  p->accel[2] = PARTICLE_GRAVITY;
939 
940  VectorAdd(move, vec, move);
941  }
942 
943  {
944  int i, j, k;
945  cparticle_t *p;
946  float vel;
947  vec3_t dir;
948  vec3_t org;
949 
950  ent->origin[2] += 14;
951  VectorCopy(ent->origin, org);
952 
953  for (i = -2; i <= 2; i += 4)
954  for (j = -2; j <= 2; j += 4)
955  for (k = -2; k <= 4; k += 4) {
956  p = CL_AllocParticle();
957  if (!p)
958  return;
959 
960  p->time = cl.time;
961  p->color = 0xe0 + (rand() & 3);
962 
963  p->alpha = 1.0;
964  p->alphavel = -1.0 / (0.3 + (rand() & 7) * 0.02);
965 
966  p->org[0] = org[0] + i + ((rand() & 23) * crand());
967  p->org[1] = org[1] + j + ((rand() & 23) * crand());
968  p->org[2] = org[2] + k + ((rand() & 23) * crand());
969 
970  dir[0] = j * 8;
971  dir[1] = i * 8;
972  dir[2] = k * 8;
973 
974  VectorNormalize(dir);
975  vel = 50 + (rand() & 63);
976  VectorScale(dir, vel, p->vel);
977 
978  p->accel[0] = p->accel[1] = 0;
979  p->accel[2] = -PARTICLE_GRAVITY;
980  }
981  }
982 }

Referenced by CL_AddPacketEntities().

◆ CL_UpdateBlendSetting()

void CL_UpdateBlendSetting ( void  )

Definition at line 292 of file view.c.

293 {
294  if (cls.state < ca_connected) {
295  return;
296  }
297  if (cls.serverProtocol < PROTOCOL_VERSION_R1Q2) {
298  return;
299  }
300 
301  MSG_WriteByte(clc_setting);
302  MSG_WriteShort(CLS_NOBLEND);
303  MSG_WriteShort(!cl_add_blend->integer);
304  MSG_FlushTo(&cls.netchan->message);
305 }

Referenced by cl_add_blend_changed(), and CL_Begin().

◆ CL_UpdateCmd()

void CL_UpdateCmd ( int  msec)

Definition at line 655 of file input.c.

656 {
657  VectorClear(cl.localmove);
658 
659  if (sv_paused->integer) {
660  return;
661  }
662 
663  // add to milliseconds of time to apply the move
664  cl.cmd.msec += msec;
665 
666  // adjust viewangles
667  CL_AdjustAngles(msec);
668 
669  // get basic movement from keyboard
671 
672  // allow mice to add to the move
673  CL_MouseMove();
674 
675  // add accumulated mouse forward/side movement
676  cl.localmove[0] += cl.mousemove[0];
677  cl.localmove[1] += cl.mousemove[1];
678 
679  // clamp to server defined max speed
681 
682  CL_ClampPitch();
683 
684  cl.cmd.angles[0] = ANGLE2SHORT(cl.viewangles[0]);
685  cl.cmd.angles[1] = ANGLE2SHORT(cl.viewangles[1]);
686  cl.cmd.angles[2] = ANGLE2SHORT(cl.viewangles[2]);
687 }

Referenced by CL_Frame().

◆ CL_UpdateConfigstring()

void CL_UpdateConfigstring ( int  index)

Definition at line 417 of file precache.c.

418 {
419  const char *s = cl.configstrings[index];
420 
421  if (index == CS_MAXCLIENTS) {
422  cl.maxclients = atoi(s);
423  return;
424  }
425 
426  if (index == CS_AIRACCEL) {
427  if (cl.pmp.qwmode)
428  cl.pmp.airaccelerate = qtrue;
429  else
430  cl.pmp.airaccelerate = atoi(s) ? qtrue : qfalse;
431  return;
432  }
433 
434  if (index == CS_MODELS + 1) {
435  size_t len = strlen(s);
436 
437  if (len <= 9) {
438  Com_Error(ERR_DROP, "%s: bad world model: %s", __func__, s);
439  }
440  memcpy(cl.mapname, s + 5, len - 9); // skip "maps/"
441  cl.mapname[len - 9] = 0; // cut off ".bsp"
442  return;
443  }
444 
445 #if USE_LIGHTSTYLES
446  if (index >= CS_LIGHTS && index < CS_LIGHTS + MAX_LIGHTSTYLES) {
447  CL_SetLightStyle(index - CS_LIGHTS, s);
448  return;
449  }
450 #endif
451 
452  if (cls.state < ca_precached) {
453  return;
454  }
455 
456  if (index >= CS_MODELS + 2 && index < CS_MODELS + MAX_MODELS) {
457  int i = index - CS_MODELS;
458 
459  cl.model_draw[i] = R_RegisterModel(s);
460  if (*s == '*')
462  else
463  cl.model_clip[i] = NULL;
464  return;
465  }
466 
467  if (index >= CS_SOUNDS && index < CS_SOUNDS + MAX_SOUNDS) {
468  cl.sound_precache[index - CS_SOUNDS] = S_RegisterSound(s);
469  return;
470  }
471 
472  if (index >= CS_IMAGES && index < CS_IMAGES + MAX_IMAGES) {
473  cl.image_precache[index - CS_IMAGES] = R_RegisterPic2(s);
474  return;
475  }
476 
477  if (index >= CS_PLAYERSKINS && index < CS_PLAYERSKINS + MAX_CLIENTS) {
478  CL_LoadClientinfo(&cl.clientinfo[index - CS_PLAYERSKINS], s);
479  return;
480  }
481 }

Referenced by CL_ParseConfigstring(), and CL_Seek_f().

◆ CL_UpdateFrameTimes()

void CL_UpdateFrameTimes ( void  )

Definition at line 3136 of file main.c.

3137 {
3138  if (!cls.state) {
3139  return; // not yet fully initialized
3140  }
3141 
3142  // check if video driver supports syncing to vertical retrace
3143  if (cl_async->integer > 1 && !(r_config.flags & QVF_VIDEOSYNC)) {
3144  Cvar_Reset(cl_async);
3145  }
3146 
3147  if (com_timedemo->integer) {
3148  // timedemo just runs at full speed
3149  ref_msec = phys_msec = main_msec = 0;
3150  sync_mode = SYNC_FULL;
3151  } else if (cls.active == ACT_MINIMIZED) {
3152  // run at 10 fps if minimized
3153  ref_msec = phys_msec = 0;
3154  main_msec = fps_to_msec(10);
3156  } else if (cls.active == ACT_RESTORED || cls.state != ca_active) {
3157  // run at 60 fps if not active
3158  ref_msec = phys_msec = 0;
3159  if (cl_async->integer > 1) {
3160  main_msec = 0;
3162  } else {
3163  main_msec = fps_to_msec(60);
3165  }
3166  } else if (cl_async->integer > 0) {
3167  // run physics and refresh separately
3169  if (cl_async->integer > 1) {
3170  ref_msec = 0;
3172  } else if (r_maxfps->integer) {
3175  } else {
3176  ref_msec = 1;
3178  }
3179  main_msec = 0;
3180  } else {
3181  // everything ticks in sync with refresh
3182  phys_msec = ref_msec = 0;
3183  if (cl_maxfps->integer) {
3186  } else {
3187  main_msec = 1;
3188  sync_mode = SYNC_FULL;
3189  }
3190  }
3191 
3192  Com_DDDPrintf("%s: mode=%s main_msec=%d ref_msec=%d, phys_msec=%d\n",
3193  __func__, sync_names[sync_mode], main_msec, ref_msec, phys_msec);
3194 
3196 }

Referenced by CL_Activate(), CL_Changing_f(), CL_ClearState(), CL_Disconnect(), CL_InitLocal(), CL_RestartFilesystem(), CL_RestartRefresh(), cl_sync_changed(), SCR_ModeChanged(), and set_active_state().

◆ CL_UpdateRecordingSetting()

void CL_UpdateRecordingSetting ( void  )

Definition at line 265 of file main.c.

266 {
267  int rec;
268 
269  if (!cls.netchan) {
270  return;
271  }
272  if (cls.serverProtocol < PROTOCOL_VERSION_R1Q2) {
273  return;
274  }
275 
276  if (cls.demo.recording) {
277  rec = 1;
278  } else {
279  rec = 0;
280  }
281 
282 #if USE_CLIENT_GTV
283  if (cls.gtv.state == ca_active) {
284  rec |= 1;
285  }
286 #endif
287 
288  MSG_WriteByte(clc_setting);
289  MSG_WriteShort(CLS_RECORDING);
290  MSG_WriteShort(rec);
291  MSG_FlushTo(&cls.netchan->message);
292 }

Referenced by CL_Begin(), CL_Record_f(), CL_Stop_f(), parse_stream_start(), and parse_stream_stop().

◆ CL_Widowbeamout()

void CL_Widowbeamout ( cl_sustain_t self)

Definition at line 520 of file newfx.c.

521 {
522  static const byte colortable[4] = {2 * 8, 13 * 8, 21 * 8, 18 * 8};
523  vec3_t dir;
524  int i;
525  cparticle_t *p;
526  float ratio;
527 
528  ratio = 1.0 - (((float)self->endtime - (float)cl.time) / 2100.0);
529 
530  for (i = 0; i < 300; i++) {
531  p = CL_AllocParticle();
532  if (!p)
533  return;
534  VectorClear(p->accel);
535 
536  p->time = cl.time;
537 
538  p->alpha = 1.0;
540  p->color = colortable[rand() & 3];
541 
542  dir[0] = crand();
543  dir[1] = crand();
544  dir[2] = crand();
545  VectorNormalize(dir);
546 
547  VectorMA(self->org, (45.0 * ratio), dir, p->org);
548  }
549 }

Referenced by CL_ParseWidow().

◆ CL_WidowSplash()

void CL_WidowSplash ( void  )

Definition at line 582 of file newfx.c.

583 {
584  static const byte colortable[4] = {2 * 8, 13 * 8, 21 * 8, 18 * 8};
585  int i;
586  cparticle_t *p;
587  vec3_t dir;
588 
589  for (i = 0; i < 256; i++) {
590  p = CL_AllocParticle();
591  if (!p)
592  return;
593 
594  p->time = cl.time;
595  p->color = colortable[rand() & 3];
596 
597  dir[0] = crand();
598  dir[1] = crand();
599  dir[2] = crand();
600  VectorNormalize(dir);
601  VectorMA(te.pos1, 45.0, dir, p->org);
602  VectorMA(vec3_origin, 40.0, dir, p->vel);
603 
604  p->accel[0] = p->accel[1] = 0;
605  p->alpha = 1.0;
606 
607  p->alphavel = -0.8 / (0.5 + frand() * 0.3);
608  }
609 }

Referenced by CL_ParseTEnt().

◆ CL_WriteConfig()

void CL_WriteConfig ( void  )

Definition at line 2391 of file main.c.

2392 {
2393  qhandle_t f;
2394  qerror_t ret;
2395 
2396  ret = FS_FOpenFile(COM_CONFIG_CFG, &f, FS_MODE_WRITE | FS_FLAG_TEXT);
2397  if (!f) {
2398  Com_EPrintf("Couldn't open %s for writing: %s\n",
2399  COM_CONFIG_CFG, Q_ErrorString(ret));
2400  return;
2401  }
2402 
2403  FS_FPrintf(f, "// generated by " APPLICATION ", do not modify\n");
2404 
2405  Key_WriteBindings(f);
2406  Cvar_WriteVariables(f, CVAR_ARCHIVE, qfalse);
2407 
2408  FS_FCloseFile(f);
2409 }

Referenced by CL_RestartFilesystem(), CL_Shutdown(), and UI_PopMenu().

◆ CL_WriteDemoMessage()

qboolean CL_WriteDemoMessage ( sizebuf_t *  buf)

Definition at line 41 of file demo.c.

42 {
43  uint32_t msglen;
44  ssize_t ret;
45 
46  if (buf->overflowed) {
47  SZ_Clear(buf);
48  Com_WPrintf("Demo message overflowed (should never happen).\n");
49  return qtrue;
50  }
51 
52  if (!buf->cursize)
53  return qtrue;
54 
55  msglen = LittleLong(buf->cursize);
56  ret = FS_Write(&msglen, 4, cls.demo.recording);
57  if (ret != 4)
58  goto fail;
59  ret = FS_Write(buf->data, buf->cursize, cls.demo.recording);
60  if (ret != buf->cursize)
61  goto fail;
62 
63  Com_DDPrintf("%s: wrote %"PRIz" bytes\n", __func__, buf->cursize);
64 
65  SZ_Clear(buf);
66  return qtrue;
67 
68 fail:
69  SZ_Clear(buf);
70  Com_EPrintf("Couldn't write demo: %s\n", Q_ErrorString(ret));
71  CL_Stop_f();
72  return qfalse;
73 }

Referenced by CL_PacketEvent(), CL_Record_f(), parse_next_message(), and resume_record().

◆ COM_BlockSequenceCRCByte()

byte COM_BlockSequenceCRCByte ( byte *  base,
size_t  length,
int  sequence 
)

Definition at line 148 of file crc.c.

149 {
150  int n;
151  const byte *p;
152  int x;
153  byte chkb[60 + 4];
154  unsigned short crc;
155 
156  if (sequence < 0)
157  Com_Error(ERR_DROP, "%s: sequence < 0", __func__);
158 
159  p = chktbl + (sequence % (sizeof(chktbl) - 4));
160 
161  if (length > 60)
162  length = 60;
163  memcpy(chkb, base, length);
164 
165  chkb[length] = p[0];
166  chkb[length + 1] = p[1];
167  chkb[length + 2] = p[2];
168  chkb[length + 3] = p[3];
169 
170  length += 4;
171 
172  crc = CRC_Block(chkb, length);
173 
174  for (x = 0, n = 0; n < length; n++)
175  x += chkb[n];
176 
177  crc = (crc ^ x) & 0xff;
178 
179  return crc;
180 }

Referenced by CL_SendDefaultCmd().

◆ Con_CheckResize()

void Con_CheckResize ( void  )

Definition at line 367 of file console.c.

368 {
369  int width;
370 
372 
373  con.vidWidth = r_config.width * con.scale;
374  con.vidHeight = r_config.height * con.scale;
375 
376  width = (con.vidWidth / CHAR_WIDTH) - 2;
377 
379  con.prompt.inputLine.visibleChars = con.linewidth;
380  con.prompt.widthInChars = con.linewidth - 1; // account for color byte
381  con.chatPrompt.inputLine.visibleChars = con.linewidth;
382 }

Referenced by Con_Init(), con_scale_changed(), and SCR_ModeChanged().

◆ Con_ClearNotify_f()

void Con_ClearNotify_f ( void  )

Definition at line 276 of file console.c.

277 {
278  int i;
279 
280  for (i = 0; i < CON_TIMES; i++)
281  con.times[i] = 0;
282 }

Referenced by CL_PrepRefresh(), Con_Close(), SCR_CenterPrint(), SCR_EndLoadingPlaque(), and toggle_console().

◆ Con_ClearTyping()

void Con_ClearTyping ( void  )

Definition at line 109 of file console.c.

110 {
111  // clear any typing
112  IF_Clear(&con.prompt.inputLine);
114 }

Referenced by Con_Close(), and toggle_console().

◆ Con_Close()

void Con_Close ( qboolean  force)

Definition at line 124 of file console.c.

125 {
126  if (con.mode > CON_POPUP && !force) {
127  return;
128  }
129 
130  // if not connected, console or menu should be up
131  if (cls.state < ca_active && !(cls.key_dest & KEY_MENU)) {
132  return;
133  }
134 
135  Con_ClearTyping();
137 
138  Key_SetDest(cls.key_dest & ~KEY_CONSOLE);
139 
141  con.mode = CON_POPUP;
142  con.chat = CHAT_NONE;
143 }

Referenced by CL_RestartFilesystem(), CL_RestartRefresh(), Key_Event(), SCR_PlayCinematic(), set_active_state(), start_message_mode(), and UI_PushMenu().

◆ Con_DrawConsole()

void Con_DrawConsole ( void  )

Definition at line 1032 of file console.c.

1033 {
1034  R_SetScale(con.scale);
1036  Con_DrawNotify();
1037  R_SetScale(1.0f);
1038 }

Referenced by SCR_UpdateScreen().

◆ Con_Init()

void Con_Init ( void  )

Definition at line 436 of file console.c.

437 {
438  memset(&con, 0, sizeof(con));
439 
440 //
441 // register our commands
442 //
444 
445  con_notifytime = Cvar_Get("con_notifytime", "3", 0);
446  con_notifylines = Cvar_Get("con_notifylines", "4", 0);
447  con_clock = Cvar_Get("con_clock", "0", 0);
448  con_height = Cvar_Get("con_height", "0.5", 0);
449  con_speed = Cvar_Get("scr_conspeed", "3", 0);
450  con_alpha = Cvar_Get("con_alpha", "1", 0);
451  con_scale = Cvar_Get("con_scale", "1", 0);
452  con_scale->changed = con_scale_changed;
453  con_font = Cvar_Get("con_font", "conchars", 0);
454  con_font->changed = con_param_changed;
455  con_background = Cvar_Get("con_background", "conback", 0);
457  con_scroll = Cvar_Get("con_scroll", "0", 0);
458  con_history = Cvar_Get("con_history", "0", 0);
459 
460  IF_Init(&con.prompt.inputLine, 0, MAX_FIELD_TEXT - 1);
461  IF_Init(&con.chatPrompt.inputLine, 0, MAX_FIELD_TEXT - 1);
462 
463  con.prompt.printf = Con_Printf;
464 
465  // use default width since no video is initialized yet
466  r_config.width = 640;
467  r_config.height = 480;
468  con.linewidth = -1;
469  con.scale = 1;
470  con.color = COLOR_NONE;
471  con.text[0][0] = COLOR_NONE;
472  con.x = 1;
473 
474  Con_CheckResize();
475 
476  con.initialized = qtrue;
477 }

Referenced by Qcommon_Init().

◆ Con_Popup()

void Con_Popup ( qboolean  force)

Definition at line 152 of file console.c.

153 {
154  if (force) {
155  con.mode = CON_POPUP;
156  }
157 
158  Key_SetDest(cls.key_dest | KEY_CONSOLE);
159  Con_RunConsole();
160 }

Referenced by CL_CheckForResend(), CL_Connect_f(), CL_PlayDemo_f(), CL_RestartFilesystem(), and CL_RestartRefresh().

◆ Con_PostInit()

void Con_PostInit ( void  )

Definition at line 479 of file console.c.

480 {
481  if (con_history->integer > 0) {
482  Prompt_LoadHistory(&con.prompt, COM_HISTORYFILE_NAME);
483  }
484 }

Referenced by CL_Init().

◆ Con_Print()

void Con_Print ( const char *  txt)

Definition at line 557 of file console.c.

558 {
559  char *p;
560  int l;
561 
562  if (!con.initialized)
563  return;
564 
565  while (*txt) {
566  if (con.newline) {
567  if (con.newline == '\n') {
568  Con_Linefeed();
569  } else {
570  Con_CarriageRet();
571  }
572  con.newline = 0;
573  }
574 
575  // count word length
576  for (p = (char *)txt; *p > 32; p++)
577  ;
578  l = p - txt;
579 
580  // word wrap
581  if (l < con.linewidth && con.x + l > con.linewidth) {
582  Con_Linefeed();
583  }
584 
585  switch (*txt) {
586  case '\r':
587  case '\n':
588  con.newline = *txt;
589  break;
590  default: // display character and advance
591  if (con.x == con.linewidth) {
592  Con_Linefeed();
593  }
595  p[con.x++] = *txt;
596  break;
597  }
598 
599  txt++;
600  }
601 }

Referenced by Com_LPrintf(), and Con_Printf().

◆ Con_RegisterMedia()

void Con_RegisterMedia ( void  )

Definition at line 628 of file console.c.

629 {
630  qerror_t err;
631 
632  con.charsetImage = R_RegisterImage(con_font->string, IT_FONT, IF_PERMANENT | IF_SRGB, &err);
633  if (!con.charsetImage) {
634  if (strcmp(con_font->string, "conchars")) {
635  Com_WPrintf("Couldn't load %s: %s\n", con_font->string, Q_ErrorString(err));
636  Cvar_Reset(con_font);
637  con.charsetImage = R_RegisterImage("conchars", IT_FONT, IF_PERMANENT | IF_SRGB, &err);
638  }
639  if (!con.charsetImage) {
640  Com_Error(ERR_FATAL, "Couldn't load pics/conchars.pcx: %s", Q_ErrorString(err));
641  }
642  }
643 
644  con.backImage = R_RegisterImage(con_background->string, IT_PIC, IF_PERMANENT | IF_SRGB, &err);
645  if (!con.backImage) {
646  if (strcmp(con_background->string, "conback")) {
647  Com_WPrintf("Couldn't load %s: %s\n", con_background->string, Q_ErrorString(err));
648  Cvar_Reset(con_background);
649  con.backImage = R_RegisterImage("conback", IT_PIC, IF_PERMANENT | IF_SRGB, &err);
650  }
651  if (!con.backImage) {
652  Com_EPrintf("Couldn't load pics/conback.pcx: %s\n", Q_ErrorString(err));
653  }
654  }
655 }

Referenced by CL_InitRefresh(), CL_RestartFilesystem(), CL_RestartRefresh(), and con_param_changed().

◆ Con_RunConsole()

void Con_RunConsole ( void  )

Definition at line 982 of file console.c.

983 {
984  if (cls.disable_screen) {
986  return;
987  }
988 
989  if (!(cls.key_dest & KEY_MENU)) {
990  if (cls.state == ca_disconnected) {
991  // draw fullscreen console
993  return;
994  }
996  // draw half-screen console
997  con.destHeight = con.currentHeight = 0.5f;
998  return;
999  }
1000  }
1001 
1002 // decide on the height of the console
1003  if (cls.key_dest & KEY_CONSOLE) {
1005  } else {
1006  con.destHeight = 0; // none visible
1007  }
1008 
1009  if (con_speed->value <= 0) {
1011  return;
1012  }
1013 
1014  if (con.currentHeight > con.destHeight) {
1015  con.currentHeight -= con_speed->value * cls.frametime;
1016  if (con.currentHeight < con.destHeight) {
1018  }
1019  } else if (con.currentHeight < con.destHeight) {
1020  con.currentHeight += con_speed->value * cls.frametime;
1021  if (con.currentHeight > con.destHeight) {
1023  }
1024  }
1025 }

Referenced by CL_Frame(), CL_Init(), and Con_Popup().

◆ Con_Shutdown()

void Con_Shutdown ( void  )

Definition at line 491 of file console.c.

492 {
493  if (con_history->integer > 0) {
494  Prompt_SaveHistory(&con.prompt, COM_HISTORYFILE_NAME, con_history->integer);
495  }
497 }

Referenced by CL_Shutdown().

◆ Con_SkipNotify()

void Con_SkipNotify ( qboolean  skip)

Definition at line 99 of file console.c.

100 {
101  con.skipNotify = skip;
102 }

Referenced by CL_ParsePrint().

◆ Con_ToggleConsole_f()

void Con_ToggleConsole_f ( void  )

Definition at line 194 of file console.c.

195 {
197 }

Referenced by Key_Event().

◆ FX_Init()

void FX_Init ( void  )

Definition at line 838 of file effects.c.

839 {
840  cvar_pt_particle_emissive = Cvar_Get("pt_particle_emissive", "10.0", 0);
841  cl_particle_num_factor = Cvar_Get("cl_particle_num_factor", "1", 0);
842 }

Referenced by CL_InitRefresh().

◆ IN_Activate()

void IN_Activate ( void  )

Definition at line 117 of file input.c.

118 {
119  if (input.api.Grab) {
120  input.api.Grab(IN_GetCurrentGrab());
121  }
122 }

Referenced by check_paused(), CL_Activate(), CL_CheckForPause(), CL_DeltaFrame(), in_changed_soft(), IN_Init(), Key_Event(), Key_SetDest(), and SCR_ModeChanged().

◆ IN_Frame()

void IN_Frame ( void  )

Definition at line 140 of file input.c.

141 {
142  if (input.modified) {
143  IN_Restart_f();
144  return;
145  }
146 
147  if (input.api.GetEvents) {
148  input.api.GetEvents();
149  }
150 
151 #if USE_LIRC
152  Lirc_GetEvents();
153 #endif
154 }

Referenced by CL_ProcessEvents().

◆ IN_Init()

void IN_Init ( void  )

Definition at line 210 of file input.c.

211 {
212  qboolean ret = qfalse;
213 
214 #if USE_LIRC
215  Lirc_Init();
216 #endif
217 
218  in_enable = Cvar_Get("in_enable", "1", 0);
219  in_enable->changed = in_changed_hard;
220  if (!in_enable->integer) {
221  Com_Printf("Mouse input disabled.\n");
222  return;
223  }
224 
225 #if USE_DINPUT
226  in_direct = Cvar_Get("in_direct", "1", 0);
227  if (in_direct->integer) {
228  DI_FillAPI(&input.api);
229  ret = input.api.Init();
230  if (!ret) {
231  Cvar_Set("in_direct", "0");
232  }
233  }
234 #endif
235 
236  if (!ret) {
238  ret = input.api.Init();
239  if (!ret) {
240  Cvar_Set("in_enable", "0");
241  return;
242  }
243  }
244 
245 #if USE_DINPUT
246  in_direct->changed = in_changed_hard;
247 #endif
248 
249  in_grab = Cvar_Get("in_grab", "1", 0);
250  in_grab->changed = in_changed_soft;
251 
252  IN_Activate();
253 }

Referenced by CL_Init(), CL_RestartRefresh(), and IN_Restart_f().

◆ IN_Shutdown()

void IN_Shutdown ( void  )

Definition at line 173 of file input.c.

174 {
175 #if USE_DINPUT
176  if (in_direct) {
177  in_direct->changed = NULL;
178  }
179 #endif
180  if (in_grab) {
181  in_grab->changed = NULL;
182  }
183 
184  if (input.api.Shutdown) {
185  input.api.Shutdown();
186  }
187 
188 #if USE_LIRC
189  Lirc_Shutdown();
190 #endif
191 
192  memset(&input, 0, sizeof(input));
193 }

Referenced by CL_RestartRefresh(), CL_Shutdown(), and IN_Restart_f().

◆ Key_Console()

void Key_Console ( int  key)

Definition at line 1137 of file console.c.

1138 {
1139  if (key == 'l' && Key_IsDown(K_CTRL)) {
1140  Con_Clear_f();
1141  return;
1142  }
1143 
1144  if (key == 'd' && Key_IsDown(K_CTRL)) {
1145  con.mode = CON_DEFAULT;
1146  return;
1147  }
1148 
1149  if (key == K_ENTER || key == K_KP_ENTER) {
1150  Con_Action();
1151  goto scroll;
1152  }
1153 
1154  if ((key == 'v' && Key_IsDown(K_CTRL)) ||
1155  (key == K_INS && Key_IsDown(K_SHIFT)) || key == K_MOUSE3) {
1156  Con_Paste();
1157  goto scroll;
1158  }
1159 
1160  if (key == K_TAB) {
1162  goto scroll;
1163  }
1164 
1165  if (key == 'r' && Key_IsDown(K_CTRL)) {
1166  Prompt_CompleteHistory(&con.prompt, qfalse);
1167  goto scroll;
1168  }
1169 
1170  if (key == 's' && Key_IsDown(K_CTRL)) {
1172  goto scroll;
1173  }
1174 
1175  if (key == K_UPARROW || (key == 'p' && Key_IsDown(K_CTRL))) {
1177  goto scroll;
1178  }
1179 
1180  if (key == K_DOWNARROW || (key == 'n' && Key_IsDown(K_CTRL))) {
1182  goto scroll;
1183  }
1184 
1185  if (key == K_PGUP || key == K_MWHEELUP) {
1186  if (Key_IsDown(K_CTRL)) {
1187  con.display -= 6;
1188  } else {
1189  con.display -= 2;
1190  }
1191  Con_CheckTop();
1192  return;
1193  }
1194 
1195  if (key == K_PGDN || key == K_MWHEELDOWN) {
1196  if (Key_IsDown(K_CTRL)) {
1197  con.display += 6;
1198  } else {
1199  con.display += 2;
1200  }
1201  if (con.display > con.current) {
1202  con.display = con.current;
1203  }
1204  return;
1205  }
1206 
1207  if (key == K_HOME && Key_IsDown(K_CTRL)) {
1208  con.display = 1;
1209  Con_CheckTop();
1210  return;
1211  }
1212 
1213  if (key == K_END && Key_IsDown(K_CTRL)) {
1214  con.display = con.current;
1215  return;
1216  }
1217 
1218  if (IF_KeyEvent(&con.prompt.inputLine, key)) {
1221  }
1222 
1223 scroll:
1224  if (con_scroll->integer & 1) {
1225  con.display = con.current;
1226  }
1227 }

Referenced by Key_Event().

◆ Key_Message()

void Key_Message ( int  key)

Definition at line 1241 of file console.c.

1242 {
1243  if (key == 'l' && Key_IsDown(K_CTRL)) {
1244  IF_Clear(&con.chatPrompt.inputLine);
1245  return;
1246  }
1247 
1248  if (key == K_ENTER || key == K_KP_ENTER) {
1249  char *cmd = Prompt_Action(&con.chatPrompt);
1250 
1251  if (cmd) {
1252  Con_Say(cmd);
1253  }
1254  Key_SetDest(cls.key_dest & ~KEY_MESSAGE);
1255  return;
1256  }
1257 
1258  if (key == K_ESCAPE) {
1259  Key_SetDest(cls.key_dest & ~KEY_MESSAGE);
1260  IF_Clear(&con.chatPrompt.inputLine);
1261  return;
1262  }
1263 
1264  if (key == 'r' && Key_IsDown(K_CTRL)) {
1266  return;
1267  }
1268 
1269  if (key == 's' && Key_IsDown(K_CTRL)) {
1271  return;
1272  }
1273 
1274  if (key == K_UPARROW || (key == 'p' && Key_IsDown(K_CTRL))) {
1276  return;
1277  }
1278 
1279  if (key == K_DOWNARROW || (key == 'n' && Key_IsDown(K_CTRL))) {
1281  return;
1282  }
1283 
1284  if (IF_KeyEvent(&con.chatPrompt.inputLine, key)) {
1286  }
1287 }

Referenced by Key_Event().

◆ LOC_AddLocationsToScene()

void LOC_AddLocationsToScene ( void  )

Definition at line 177 of file locs.c.

178 {
179  location_t *loc, *nearest;
180  vec3_t dir;
181  float dist;
182  entity_t ent;
183 
184  if (!loc_draw->integer) {
185  return;
186  }
187 
188  memset(&ent, 0, sizeof(ent));
189  ent.model = R_RegisterModel("models/items/c_head/tris.md2");
190  ent.skin = R_RegisterSkin("models/items/c_head/skin.pcx");
191 
193  if (!nearest) {
194  return;
195  }
196 
197  LIST_FOR_EACH(location_t, loc, &cl_locations, entry) {
198  VectorSubtract(cl.playerEntityOrigin, loc->origin, dir);
199  dist = VectorLength(dir);
200 
201  if (dist > loc_dist->integer) {
202  continue;
203  }
204 
205  VectorCopy(loc->origin, ent.origin);
206 
207  if (loc == nearest) {
208  ent.origin[2] += 10.0f * sin(cl.time * 0.01f);
209  V_AddLight(loc->origin, 200, 1, 1, 1);
210  }
211 
212  V_AddEntity(&ent);
213  }
214 }

Referenced by CL_AddEntities().

◆ LOC_FreeLocations()

void LOC_FreeLocations ( void  )

Definition at line 122 of file locs.c.

123 {
124  location_t *loc, *next;
125 
126  LIST_FOR_EACH_SAFE(location_t, loc, next, &cl_locations, entry) {
127  Z_Free(loc);
128  }
129 
130  List_Init(&cl_locations);
131 }

Referenced by CL_ClearState().

◆ LOC_Init()

void LOC_Init ( void  )

Definition at line 376 of file locs.c.

377 {
378  loc_trace = Cvar_Get("loc_trace", "0", 0);
379  loc_draw = Cvar_Get("loc_draw", "0", 0);
380  loc_dist = Cvar_Get("loc_dist", "500", 0);
381 
382  Cmd_AddMacro("loc_here", LOC_Here_m);
383  Cmd_AddMacro("loc_there", LOC_There_m);
384 
385  Cmd_AddCommand("loc_add", LOC_Add_f);
386  Cmd_AddCommand("loc_delete", LOC_Delete_f);
387  Cmd_AddCommand("loc_update", LOC_Update_f);
388  Cmd_AddCommand("loc_write", LOC_Write_f);
389 }

Referenced by CL_InitLocal().

◆ LOC_LoadLocations()

void LOC_LoadLocations ( void  )

Definition at line 59 of file locs.c.

60 {
61  char path[MAX_OSPATH];
62  char *buffer, *s, *p;
63  int line, count;
64  location_t *loc;
65  int argc;
66  qerror_t ret;
67 
68  // load from main directory
69  Q_concat(path, sizeof(path), "locs/", cl.mapname, ".loc", NULL);
70 
71  ret = FS_LoadFile(path, (void **)&buffer);
72  if (!buffer) {
73  if (ret != Q_ERR_NOENT) {
74  Com_EPrintf("Couldn't load %s: %s\n", path, Q_ErrorString(ret));
75  }
76  return;
77  }
78 
79  s = buffer;
80  line = count = 0;
81  while (*s) {
82  p = strchr(s, '\n');
83  if (p) {
84  *p = 0;
85  }
86 
87  Cmd_TokenizeString(s, qfalse);
88  line++;
89 
90  argc = Cmd_Argc();
91  if (argc) {
92  if (argc < 4) {
93  Com_WPrintf("Line %d is incomplete in %s\n", line, path);
94  } else {
95  loc = LOC_Alloc(Cmd_RawArgsFrom(3));
96  loc->origin[0] = atof(Cmd_Argv(0)) * 0.125f;
97  loc->origin[1] = atof(Cmd_Argv(1)) * 0.125f;
98  loc->origin[2] = atof(Cmd_Argv(2)) * 0.125f;
99  List_Append(&cl_locations, &loc->entry);
100  count++;
101  }
102  }
103 
104  if (!p) {
105  break;
106  }
107 
108  s = p + 1;
109  }
110 
111  Com_DPrintf("Loaded %d location%s from %s\n",
112  count, count == 1 ? "" : "s", path);
113 
114  FS_FreeFile(buffer);
115 }

Referenced by CL_Begin().

◆ LOC_UpdateCvars()

void LOC_UpdateCvars ( void  )

◆ SCR_AddToChatHUD()

void SCR_AddToChatHUD ( const char *  text)

Definition at line 903 of file screen.c.

904 {
905  chatline_t *line;
906  char *p;
907 
909  Q_strlcpy(line->text, text, sizeof(line->text));
910  line->time = cls.realtime;
911 
912  p = strrchr(line->text, '\n');
913  if (p)
914  *p = 0;
915 }

Referenced by CL_ParsePrint().

◆ SCR_BeginLoadingPlaque()

void SCR_BeginLoadingPlaque ( void  )

Definition at line 1424 of file screen.c.

1425 {
1426  if (!cls.state) {
1427  return;
1428  }
1429 
1430  if (cls.disable_screen) {
1431  return;
1432  }
1433 
1434 #ifdef _DEBUG
1435  if (developer->integer) {
1436  return;
1437  }
1438 #endif
1439 
1440  // if at console or menu, don't bring up the plaque
1441  if (cls.key_dest & (KEY_CONSOLE | KEY_MENU)) {
1442  return;
1443  }
1444 
1445  scr.draw_loading = qtrue;
1446  SCR_UpdateScreen();
1447 
1449 }

Referenced by CL_Changing_f(), SCR_RunCinematic(), SV_InitGame(), and SV_SpawnServer().

◆ SCR_CenterPrint()

void SCR_CenterPrint ( const char *  str)

Definition at line 462 of file screen.c.

463 {
464  const char *s;
465 
467  if (!strcmp(scr_centerstring, str)) {
468  return;
469  }
470 
472 
473  // count the number of lines for centering
474  scr_center_lines = 1;
475  s = str;
476  while (*s) {
477  if (*s == '\n')
479  s++;
480  }
481 
482  // echo it to the console
483  Com_Printf("%s\n", scr_centerstring);
485 }

Referenced by CL_ParseCenterPrint().

◆ SCR_ClearChatHUD_f()

void SCR_ClearChatHUD_f ( void  )

Definition at line 897 of file screen.c.

898 {
899  memset(scr_chatlines, 0, sizeof(scr_chatlines));
900  scr_chathead = 0;
901 }

Referenced by CL_Disconnect().

◆ SCR_DebugGraph()

void SCR_DebugGraph ( float  value,
int  color 
)

Referenced by PF_DebugGraph(), and SCR_UpdateScreen().

◆ SCR_DrawStringEx()

int SCR_DrawStringEx ( int  x,
int  y,
int  flags,
size_t  maxlen,
const char *  s,
qhandle_t  font 
)

Definition at line 139 of file screen.c.

141 {
142  size_t len = strlen(s);
143 
144  if (len > maxlen) {
145  len = maxlen;
146  }
147 
148  if ((flags & UI_CENTER) == UI_CENTER) {
149  x -= len * CHAR_WIDTH / 2;
150  } else if (flags & UI_RIGHT) {
151  x -= len * CHAR_WIDTH;
152  }
153 
154  return R_DrawString(x, y, flags, maxlen, s, font);
155 }

Referenced by Con_DrawSolidConsole(), draw_shadowed_string(), and SCR_DrawStringMulti().

◆ SCR_DrawStringMulti()

void SCR_DrawStringMulti ( int  x,
int  y,
int  flags,
size_t  maxlen,
const char *  s,
qhandle_t  font 
)

Definition at line 163 of file screen.c.

165 {
166  char *p;
167  size_t len;
168 
169  while (*s) {
170  p = strchr(s, '\n');
171  if (!p) {
172  SCR_DrawStringEx(x, y, flags, maxlen, s, font);
173  break;
174  }
175 
176  len = p - s;
177  if (len > maxlen) {
178  len = maxlen;
179  }
180  SCR_DrawStringEx(x, y, flags, len, s, font);
181 
182  y += CHAR_HEIGHT;
183  s = p + 1;
184  }
185 }

Referenced by SCR_DrawCenterString().

◆ SCR_EndLoadingPlaque()

void SCR_EndLoadingPlaque ( void  )

Definition at line 1456 of file screen.c.

1457 {
1458  if (!cls.state) {
1459  return;
1460  }
1461  cls.disable_screen = 0;
1463 }

Referenced by CL_Disconnect(), Qcommon_Init(), SCR_PlayCinematic(), set_active_state(), and toggle_console().

◆ SCR_FadeAlpha()

float SCR_FadeAlpha ( unsigned  startTime,
unsigned  visTime,
unsigned  fadeTime 
)

Definition at line 193 of file screen.c.

194 {
195  float alpha;
196  unsigned timeLeft, delta = cls.realtime - startTime;
197 
198  if (delta >= visTime) {
199  return 0;
200  }
201 
202  if (fadeTime > visTime) {
203  fadeTime = visTime;
204  }
205 
206  alpha = 1;
207  timeLeft = visTime - delta;
208  if (timeLeft < fadeTime) {
209  alpha = (float)timeLeft / fadeTime;
210  }
211 
212  return alpha;
213 }

Referenced by Con_DrawNotify(), SCR_DrawCenterString(), and SCR_DrawChatHUD().

◆ SCR_FinishCinematic()

void SCR_FinishCinematic ( void  )

Definition at line 105 of file cin.c.

106 {
108 
109  // tell the server to advance to the next map / cinematic
110  CL_ClientCommand(va("nextserver %i\n", cl.servercount));
111 }

Referenced by Key_Event(), SCR_PlayCinematic(), and SCR_RunCinematic().

◆ SCR_GetFont()

qhandle_t SCR_GetFont ( void  )

Definition at line 2196 of file screen.c.

2197 {
2198  return scr.font_pic;
2199 }

Referenced by draw_shadowed_string().

◆ SCR_Init()

void SCR_Init ( void  )

Definition at line 1348 of file screen.c.

1349 {
1350  scr_viewsize = Cvar_Get("viewsize", "100", CVAR_ARCHIVE);
1351  scr_showpause = Cvar_Get("scr_showpause", "1", 0);
1352  scr_centertime = Cvar_Get("scr_centertime", "2.5", 0);
1353 #ifdef _DEBUG
1354  scr_netgraph = Cvar_Get("netgraph", "0", 0);
1355  scr_timegraph = Cvar_Get("timegraph", "0", 0);
1356  scr_debuggraph = Cvar_Get("debuggraph", "0", 0);
1357  scr_graphheight = Cvar_Get("graphheight", "32", 0);
1358  scr_graphscale = Cvar_Get("graphscale", "1", 0);
1359  scr_graphshift = Cvar_Get("graphshift", "0", 0);
1360 #endif
1361  scr_demobar = Cvar_Get("scr_demobar", "1", 0);
1362  scr_font = Cvar_Get("scr_font", "conchars", 0);
1363  scr_font->changed = scr_font_changed;
1364  scr_scale = Cvar_Get("scr_scale", "2", 0);
1365  scr_scale->changed = scr_scale_changed;
1366  scr_crosshair = Cvar_Get("crosshair", "0", CVAR_ARCHIVE);
1368 
1369  scr_chathud = Cvar_Get("scr_chathud", "0", 0);
1370  scr_chathud_lines = Cvar_Get("scr_chathud_lines", "4", 0);
1371  scr_chathud_time = Cvar_Get("scr_chathud_time", "0", 0);
1372  scr_chathud_x = Cvar_Get("scr_chathud_x", "8", 0);
1373  scr_chathud_y = Cvar_Get("scr_chathud_y", "-64", 0);
1374 
1375  ch_health = Cvar_Get("ch_health", "0", 0);
1376  ch_health->changed = scr_crosshair_changed;
1377  ch_red = Cvar_Get("ch_red", "1", 0);
1378  ch_red->changed = scr_crosshair_changed;
1379  ch_green = Cvar_Get("ch_green", "1", 0);
1380  ch_green->changed = scr_crosshair_changed;
1381  ch_blue = Cvar_Get("ch_blue", "1", 0);
1382  ch_blue->changed = scr_crosshair_changed;
1383  ch_alpha = Cvar_Get("ch_alpha", "1", 0);
1384  ch_alpha->changed = scr_crosshair_changed;
1385 
1386  ch_scale = Cvar_Get("ch_scale", "1", 0);
1387  ch_scale->changed = scr_crosshair_changed;
1388  ch_x = Cvar_Get("ch_x", "0", 0);
1389  ch_y = Cvar_Get("ch_y", "0", 0);
1390 
1391  scr_draw2d = Cvar_Get("scr_draw2d", "2", 0);
1392  scr_showturtle = Cvar_Get("scr_showturtle", "1", 0);
1393  scr_showitemname = Cvar_Get("scr_showitemname", "1", CVAR_ARCHIVE);
1394  scr_lag_x = Cvar_Get("scr_lag_x", "-1", 0);
1395  scr_lag_y = Cvar_Get("scr_lag_y", "-1", 0);
1396  scr_lag_draw = Cvar_Get("scr_lag_draw", "0", 0);
1397  scr_lag_min = Cvar_Get("scr_lag_min", "0", 0);
1398  scr_lag_max = Cvar_Get("scr_lag_max", "200", 0);
1399  scr_alpha = Cvar_Get("scr_alpha", "1", 0);
1400  scr_fps = Cvar_Get("scr_fps", "0", CVAR_ARCHIVE);
1401 #ifdef _DEBUG
1402  scr_showstats = Cvar_Get("scr_showstats", "0", 0);
1403  scr_showpmove = Cvar_Get("scr_showpmove", "0", 0);
1404 #endif
1405 
1407 
1409 
1410  scr.initialized = qtrue;
1411 }

Referenced by CL_InitRefresh().

◆ SCR_LagClear()

void SCR_LagClear ( void  )

Definition at line 532 of file screen.c.

533 {
534  lag.head = 0;
535 }

Referenced by set_active_state().

◆ SCR_LagSample()

void SCR_LagSample ( void  )

Definition at line 537 of file screen.c.

538 {
539  int i = cls.netchan->incoming_acknowledged & CMD_MASK;
540  client_history_t *h = &cl.history[i];
541  unsigned ping;
542 
543  h->rcvd = cls.realtime;
544  if (!h->cmdNumber || h->rcvd < h->sent) {
545  return;
546  }
547 
548  ping = h->rcvd - h->sent;
549  for (i = 0; i < cls.netchan->dropped; i++) {
550  lag.samples[lag.head % LAG_WIDTH] = ping | LAG_CRIT_BIT;
551  lag.head++;
552  }
553 
554  if (cl.frameflags & FF_SUPPRESSED) {
555  ping |= LAG_WARN_BIT;
556  }
557  lag.samples[lag.head % LAG_WIDTH] = ping;
558  lag.head++;
559 }

Referenced by CL_PacketEvent().

◆ SCR_ModeChanged()

void SCR_ModeChanged ( void  )

Definition at line 1278 of file screen.c.

1279 {
1280  IN_Activate();
1281  Con_CheckResize();
1282  UI_ModeChanged();
1283  // video sync flag may have changed
1285  cls.disable_screen = 0;
1286  if (scr.initialized)
1287  scr.hud_scale = R_ClampScale(scr_scale);
1288 
1289  scr.hud_alpha = 1.f;
1290 }

Referenced by Win_ModeChanged().

◆ SCR_PlayCinematic()

void SCR_PlayCinematic ( const char *  name)

Definition at line 477 of file cin.c.

478 {
479  int width, height;
480  int old_khz;
481 
482  // make sure CD isn't playing music
483  OGG_Stop();
484 
485  cin.s_khz_original = 0;
486 
487  cin.frame_index = 0;
488  cin.start_time = 0;
489 
490  if (!COM_CompareExtension(name, ".pcx"))
491  {
492  cl.image_precache[0] = R_RegisterPic2(name);
493  if (!cl.image_precache[0]) {
495  return;
496  }
497  }
498  else if (!COM_CompareExtension(name, ".cin"))
499  {
500  if (!Cvar_VariableValue("cl_cinematics"))
501  {
503  return;
504  }
505 
506  Q_snprintf(cin.file_name, sizeof(cin.file_name), "video/%s", name);
507 
508  FS_FOpenFile(cin.file_name, &cin.file, FS_MODE_READ);
509  if (!cin.file)
510  {
511  Com_WPrintf("Cinematic \"%s\" not found. Skipping.\n", name);
513  return;
514  }
515 
516  FS_Read(&width, 4, cin.file);
517  FS_Read(&height, 4, cin.file);
518  cin.width = LittleLong(width);
519  cin.height = LittleLong(height);
520 
521  FS_Read(&cin.s_rate, 4, cin.file);
522  cin.s_rate = LittleLong(cin.s_rate);
523  FS_Read(&cin.s_width, 4, cin.file);
524  cin.s_width = LittleLong(cin.s_width);
525  FS_Read(&cin.s_channels, 4, cin.file);
526  cin.s_channels = LittleLong(cin.s_channels);
527 
528  Huff1TableInit();
529 
530  cin.palette_active = qfalse;
531 
532  // switch to 22 khz sound if necessary
533  old_khz = Cvar_VariableValue("s_khz");
534  if (old_khz != cin.s_rate / 1000 && s_started == SS_DMA)
535  {
536  cin.s_khz_original = old_khz;
537  Cvar_Set("s_khz", va("%d", cin.s_rate / 1000));
538  }
539 
540  cin.frame_index = 0;
543  }
544  else
545  {
547  return;
548  }
549 
551 
552  SCR_EndLoadingPlaque(); // get rid of loading plaque
553  Con_Close(qfalse); // get rid of connection screen
554 }

Referenced by CL_ParseServerData().

◆ SCR_RegisterMedia()

void SCR_RegisterMedia ( void  )

Definition at line 1297 of file screen.c.

1298 {
1299  int i, j;
1300 
1301  for (i = 0; i < 2; i++)
1302  for (j = 0; j < STAT_PICS; j++)
1303  scr.sb_pics[i][j] = R_RegisterPic(sb_nums[i][j]);
1304 
1305  scr.inven_pic = R_RegisterPic("inventory");
1306  scr.field_pic = R_RegisterPic("field_3");
1307 
1308  scr.backtile_pic = R_RegisterImage("backtile", IT_PIC, IF_PERMANENT | IF_REPEAT, NULL);
1309 
1310  scr.pause_pic = R_RegisterPic("pause");
1311  R_GetPicSize(&scr.pause_width, &scr.pause_height, scr.pause_pic);
1312 
1313  scr.loading_pic = R_RegisterPic("loading");
1314  R_GetPicSize(&scr.loading_width, &scr.loading_height, scr.loading_pic);
1315 
1316  scr.net_pic = R_RegisterPic("net");
1317  scr.font_pic = R_RegisterFont(scr_font->string);
1318 
1320 }

Referenced by CL_InitRefresh(), CL_RestartFilesystem(), and CL_RestartRefresh().

◆ SCR_RunCinematic()

void SCR_RunCinematic ( )

Definition at line 429 of file cin.c.

430 {
431  int frame;
432 
433  if (cin.start_time <= 0)
434  return;
435 
436  if (cin.frame_index == -1)
437  return; // static image
438 
439  if (cls.key_dest != KEY_GAME)
440  {
441  // pause if menu or console is up
442  cin.start_time = cls.realtime - cin.frame_index * 1000 / 14;
443 
445 
446  return;
447  }
448 
449  frame = (cls.realtime - cin.start_time)*14.0 / 1000;
450  if (frame <= cin.frame_index)
451  return;
452  if (frame > cin.frame_index + 1)
453  {
454  // Com_Printf("Dropped frame: %i > %i\n", frame, cin.frame_index + 1);
455  cin.start_time = cls.realtime - cin.frame_index * 1000 / 14;
456  }
457 
460 
461  if (!cl.image_precache[0])
462  {
464  cin.start_time = 1; // hack to get the black screen behind loading
466  cin.start_time = 0;
467  return;
468  }
469 }

Referenced by CL_Frame().

◆ SCR_SetCrosshairColor()

void SCR_SetCrosshairColor ( void  )

Definition at line 1242 of file screen.c.

1243 {
1244  int health;
1245 
1246  if (!ch_health->integer) {
1247  return;
1248  }
1249 
1250  health = cl.frame.ps.stats[STAT_HEALTH];
1251  if (health <= 0) {
1252  VectorSet(scr.crosshair_color.u8, 0, 0, 0);
1253  return;
1254  }
1255 
1256  // red
1257  scr.crosshair_color.u8[0] = 255;
1258 
1259  // green
1260  if (health >= 66) {
1261  scr.crosshair_color.u8[1] = 255;
1262  } else if (health < 33) {
1263  scr.crosshair_color.u8[1] = 0;
1264  } else {
1265  scr.crosshair_color.u8[1] = (255 * (health - 33)) / 33;
1266  }
1267 
1268  // blue
1269  if (health >= 99) {
1270  scr.crosshair_color.u8[2] = 255;
1271  } else if (health < 66) {
1272  scr.crosshair_color.u8[2] = 0;
1273  } else {
1274  scr.crosshair_color.u8[2] = (255 * (health - 66)) / 33;
1275  }
1276 }

Referenced by CL_DeltaFrame(), and scr_crosshair_changed().

◆ SCR_SetHudAlpha()

void SCR_SetHudAlpha ( float  alpha)

Definition at line 2201 of file screen.c.

2202 {
2203  scr.hud_alpha = alpha;
2204 }

Referenced by evaluate_reference_mode(), and R_BeginFrame_RTX().

◆ SCR_Shutdown()

void SCR_Shutdown ( void  )

Definition at line 1413 of file screen.c.

1414 {
1416  scr.initialized = qfalse;
1417 }

Referenced by CL_ShutdownRefresh().

◆ SCR_SizeDown()

void SCR_SizeDown ( void  )

◆ SCR_SizeUp()

void SCR_SizeUp ( void  )

◆ SCR_TouchPics()

void SCR_TouchPics ( void  )

◆ SCR_UpdateScreen()

void SCR_UpdateScreen ( void  )

Definition at line 2142 of file screen.c.

2143 {
2144  static int recursive;
2145 
2146  if (!scr.initialized) {
2147  return; // not initialized yet
2148  }
2149 
2150  // if the screen is disabled (loading plaque is up), do nothing at all
2151  if (cls.disable_screen) {
2152  unsigned delta = Sys_Milliseconds() - cls.disable_screen;
2153 
2154  if (delta < 120 * 1000) {
2155  return;
2156  }
2157 
2158  cls.disable_screen = 0;
2159  Com_Printf("Loading plaque timed out.\n");
2160  }
2161 
2162  if (recursive > 1) {
2163  Com_Error(ERR_FATAL, "%s: recursively called", __func__);
2164  }
2165 
2166  recursive++;
2167 
2168  R_BeginFrame();
2169 
2170  // do 3D refresh drawing
2171  SCR_DrawActive();
2172 
2173  // draw main menu
2174  UI_Draw(cls.realtime);
2175 
2176  // draw console
2177  Con_DrawConsole();
2178 
2179  // draw loading plaque
2180  SCR_DrawLoading();
2181 
2182 #ifdef _DEBUG
2183  // draw debug graphs
2184  if (scr_timegraph->integer)
2185  SCR_DebugGraph(cls.frametime * 300, 0);
2186 
2187  if (scr_debuggraph->integer || scr_timegraph->integer || scr_netgraph->integer)
2188  SCR_DrawDebugGraph();
2189 #endif
2190 
2191  R_EndFrame();
2192 
2193  recursive--;
2194 }

Referenced by BuildList(), CL_Changing_f(), CL_ConnectionlessPacket(), CL_Frame(), CL_LoadState(), CL_PlayDemo_f(), CL_PrepRefresh(), CL_Reconnect_f(), CL_Skins_f(), Con_Action(), PingServers(), and SCR_BeginLoadingPlaque().

◆ V_AddEntity()

void V_AddEntity ( entity_t *  ent)

Definition at line 91 of file view.c.

92 {
93  if (r_numentities >= MAX_ENTITIES)
94  return;
95 
96  r_entities[r_numentities++] = *ent;
97 }

Referenced by CL_AddBeams(), CL_AddExplosions(), CL_AddLasers(), CL_AddPacketEntities(), CL_AddPlayerBeams(), CL_AddViewWeapon(), and LOC_AddLocationsToScene().

◆ V_AddParticle()

void V_AddParticle ( particle_t *  p)

Definition at line 106 of file view.c.

107 {
108  if (r_numparticles >= MAX_PARTICLES)
109  return;
110  r_particles[r_numparticles++] = *p;
111 }

◆ V_Init()

void V_Init ( void  )

Definition at line 533 of file view.c.

534 {
536 
537 #ifdef _DEBUG
538  cl_testblend = Cvar_Get("cl_testblend", "0", 0);
539  cl_testparticles = Cvar_Get("cl_testparticles", "0", 0);
540  cl_testentities = Cvar_Get("cl_testentities", "0", 0);
541 #if USE_DLIGHTS
542  cl_testlights = Cvar_Get("cl_testlights", "0", CVAR_CHEAT);
543 #endif
544 
545  cl_stats = Cvar_Get("cl_stats", "0", 0);
546 #endif
547 
548 #if USE_DLIGHTS
549  cl_add_lights = Cvar_Get("cl_lights", "1", 0);
550  cl_show_lights = Cvar_Get("cl_show_lights", "0", 0);
551 #endif
552  cl_add_particles = Cvar_Get("cl_particles", "1", 0);
553  cl_add_entities = Cvar_Get("cl_entities", "1", 0);
554  cl_add_blend = Cvar_Get("cl_blend", "1", 0);
556 
557  cl_adjustfov = Cvar_Get("cl_adjustfov", "1", 0);
558 }

Referenced by CL_InitRefresh().

◆ V_RenderView()

void V_RenderView ( void  )

Definition at line 402 of file view.c.

403 {
404  // an invalid frame will just use the exact previous refdef
405  // we can't use the old frame if the video mode has changed, though...
406  if (cl.frame.valid) {
407  V_ClearScene();
408 
409  // build a refresh entity list and calc cl.sim*
410  // this also calls CL_CalcViewValues which loads
411  // v_forward, etc.
412  CL_AddEntities();
413 
414 #ifdef _DEBUG
415  if (cl_testparticles->integer)
416  V_TestParticles();
417  if (cl_testentities->integer)
418  V_TestEntities();
419 #if USE_DLIGHTS
420  if (cl_testlights->integer)
421  V_TestLights();
422 #endif
423  if (cl_testblend->integer) {
424  cl.refdef.blend[0] = 1;
425  cl.refdef.blend[1] = 0.5;
426  cl.refdef.blend[2] = 0.25;
427  cl.refdef.blend[3] = 0.5;
428  }
429 #endif
430 
431  // never let it sit exactly on a node line, because a water plane can
432  // dissapear when viewed with the eye exactly on it.
433  // the server protocol only specifies to 1/8 pixel, so add 1/16 in each axis
434  cl.refdef.vieworg[0] += 1.0 / 16;
435  cl.refdef.vieworg[1] += 1.0 / 16;
436  cl.refdef.vieworg[2] += 1.0 / 16;
437 
438  cl.refdef.x = scr_vrect.x;
439  cl.refdef.y = scr_vrect.y;
440  cl.refdef.width = scr_vrect.width;
441  cl.refdef.height = scr_vrect.height;
442 
443  // adjust for non-4/3 screens
444  if (cl_adjustfov->integer) {
445  cl.refdef.fov_y = cl.fov_y;
446  cl.refdef.fov_x = V_CalcFov(cl.refdef.fov_y, cl.refdef.height, cl.refdef.width);
447  } else {
448  cl.refdef.fov_x = cl.fov_x;
449  cl.refdef.fov_y = V_CalcFov(cl.refdef.fov_x, cl.refdef.width, cl.refdef.height);
450  }
451 
452  cl.refdef.time = cl.time * 0.001;
453 
454  if (cl.frame.areabytes) {
455  cl.refdef.areabits = cl.frame.areabits;
456  } else {
457  cl.refdef.areabits = NULL;
458  }
459 
460  if (!cl_add_entities->integer)
461  r_numentities = 0;
462  if (!cl_add_particles->integer)
463  r_numparticles = 0;
464 #if USE_DLIGHTS
465  if (!cl_add_lights->integer)
466  r_numdlights = 0;
467 #endif
468  if (!cl_add_blend->integer)
469  Vector4Clear(cl.refdef.blend);
470 
471  cl.refdef.num_entities = r_numentities;
472  cl.refdef.entities = r_entities;
473  cl.refdef.num_particles = r_numparticles;
474  cl.refdef.particles = r_particles;
475 #if USE_DLIGHTS
476  cl.refdef.num_dlights = r_numdlights;
477  cl.refdef.dlights = r_dlights;
478 #endif
479 #if USE_LIGHTSTYLES
480  cl.refdef.lightstyles = r_lightstyles;
481 #endif
482 
483  cl.refdef.rdflags = cl.frame.ps.rdflags;
484 
485  // sort entities for better cache locality
486  qsort(cl.refdef.entities, cl.refdef.num_entities, sizeof(cl.refdef.entities[0]), entitycmpfnc);
487  }
488 
490 #ifdef _DEBUG
491  if (cl_stats->integer)
492 #if USE_DLIGHTS
493  Com_Printf("ent:%i lt:%i part:%i\n", r_numentities, r_numdlights, r_numparticles);
494 #else
495  Com_Printf("ent:%i part:%i\n", r_numentities, r_numparticles);
496 #endif
497 #endif
498 
499  V_SetLightLevel();
500 }

Referenced by SCR_DrawActive().

◆ V_Shutdown()

void V_Shutdown ( void  )

Definition at line 560 of file view.c.

561 {
563 }

Referenced by CL_ShutdownRefresh().

Variable Documentation

◆ cl

Definition at line 99 of file main.c.

Referenced by AC_CheckTimeouts(), AC_ClientAnnounce(), AC_ClientBegin(), AC_ClientConnect(), AC_ClientDisconnect(), AC_ClientQuery(), AC_ClientToken(), AC_Drop(), AC_Info_f(), AC_Invalidate_f(), AC_List_f(), AC_ParseClient(), AC_ParseClientAck(), AC_ParseDisconnect(), AC_ParseFileViolation(), AC_ParseQueryReply(), AC_ParseViolation(), AC_Update_f(), active_sun_preset(), AL_AddLoopSounds(), AL_Update(), build_gamestate(), check_player(), CheckDMRules(), CL_AddBeams(), CL_AddExplosions(), CL_AddLasers(), CL_AddPacketEntities(), CL_AddParticles(), CL_AddPlayerBeams(), CL_AddViewWeapon(), CL_AdjustAngles(), CL_AllocExplosion(), CL_AllocLaser(), CL_Ammo_m(), CL_Armor_m(), CL_Begin(), CL_BFGExplosionParticles(), CL_BfgParticles(), CL_BigTeleportParticles(), CL_BlasterParticles(), CL_BlasterParticles2(), CL_BlasterTrail(), CL_BlasterTrail2(), CL_BloodParticleEffect(), CL_BubbleTrail(), CL_BubbleTrail2(), CL_CalcViewValues(), CL_Changing_f(), CL_CheatsOK(), CL_CheckPredictionError(), CL_CheckTimeout(), CL_ClampPitch(), CL_ClampSpeed(), CL_ClearState(), CL_ClipMoveToEntities(), CL_Cluster_m(), CL_ClusterThere_m(), CL_ColorExplosionParticles(), CL_ConnectionlessPacket(), CL_DebugTrail(), CL_DeltaFrame(), CL_DemoFrame(), CL_DiminishingTrail(), CL_DumpClients_f(), CL_DumpLayout_f(), CL_DumpStatusbar_f(), CL_EmitDemoFrame(), CL_EmitDemoSnapshot(), CL_ExplosionParticles(), CL_FinalizeCmd(), CL_FinishViewValues(), CL_FirstDemoFrame(), CL_FlagTrail(), CL_FlyEffect(), CL_FlyParticles(), CL_ForceWall(), CL_Frame(), CL_GenericParticleEffect(), CL_GetEntitySoundOrigin(), CL_GetResolutionScale(), CL_GTV_EmitFrame(), CL_GTV_WriteMessage(), CL_HdrColor_m(), CL_Health_m(), CL_Heatbeam(), CL_IonripperTrail(), CL_ItemRespawnParticles(), CL_KeyState(), CL_LoadClientinfo(), CL_LogoutEffect(), CL_Mapname_m(), CL_Material_m(), CL_Material_Override_m(), CL_MeasureStats(), CL_MonsterPlasma_Shell(), CL_MouseMove(), CL_MuzzleFlash(), CL_MuzzleFlash2(), CL_Name_g(), cl_noskins_changed(), CL_Nukeblast(), CL_NumLightPolys_m(), CL_OldRailTrail(), CL_ParseBaseline(), CL_ParseBeam(), CL_ParseCenterPrint(), CL_ParseConfigstring(), CL_ParseDeltaEntity(), CL_ParseFrame(), CL_ParseInventory(), CL_ParseLayout(), CL_ParseNuke(), CL_ParsePacketEntities(), CL_ParsePlayerBeam(), CL_ParsePrint(), CL_ParseServerData(), CL_ParseStartSoundPacket(), CL_ParseSteam(), CL_ParseTEnt(), CL_ParseWidow(), CL_ParticleEffect(), CL_ParticleEffect2(), CL_ParticleEffect3(), CL_ParticleEffectWaterSplash(), CL_ParticleSmokeEffect(), CL_ParticleSteamEffect(), CL_ParticleSteamEffect2(), CL_PlainExplosion(), CL_PointContents(), CL_PredictAngles(), CL_PredictMovement(), CL_PrepRefresh(), CL_ProcessEvents(), CL_ProcessSustain(), CL_QuadTrail(), CL_RailLights(), CL_RailSpiral(), CL_Record_f(), CL_RegisterBspModels(), CL_RegisterSounds(), CL_RegisterVWepModels(), CL_RequestNextDownload(), CL_ResolutionScale_m(), CL_RestartFilesystem(), CL_RestartRefresh(), CL_RocketTrail(), CL_Seek_f(), CL_SendBatchedCmd(), CL_SendCmd(), CL_SendDefaultCmd(), CL_SendKeepAlive(), CL_SetClientTime(), CL_SetSky(), CL_SetupFirstPersonView(), CL_SetupThirdPersionView(), CL_Skins_f(), CL_SmokeAndFlash(), CL_SmokeTrail(), CL_Suspend_f(), CL_TagTrail(), CL_TeleporterParticles(), CL_TeleportParticles(), CL_Timer_m(), CL_Trace(), CL_Tracker_Explode(), CL_Tracker_Shell(), CL_TrackerTrail(), CL_TrapParticles(), CL_UpdateCmd(), CL_UpdateConfigstring(), CL_Ups_m(), CL_ViewDir_m(), CL_ViewPos_m(), CL_WeaponModel_m(), CL_Widowbeamout(), CL_WidowSplash(), Cmd_Inven_f(), Cmd_Say_f(), Cmd_WeapLast_f(), Cmd_WeapNext_f(), Cmd_WeapPrev_f(), Con_DrawSolidConsole(), DeathmatchScoreboardMessage(), DMA_DriftBeginofs(), dump_lag(), dump_protocols(), dump_settings(), emit_gamestate(), emit_packet_entities(), entity_event(), entity_new(), entity_optimized(), entity_update(), entity_update_new(), entity_update_old(), find_client_slot(), G_CheckChaseStats(), G_SetSpectatorStats(), IN_AttackDown(), IN_CenterView(), IN_GetCurrentGrab(), IN_UseDown(), Key_Event(), LOC_Add_f(), LOC_AddLocationsToScene(), LOC_Delete_f(), LOC_FindClosest(), LOC_Here_m(), LOC_LoadLocations(), LOC_There_m(), LOC_Update_f(), LOC_Write_f(), MVD_BroadcastPrintf(), MVD_GameClientDisconnect(), MVD_GameClientDrop(), MVD_GameClientNameChanged(), MVD_LayoutClients(), MVD_ParseMulticast(), MVD_ParseSound(), MVD_RemoveClient(), MVD_Say_f(), MVD_SetServerState(), MVD_SwitchChannel(), MVD_UnicastPrint(), MVD_UnicastSend(), permit_connection(), ping_avg(), ping_min(), prepare_entities(), print_channel(), Qcommon_Frame(), ready_to_send(), ready_to_send_hacked(), resume_record(), S_BuildSoundList(), S_ParseStartSound(), S_RegisterSexedSound(), S_RegisterSexedSounds(), S_Update(), SCR_DrawActive(), SCR_DrawInventory(), SCR_DrawLayout(), SCR_DrawSelectedItemName(), SCR_DrawStats(), SCR_DrawTurtle(), SCR_ExecuteLayoutString(), SCR_FinishCinematic(), SCR_LagSample(), SCR_PlayCinematic(), SCR_RunCinematic(), SCR_ScoreDump_f(), SCR_ScoreShot_f(), SCR_SetCrosshairColor(), SCR_StopCinematic(), SCR_TimeRefresh_f(), SelectNextItem(), SelectPrevItem(), set_active_state(), shell_effect_hack(), SV_CalcPings(), SV_CountClients(), SV_GiveMsec(), SV_Lag_f(), SV_Player_g(), SV_SetPlayer(), SV_StatusString(), SV_UserinfoChanged(), TH_DrawLayoutString(), V_RenderView(), V_SetLightLevel(), V_Viewpos_f(), ValidateSelectedItem(), and vkpt_freecam_mousemove().

◆ cl_async

cvar_t* cl_async

Definition at line 32 of file main.c.

Referenced by CL_InitLocal(), and CL_UpdateFrameTimes().

◆ cl_beginmapcmd

cvar_t* cl_beginmapcmd

Definition at line 61 of file main.c.

Referenced by CL_InitLocal(), and set_active_state().

◆ cl_changemapcmd

cvar_t* cl_changemapcmd

Definition at line 60 of file main.c.

Referenced by CL_Changing_f(), and CL_InitLocal().

◆ cl_chat_filter

cvar_t* cl_chat_filter

Definition at line 55 of file main.c.

Referenced by CL_InitLocal(), and CL_ParsePrint().

◆ cl_chat_notify

cvar_t* cl_chat_notify

Definition at line 53 of file main.c.

Referenced by CL_InitLocal(), and CL_ParsePrint().

◆ cl_chat_sound

cvar_t* cl_chat_sound

Definition at line 54 of file main.c.

Referenced by CL_InitLocal(), and CL_ParsePrint().

◆ cl_cmdbuf

cmdbuf_t cl_cmdbuf

◆ cl_cmdbuf_text

char cl_cmdbuf_text[MAX_STRING_CHARS]

Definition at line 105 of file main.c.

Referenced by CL_Init().

◆ cl_disable_explosions

cvar_t* cl_disable_explosions

Definition at line 52 of file main.c.

Referenced by CL_InitLocal(), and CL_ParseTEnt().

◆ cl_disable_particles

cvar_t* cl_disable_particles

Definition at line 51 of file main.c.

Referenced by CL_AddPacketEntities(), CL_InitLocal(), and CL_ParseTEnt().

◆ cl_disconnectcmd

cvar_t* cl_disconnectcmd

Definition at line 59 of file main.c.

Referenced by CL_Disconnect(), and CL_InitLocal().

◆ cl_entities

◆ cl_explosion_frametime

cvar_t* cl_explosion_frametime

Definition at line 57 of file main.c.

Referenced by CL_InitLocal(), and CL_PlainExplosion().

◆ cl_explosion_sprites

cvar_t* cl_explosion_sprites

Definition at line 56 of file main.c.

Referenced by CL_InitLocal(), CL_ParseTEnt(), and CL_PlainExplosion().

◆ cl_explosions

explosion_t cl_explosions[MAX_EXPLOSIONS]

Definition at line 136 of file tent.c.

Referenced by CL_AddExplosions(), CL_AllocExplosion(), and CL_ClearExplosions().

◆ cl_footsteps

cvar_t* cl_footsteps

Definition at line 26 of file main.c.

Referenced by CL_InitLocal(), CL_UpdateFootstepsSetting(), and entity_event().

◆ cl_gibs

cvar_t* cl_gibs

Definition at line 63 of file main.c.

Referenced by CL_AddPacketEntities(), CL_InitLocal(), and CL_UpdateGibSetting().

◆ cl_gun

cvar_t* cl_gun

Definition at line 29 of file main.c.

◆ cl_gunalpha

cvar_t* cl_gunalpha

Definition at line 30 of file main.c.

Referenced by CL_AddViewWeapon(), and CL_InitLocal().

◆ cl_kickangles

cvar_t* cl_kickangles

Definition at line 36 of file main.c.

Referenced by CL_InitLocal(), and CL_SetupFirstPersonView().

◆ cl_noglow

cvar_t* cl_noglow

Definition at line 38 of file main.c.

Referenced by CL_AddPacketEntities(), and CL_InitLocal().

◆ cl_nolerp

cvar_t* cl_nolerp

Definition at line 39 of file main.c.

Referenced by CL_InitLocal(), entity_new(), entity_update_old(), and player_update().

◆ cl_noskins

cvar_t* cl_noskins

Definition at line 25 of file main.c.

Referenced by CL_InitLocal(), and CL_ParsePlayerSkin().

◆ cl_player_model

◆ cl_predict

◆ cl_rollhack

cvar_t* cl_rollhack

Definition at line 37 of file main.c.

Referenced by CL_AddPacketEntities(), and CL_InitLocal().

◆ cl_thirdperson_angle

cvar_t* cl_thirdperson_angle

Definition at line 48 of file main.c.

Referenced by CL_InitLocal(), and CL_SetupThirdPersionView().

◆ cl_thirdperson_range

cvar_t* cl_thirdperson_range

Definition at line 49 of file main.c.

Referenced by CL_InitLocal(), and CL_SetupThirdPersionView().

◆ cl_vwep

cvar_t* cl_vwep

Definition at line 72 of file main.c.

Referenced by CL_InitLocal(), and CL_RegisterVWepModels().

◆ cls

Definition at line 98 of file main.c.

Referenced by abort_downloads(), AL_AddLoopSounds(), build_gamestate(), CL_Activate(), CL_AddRequest(), CL_Begin(), CL_CalcViewValues(), CL_Changing_f(), CL_CheatsOK(), CL_CheckForIP(), CL_CheckForPause(), CL_CheckForResend(), CL_CheckPredictionError(), CL_CheckTimeout(), CL_CleanupDemos(), CL_CleanupDownloads(), CL_ClearState(), CL_ClientCommand(), CL_Connect_f(), CL_ConnectionlessPacket(), CL_DeltaFrame(), CL_DemoFrame(), CL_DemoPos_m(), CL_Disconnect(), CL_Disconnect_f(), CL_Download_f(), CL_DumpClients_f(), CL_EmitDemoFrame(), CL_EmitDemoSnapshot(), CL_FinalizeCmd(), CL_FindRequest(), CL_FinishDownload(), CL_FirstDemoFrame(), CL_FollowIP_f(), CL_ForwardToServer(), CL_ForwardToServer_f(), CL_Frame(), CL_GTV_EmitFrame(), CL_GTV_Resume(), CL_GTV_Run(), CL_GTV_Shutdown(), CL_GTV_Start_f(), CL_GTV_Status_f(), CL_GTV_Stop_f(), CL_GTV_Suspend(), CL_GTV_Transmit(), CL_GTV_WriteMessage(), CL_HandleDownload(), CL_IgnoreDownload(), CL_Init(), CL_InitDemos(), CL_InitDownloads(), CL_InitLocal(), CL_InitRefresh(), CL_Lag_m(), CL_LoadDownloadIgnores(), CL_MeasureStats(), CL_MouseMove(), CL_Name_g(), cl_noskins_changed(), CL_PacketEvent(), CL_ParseCenterPrint(), CL_ParseConfigstring(), CL_ParseDownload(), CL_ParseFrame(), CL_ParsePrint(), CL_ParsePrintMessage(), CL_ParseReconnect(), CL_ParseServerData(), CL_ParseServerMessage(), CL_ParseZPacket(), CL_PassiveConnect_f(), CL_Ping_m(), CL_PlayDemo_f(), CL_Precache_f(), CL_PredictMovement(), CL_PrepRefresh(), CL_QueueDownload(), CL_Rcon_f(), CL_RecentIP_g(), CL_Reconnect_f(), CL_Record_f(), CL_RegisterBspModels(), CL_RequestNextDownload(), CL_RestartFilesystem(), CL_RestartRefresh(), CL_RunRefresh(), CL_Seek_f(), CL_SendBatchedCmd(), CL_SendCmd(), CL_SendDefaultCmd(), CL_SendKeepAlive(), CL_SendUserinfo(), CL_Server_m(), CL_ServerStatus_f(), CL_Shutdown(), CL_ShutdownRefresh(), CL_Skins_f(), CL_StartNextDownload(), CL_Stop_f(), CL_Suspend_f(), CL_UpdateBlendSetting(), CL_UpdateConfigstring(), CL_UpdateFootstepsSetting(), CL_UpdateFrameTimes(), CL_UpdateGibSetting(), CL_UpdateGunSetting(), CL_UpdatePredictSetting(), CL_UpdateRecordingSetting(), CL_UpdateUserinfo(), CL_Ups_m(), cl_vwep_changed(), CL_WriteDemoMessage(), Con_Action(), Con_CarriageRet(), Con_Close(), Con_DrawNotify(), Con_DrawSolidConsole(), con_param_changed(), Con_Popup(), Con_RemoteMode_f(), Con_RunConsole(), con_scale_changed(), downloads_pending(), drop_client(), dump_program(), emit_gamestate(), entity_optimized(), exec_server_string(), find_snapshot(), finish_download(), finish_udp_download(), format_demo_size(), format_demo_status(), HTTP_QueueDownload(), HTTP_SetServer(), IN_AttackDown(), IN_GetCurrentGrab(), IN_UseDown(), inflate_udp_download(), Key_Event(), Key_GetDest(), Key_Message(), Key_SetDest(), lerp_client_fov(), LOC_Add_f(), LOC_Delete_f(), LOC_Here_m(), LOC_There_m(), LOC_Update_f(), LOC_Write_f(), parse_hello(), parse_message(), parse_next_message(), parse_ping(), parse_stream_start(), parse_stream_stop(), progress_func(), R_RenderFrame_RTX(), ready_to_send(), resume_record(), S_Activate(), S_Update(), SCR_AddToChatHUD(), SCR_BeginLoadingPlaque(), SCR_CenterPrint(), SCR_Draw2D(), SCR_DrawActive(), SCR_DrawDemo(), SCR_DrawInventory(), SCR_DrawLayout(), SCR_DrawNet(), SCR_EndLoadingPlaque(), SCR_FadeAlpha(), SCR_LagSample(), SCR_ModeChanged(), SCR_PlayCinematic(), SCR_RunCinematic(), SCR_ScoreDump_f(), SCR_ScoreShot_f(), SCR_Sky_f(), SCR_TimeRefresh_f(), SCR_UpdateScreen(), set_active_state(), start_message_mode(), start_next_download(), start_udp_download(), toggle_console(), UI_PopMenu(), update_status(), write_stream(), and write_udp_download().

◆ gun_frame

int gun_frame

Definition at line 27 of file view.c.

Referenced by CL_AddViewWeapon(), V_Gun_Next_f(), and V_Gun_Prev_f().

◆ gun_model

qhandle_t gun_model

Definition at line 28 of file view.c.

Referenced by CL_AddViewWeapon(), and V_Gun_Model_f().

◆ info_fov

cvar_t* info_fov

Definition at line 84 of file main.c.

Referenced by CL_InitLocal(), and lerp_client_fov().

◆ info_gender

cvar_t* info_gender

Definition at line 87 of file main.c.

Referenced by CL_FixUpGender(), and CL_InitLocal().

◆ info_hand

cvar_t* info_hand

Definition at line 86 of file main.c.

Referenced by CL_AddPlayerBeams(), CL_AddViewWeapon(), CL_InitLocal(), and CL_UpdateGunSetting().

◆ info_msg

cvar_t* info_msg

Definition at line 85 of file main.c.

Referenced by CL_InitLocal().

◆ info_name

cvar_t* info_name

Definition at line 81 of file main.c.

Referenced by CL_InitLocal().

◆ info_password

cvar_t* info_password

Definition at line 79 of file main.c.

Referenced by CL_InitLocal().

◆ info_rate

cvar_t* info_rate

Definition at line 83 of file main.c.

Referenced by CalcPingRate(), and CL_InitLocal().

◆ info_skin

cvar_t* info_skin

Definition at line 82 of file main.c.

Referenced by CL_FixUpGender(), CL_InitLocal(), and CL_UpdateUserinfo().

◆ info_spectator

cvar_t* info_spectator

Definition at line 80 of file main.c.

Referenced by CL_InitLocal().

◆ info_uf

cvar_t* info_uf

Definition at line 88 of file main.c.

Referenced by CL_InitLocal(), and lerp_client_fov().

◆ mz

Definition at line 656 of file parse.c.

Referenced by CL_MuzzleFlash(), CL_MuzzleFlash2(), and CL_ParseMuzzleFlashPacket().

◆ scr_vrect

vrect_t scr_vrect

Definition at line 105 of file screen.c.

Referenced by SCR_CalcVrect(), and V_RenderView().

◆ snd

Definition at line 657 of file parse.c.

Referenced by CL_ParseStartSoundPacket(), and S_ParseStartSound().

◆ te

scr_lag_x
static cvar_t * scr_lag_x
Definition: screen.c:65
CL_AddPacketEntities
static void CL_AddPacketEntities(void)
Definition: entities.c:511
scr_scale_changed
static void scr_scale_changed(cvar_t *self)
Definition: screen.c:1327
FS_Restart
void FS_Restart(qboolean total)
Definition: files.c:3556
IN_BackUp
static void IN_BackUp(void)
Definition: input.c:396
client_state_s::frame
server_frame_t frame
Definition: client.h:212
in_right
static kbutton_t in_right
Definition: input.c:290
VID_FillInputAPI
void VID_FillInputAPI(inputAPI_t *api)
Definition: client.c:1388
NOPART_BLOOD
#define NOPART_BLOOD
Definition: client.h:499
server_frame_t::valid
qboolean valid
Definition: client.h:129
console_s::destHeight
float destHeight
Definition: console.c:65
R_RegisterImage
qhandle_t R_RegisterImage(const char *name, imagetype_t type, imageflags_t flags, qerror_t *err_p)
Definition: images.c:1170
SYNC_SLEEP_10
@ SYNC_SLEEP_10
Definition: main.c:3095
console_s::currentHeight
float currentHeight
Definition: console.c:64
CRC_Block
static uint16_t CRC_Block(byte *start, size_t count)
Definition: crc.c:64
client_state_s::mousemove
vec2_t mousemove
Definition: client.h:238
FRAME_CUR
#define FRAME_CUR
Definition: demo.c:177
cl_railcore_color
static cvar_t * cl_railcore_color
Definition: tent.c:900
LOC_FreeLocations
void LOC_FreeLocations(void)
Definition: locs.c:122
client_state_s::bsp
bsp_t * bsp
Definition: client.h:300
Prompt_CompleteCommand
void Prompt_CompleteCommand(commandPrompt_t *prompt, qboolean backslash)
Definition: prompt.c:190
cl_add_particles
static cvar_t * cl_add_particles
Definition: view.c:32
R_EndRegistration
void(* R_EndRegistration)(void)
Definition: refresh.c:407
r_numentities
int r_numentities
Definition: view.c:58
client_static_s::connect_time
unsigned connect_time
Definition: client.h:411
loc_draw
static cvar_t * loc_draw
Definition: locs.c:33
con_history
static cvar_t * con_history
Definition: console.c:90
client_state_s::configstrings
char configstrings[MAX_CONFIGSTRINGS][MAX_QPATH]
Definition: client.h:289
tent_params_t::offset
vec3_t offset
Definition: client.h:663
CL_ParseServerData
static void CL_ParseServerData(void)
Definition: parse.c:479
Cvar_Set
cvar_t * Cvar_Set(const char *var_name, const char *value)
Definition: cvar.c:466
CL_ParsePlayerBeam
static void CL_ParsePlayerBeam(qhandle_t model)
Definition: tent.c:556
cinematics_t::frame_index
int frame_index
Definition: cin.c:57
Prompt_CompleteHistory
void Prompt_CompleteHistory(commandPrompt_t *prompt, qboolean forward)
Definition: prompt.c:387
CL_SetSky
void CL_SetSky(void)
Definition: precache.c:306
r_config
refcfg_t r_config
Definition: main.c:24
NOEXP_GRENADE
#define NOEXP_GRENADE
Definition: client.h:501
PRECACHE_FINAL
@ PRECACHE_FINAL
Definition: download.c:33
tent_params_t::pos1
vec3_t pos1
Definition: client.h:661
LOC_Update_f
static void LOC_Update_f(void)
Definition: locs.c:306
CL_ParticleEffect
void CL_ParticleEffect(vec3_t org, vec3_t dir, int color, int count)
Definition: effects.c:877
CL_SendBatchedCmd
static void CL_SendBatchedCmd(void)
Definition: input.c:1009
CL_UpdateFootstepsSetting
static void CL_UpdateFootstepsSetting(void)
Definition: main.c:218
client_static_s::passive
qboolean passive
Definition: client.h:413
m_filter
static cvar_t * m_filter
Definition: input.c:33
CL_MuzzleFlash2
void CL_MuzzleFlash2(void)
Definition: effects.c:459
CL_UpdateRecordingSetting
void CL_UpdateRecordingSetting(void)
Definition: main.c:265
cvar_modified
int cvar_modified
Definition: cvar.c:32
FX_Init
void FX_Init(void)
Definition: effects.c:838
LOC_Write_f
static void LOC_Write_f(void)
Definition: locs.c:332
IN_LeftDown
static void IN_LeftDown(void)
Definition: input.c:389
msg_read
sizebuf_t msg_read
Definition: msg.c:37
client_state_s::entityStates
entity_state_t entityStates[MAX_PARSE_ENTITIES]
Definition: client.h:204
CL_GTV_Suspend
void CL_GTV_Suspend(void)
Definition: gtv.c:269
listener_origin
vec3_t listener_origin
Definition: main.c:35
client_static_s::quakePort
int quakePort
Definition: client.h:419
pm
static pmove_t * pm
Definition: pmove.c:44
parse_next_message
static int parse_next_message(int wait)
Definition: demo.c:655
vid_modelist
cvar_t * vid_modelist
Definition: refresh.c:32
CL_ParseReconnect
static void CL_ParseReconnect(void)
Definition: parse.c:851
client_state_s::servertime
int servertime
Definition: client.h:214
chktbl
static const byte chktbl[1024]
Definition: crc.c:74
IN_KLookUp
static void IN_KLookUp(void)
Definition: input.c:384
client_state_s::image_precache
qhandle_t image_precache[MAX_IMAGES]
Definition: client.h:306
CL_ClearExplosions
static void CL_ClearExplosions(void)
Definition: tent.c:138
LOAD_SOUNDS
@ LOAD_SOUNDS
Definition: client.h:612
cl_disable_explosions
cvar_t * cl_disable_explosions
Definition: main.c:52
cl_mod_explo4_big
qhandle_t cl_mod_explo4_big
Definition: tent.c:55
allow_download_players
cvar_t * allow_download_players
Definition: common.c:106
client_static_s::playback
qhandle_t playback
Definition: client.h:453
gl_modulate_world
cvar_t * gl_modulate_world
Definition: main.c:43
IN_LeftUp
static void IN_LeftUp(void)
Definition: input.c:390
CL_AddLasers
static void CL_AddLasers(void)
Definition: tent.c:450
cinematics_t::start_time
int start_time
Definition: cin.c:56
dlqueue_t
Definition: client.h:367
Cvar_BitInfo
size_t Cvar_BitInfo(char *info, int bit)
Definition: cvar.c:1109
CL_ParseZPacket
static void CL_ParseZPacket(void)
Definition: parse.c:1075
m_accel
cvar_t * m_accel
Definition: input.c:34
height
static int height
Definition: physical_sky.c:39
SCR_StopCinematic
void SCR_StopCinematic(void)
Definition: cin.c:67
Prompt_HistoryDown
void Prompt_HistoryDown(commandPrompt_t *prompt)
Definition: prompt.c:519
CL_ParseBeam
static void CL_ParseBeam(qhandle_t model)
Definition: tent.c:530
console_s::vidHeight
int vidHeight
Definition: console.c:54
scr_lag_max
static cvar_t * scr_lag_max
Definition: screen.c:69
CL_ParsePrint
static void CL_ParsePrint(void)
Definition: parse.c:933
client_static_s::last_server_frame
int last_server_frame
Definition: client.h:457
IN_UseDown
static void IN_UseDown(void)
Definition: input.c:424
Q_snprintf
size_t Q_snprintf(char *dest, size_t size, const char *fmt,...)
Definition: shared.c:846
client_state_s::cmdNumber
unsigned cmdNumber
Definition: client.h:184
scr
static struct @4 scr
centity_s::prev
entity_state_t prev
Definition: client.h:87
explosion_t::type
enum explosion_t::@0 type
cl_run
static cvar_t * cl_run
Definition: input.c:42
DL_OTHER
@ DL_OTHER
Definition: client.h:351
client_static_s::demo
struct client_static_s::@3 demo
con_background
static cvar_t * con_background
Definition: console.c:88
Con_DrawSolidConsole
static void Con_DrawSolidConsole(void)
Definition: console.c:775
CL_PredictAngles
void CL_PredictAngles(void)
Definition: predict.c:168
client_static_s::file
qhandle_t file
Definition: client.h:443
dlqueue_t::entry
list_t entry
Definition: client.h:368
console_s::mode
consoleMode_t mode
Definition: console.c:71
console_s::skipNotify
qboolean skipNotify
Definition: console.c:59
client_state_s::model_clip
mmodel_t * model_clip[MAX_MODELS]
Definition: client.h:303
FS_Read
ssize_t FS_Read(void *buf, size_t len, qhandle_t f)
Definition: files.c:1547
SCR_Shutdown
void SCR_Shutdown(void)
Definition: screen.c:1413
VID_SetMode
void VID_SetMode(void)
Definition: client.c:960
scr_lag_min
static cvar_t * scr_lag_min
Definition: screen.c:68
CL_ParseBaseline
static void CL_ParseBaseline(int index, int bits)
Definition: parse.c:442
client_static_s::buffer
sizebuf_t buffer
Definition: client.h:466
S_RegisterSound
qhandle_t S_RegisterSound(const char *name)
Definition: main.c:391
FOR_EACH_DLQ_SAFE
#define FOR_EACH_DLQ_SAFE(q, n)
Definition: client.h:346
cl_sfx_ric3
qhandle_t cl_sfx_ric3
Definition: tent.c:26
parse_info_string
static void parse_info_string(demoInfo_t *info, int clientNum, int index, const char *string)
Definition: demo.c:1064
in_moveright
static kbutton_t in_moveright
Definition: input.c:291
cparticle_s
Definition: client.h:780
active_particles
static cparticle_t * active_particles
Definition: effects.c:828
MOD_ForHandle
model_t * MOD_ForHandle(qhandle_t h)
Definition: models.c:430
CL_PointContents
static int CL_PointContents(vec3_t point)
Definition: predict.c:133
Cmd_AddCommand
void Cmd_AddCommand(const char *name, xcommand_t function)
Definition: cmd.c:1562
client_state_s::v_forward
vec3_t v_forward
Definition: client.h:258
entity_update
static void entity_update(const entity_state_t *state)
Definition: entities.c:153
input
static in_state_t input
Definition: input.c:71
PRECACHE_OTHER
@ PRECACHE_OTHER
Definition: download.c:31
IN_BackDown
static void IN_BackDown(void)
Definition: input.c:395
COM_IsPath
qboolean COM_IsPath(const char *s)
Definition: shared.c:348
lag
static struct @5 lag
CL_ParsePlayerSkin
void CL_ParsePlayerSkin(char *name, char *model, char *skin, const char *s)
Definition: precache.c:35
fv
static float fv
Definition: edge.c:59
IN_DownDown
static void IN_DownDown(void)
Definition: input.c:387
CL_DOWNLOAD_IGNORES
#define CL_DOWNLOAD_IGNORES
Definition: download.c:27
precache_check
static precache_t precache_check
Definition: download.c:36
client_state_s::numWeaponModels
int numWeaponModels
Definition: client.h:312
tent_params_t::entity1
int entity1
Definition: client.h:667
Key_SetDest
void Key_SetDest(keydest_t dest)
Definition: keys.c:178
cparticle_s::brightness
float brightness
Definition: client.h:792
IN_MLookDown
static void IN_MLookDown(void)
Definition: input.c:448
KeyClear
static void KeyClear(kbutton_t *b)
Definition: input.c:374
tent_params_t::dir
vec3_t dir
Definition: client.h:664
S_StopAllSounds
void S_StopAllSounds(void)
Definition: main.c:932
cl_railtrail_type
static cvar_t * cl_railtrail_type
Definition: tent.c:898
check_player
static void check_player(const char *name)
Definition: download.c:666
CL_CheckPredictionError
void CL_CheckPredictionError(void)
Definition: predict.c:27
r_entities
entity_t r_entities[MAX_ENTITIES]
Definition: view.c:59
HTTP_CleanupDownloads
void HTTP_CleanupDownloads(void)
Definition: http.c:386
console_s::vidWidth
int vidWidth
Definition: console.c:54
Cvar_Get
cvar_t * Cvar_Get(const char *var_name, const char *var_value, int flags)
Definition: cvar.c:257
CL_AllocExplosion
static explosion_t * CL_AllocExplosion(void)
Definition: tent.c:143
client_static_s::key_dest
keydest_t key_dest
Definition: client.h:376
Q_ErrorString
const char * Q_ErrorString(qerror_t error)
Definition: error.c:51
listener_up
vec3_t listener_up
Definition: main.c:38
scr_scale
static cvar_t * scr_scale
Definition: screen.c:75
IN_KLookDown
static void IN_KLookDown(void)
Definition: input.c:383
Z_LeakTest
void Z_LeakTest(memtag_t tag)
Definition: zone.c:120
IN_Activate
void IN_Activate(void)
Definition: input.c:117
cl_cmdbuf
cmdbuf_t cl_cmdbuf
Definition: main.c:104
in_up
static kbutton_t in_up
Definition: input.c:293
client_static_s::last_snapshot
int last_snapshot
Definition: client.h:462
cl_upspeed
static cvar_t * cl_upspeed
Definition: input.c:37
CL_GTV_WriteMessage
void CL_GTV_WriteMessage(byte *data, size_t len)
Definition: gtv.c:217
cl_instantpacket
static cvar_t * cl_instantpacket
Definition: input.c:30
client_state_s::prediction_error
vec3_t prediction_error
Definition: client.h:196
CL_ClearTEnts
void CL_ClearTEnts(void)
Definition: tent.c:1459
SCR_SetCrosshairColor
void SCR_SetCrosshairColor(void)
Definition: screen.c:1242
LOC_Delete_f
static void LOC_Delete_f(void)
Definition: locs.c:287
IN_MoverightUp
static void IN_MoverightUp(void)
Definition: input.c:404
CL_FinishViewValues
static void CL_FinishViewValues(void)
Definition: entities.c:1183
cl_packetdup
static cvar_t * cl_packetdup
Definition: input.c:25
Con_RunConsole
void Con_RunConsole(void)
Definition: console.c:982
cinematics_t::s_channels
int s_channels
Definition: cin.c:38
cl_sfx_grenexp
qhandle_t cl_sfx_grenexp
Definition: tent.c:34
net_maxmsglen
cvar_t * net_maxmsglen
Definition: chan.c:99
sensitivity
cvar_t * sensitivity
Definition: input.c:48
Netchan_OutOfBand
void Netchan_OutOfBand(netsrc_t sock, const netadr_t *address, const char *format,...)
Definition: chan.c:140
SCR_DrawStringEx
int SCR_DrawStringEx(int x, int y, int flags, size_t maxlen, const char *s, qhandle_t font)
Definition: screen.c:139
cl_sfx_watrexp
qhandle_t cl_sfx_watrexp
Definition: tent.c:35
DL_MAP
@ DL_MAP
Definition: client.h:352
cl_sfx_flare
qhandle_t cl_sfx_flare
Definition: tent.c:28
Prompt_ClearState
void Prompt_ClearState(commandPrompt_t *prompt)
Definition: prompt.c:437
dltype_t
dltype_t
Definition: client.h:349
SCR_UpdateScreen
void SCR_UpdateScreen(void)
Definition: screen.c:2142
SYNC_SLEEP_VIDEO
@ SYNC_SLEEP_VIDEO
Definition: main.c:3097
IN_RightUp
static void IN_RightUp(void)
Definition: input.c:392
cparticle_s::vel
vec3_t vel
Definition: client.h:786
cparticle_s::accel
vec3_t accel
Definition: client.h:787
V_SetLightLevel
static void V_SetLightLevel(void)
Definition: view.c:350
svc_muzzleflash2
#define svc_muzzleflash2
Definition: g_local.h:37
VID_GetDefaultModeList
char * VID_GetDefaultModeList(void)
Definition: client.c:198
cl_sfx_lightning
qhandle_t cl_sfx_lightning
Definition: tent.c:38
ca_disconnected
@ ca_disconnected
Definition: client.h:334
CL_DiminishingTrail
void CL_DiminishingTrail(vec3_t start, vec3_t end, centity_t *old, int flags)
Definition: effects.c:1484
Com_PlayerToEntityState
void Com_PlayerToEntityState(const player_state_t *ps, entity_state_t *es)
Definition: utils.c:269
R_Init
qboolean(* R_Init)(qboolean total)
Definition: refresh.c:403
cl_add_entities
static cvar_t * cl_add_entities
Definition: view.c:37
PRECACHE_MAP
@ PRECACHE_MAP
Definition: download.c:32
scr_crosshair_changed
static void scr_crosshair_changed(cvar_t *self)
Definition: screen.c:1209
client_state_s::predicted_velocity
vec3_t predicted_velocity
Definition: client.h:195
ca_active
@ ca_active
Definition: client.h:340
IN_GetCurrentGrab
static qboolean IN_GetCurrentGrab(void)
Definition: input.c:84
cl_cmdbuf_text
char cl_cmdbuf_text[MAX_STRING_CHARS]
Definition: main.c:105
CL_MouseMove
static void CL_MouseMove(void)
Definition: input.c:500
CL_RailTrail
static void CL_RailTrail(void)
Definition: tent.c:1023
client_static_s::time_start
unsigned time_start
Definition: client.h:455
LOAD_IMAGES
@ LOAD_IMAGES
Definition: client.h:610
CL_AddPlayerBeams
static void CL_AddPlayerBeams(void)
Definition: tent.c:676
FS_FPrintf
ssize_t FS_FPrintf(qhandle_t f, const char *format,...)
Definition: files.c:2039
demosnap_t::filepos
off_t filepos
Definition: demo.c:760
net_chantype
cvar_t * net_chantype
Definition: chan.c:100
scr_crosshair
static cvar_t * scr_crosshair
Definition: screen.c:77
CL_SmokeAndFlash
void CL_SmokeAndFlash(vec3_t origin)
Definition: tent.c:207
client_static_s::state
connstate_t state
Definition: client.h:375
UI_Init
void UI_Init(void)
Definition: ui.c:627
CL_InitRefresh
void CL_InitRefresh(void)
Definition: refresh.c:289
in_lookup
static kbutton_t in_lookup
Definition: input.c:291
CON_DEFAULT
@ CON_DEFAULT
Definition: console.c:38
explosion_t::baseframe
int baseframe
Definition: client.h:79
con_height
static cvar_t * con_height
Definition: console.c:83
client_state_s::gamedir
char gamedir[MAX_QPATH]
Definition: client.h:277
CL_RegisterTEntModels
void CL_RegisterTEntModels(void)
Definition: tent.c:100
ca_connected
@ ca_connected
Definition: client.h:337
chatline_t::text
char text[MAX_CHAT_TEXT]
Definition: screen.c:890
client_state_s::lerpfrac
float lerpfrac
Definition: client.h:246
client_static_s::ref_initialized
qboolean ref_initialized
Definition: client.h:380
scr_alpha
static cvar_t * scr_alpha
Definition: screen.c:70
cl_sfx_spark7
qhandle_t cl_sfx_spark7
Definition: tent.c:31
cl_disable_particles
cvar_t * cl_disable_particles
Definition: main.c:51
cl_predict
cvar_t * cl_predict
Definition: main.c:28
Con_Printf
void Con_Printf(const char *fmt,...)
Definition: console.c:611
sv_paused
cvar_t * sv_paused
Definition: common.c:96
R_Shutdown
void R_Shutdown(qboolean total)
Definition: main.c:280
R_ClampScale
float R_ClampScale(cvar_t *var)
Definition: refresh.c:440
console_s::loadstate
load_state_t loadstate
Definition: console.c:75
CON_LINEWIDTH
#define CON_LINEWIDTH
Definition: console.c:28
entitycmpfnc
static int entitycmpfnc(const void *_a, const void *_b)
Definition: view.c:338
console_s::text
char text[CON_TOTALLINES][CON_LINEWIDTH]
Definition: console.c:46
CL_Begin
void CL_Begin(void)
Definition: main.c:1757
IN_StrafeDown
static void IN_StrafeDown(void)
Definition: input.c:407
loc_trace
static cvar_t * loc_trace
Definition: locs.c:34
CL_ParseWidow
static void CL_ParseWidow(void)
Definition: tent.c:861
client_static_s::active
active_t active
Definition: client.h:378
cl_sfx_ric1
qhandle_t cl_sfx_ric1
Definition: tent.c:24
R_BeginFrame
void(* R_BeginFrame)(void)
Definition: refresh.c:424
client_state_s::v_up
vec3_t v_up
Definition: client.h:258
in_left
static kbutton_t in_left
Definition: input.c:290
Prompt_Action
char * Prompt_Action(commandPrompt_t *prompt)
Definition: prompt.c:453
CL_CalcViewValues
void CL_CalcViewValues(void)
Definition: entities.c:1251
NOPART_GRENADE_EXPLOSION
#define NOPART_GRENADE_EXPLOSION
Definition: client.h:495
IN_Init
void IN_Init(void)
Definition: input.c:210
client_state_s::viewangles
vec3_t viewangles
Definition: client.h:230
con_scale_changed
static void con_scale_changed(cvar_t *self)
Definition: console.c:410
FS_Tell
ssize_t FS_Tell(qhandle_t f)
Definition: files.c:505
cl_sfx_lashit
qhandle_t cl_sfx_lashit
Definition: tent.c:27
MODE_GEOMETRY
#define MODE_GEOMETRY
Definition: refresh.c:38
CL_UpdateBlendSetting
void CL_UpdateBlendSetting(void)
Definition: view.c:292
CON_TOTALLINES_MASK
#define CON_TOTALLINES_MASK
Definition: console.c:26
con_scale
static cvar_t * con_scale
Definition: console.c:86
_vid_fullscreen
cvar_t * _vid_fullscreen
Definition: refresh.c:34
client_state_s::oldframe
server_frame_t oldframe
Definition: client.h:213
R_RegisterFunctionsRTX
void R_RegisterFunctionsRTX()
Definition: main.c:3503
LOC_AddLocationsToScene
void LOC_AddLocationsToScene(void)
Definition: locs.c:177
CL_MuzzleFlash
void CL_MuzzleFlash(void)
Definition: effects.c:257
client_static_s::connect_count
int connect_count
Definition: client.h:412
CL_LogoutEffect
static void CL_LogoutEffect(vec3_t org, int type)
Definition: effects.c:1138
CL_RegisterTEntSounds
void CL_RegisterTEntSounds(void)
Definition: tent.c:64
R_AddDecal
void(* R_AddDecal)(decal_t *d)
Definition: refresh.c:427
scr_chathead
static unsigned scr_chathead
Definition: screen.c:895
HTTP_Init
void HTTP_Init(void)
Definition: http.c:436
cl_sfx_railg
qhandle_t cl_sfx_railg
Definition: tent.c:32
connstate_t
connstate_t
Definition: client.h:332
net_qport
cvar_t * net_qport
Definition: chan.c:98
console_s::initialized
qboolean initialized
Definition: console.c:44
ASYNC_MAXFPS
@ ASYNC_MAXFPS
Definition: main.c:3099
cl_mod_explo4
qhandle_t cl_mod_explo4
Definition: tent.c:46
CON_TIMES
#define CON_TIMES
Definition: console.c:22
client_state_s::serverdelta
int serverdelta
Definition: client.h:215
main_extra
static int main_extra
Definition: main.c:3117
dlstate_t
dlstate_t
Definition: client.h:361
SCR_EndLoadingPlaque
void SCR_EndLoadingPlaque(void)
Definition: screen.c:1456
SHOWNET
#define SHOWNET(...)
Definition: parse.c:61
backlerp
static float backlerp
Definition: mesh.c:26
CL_EmitDemoFrame
void CL_EmitDemoFrame(void)
Definition: demo.c:186
ext
char ext[4]
Definition: images.c:657
explosion_t
Definition: client.h:60
LAG_WIDTH
#define LAG_WIDTH
Definition: screen.c:517
Cmd_TokenizeString
void Cmd_TokenizeString(const char *text, qboolean macroExpand)
Definition: cmd.c:1399
CL_LoadDownloadIgnores
void CL_LoadDownloadIgnores(void)
Definition: download.c:173
client_state_s::weaponModels
char weaponModels[MAX_CLIENTWEAPONMODELS][MAX_QPATH]
Definition: client.h:311
SYNC_FULL
@ SYNC_FULL
Definition: main.c:3093
check_skins
static void check_skins(const char *name)
Definition: download.c:573
LOAD_NONE
@ LOAD_NONE
Definition: client.h:607
client_static_s::frames_written
int frames_written
Definition: client.h:458
console_s::linewidth
int linewidth
Definition: console.c:53
cl_yawspeed
static cvar_t * cl_yawspeed
Definition: input.c:40
BSP_InlineModel
mmodel_t * BSP_InlineModel(bsp_t *bsp, const char *name)
Definition: bsp.c:1459
VID_PumpEvents
void VID_PumpEvents(void)
Definition: client.c:971
format_demo_size
static size_t format_demo_size(char *buffer, size_t size)
Definition: demo.c:230
Cmd_RawArgsFrom
char * Cmd_RawArgsFrom(int from)
Definition: cmd.c:1021
MSG_WriteByte
void MSG_WriteByte(int c)
Definition: msg.c:107
read_first_message
static int read_first_message(qhandle_t f)
Definition: demo.c:526
IN_MLookUp
static void IN_MLookUp(void)
Definition: input.c:453
explosion_t::lightcolor
vec3_t lightcolor
Definition: client.h:77
client_static_s::ignores
string_entry_t * ignores
Definition: client.h:448
Cmd_Deregister
void Cmd_Deregister(const cmdreg_t *reg)
Definition: cmd.c:1580
cl_sfx_disrexp
qhandle_t cl_sfx_disrexp
Definition: tent.c:39
SCR_ScoreDump_f
static void SCR_ScoreDump_f(void)
Definition: ascii.c:348
cl_add_blend
static cvar_t * cl_add_blend
Definition: view.c:38
com_timedemo
cvar_t * com_timedemo
Definition: common.c:97
client_state_s::sound_precache
qhandle_t sound_precache[MAX_SOUNDS]
Definition: client.h:305
V_AddEntity
void V_AddEntity(entity_t *ent)
Definition: view.c:91
IN_ForwardDown
static void IN_ForwardDown(void)
Definition: input.c:393
inflate_udp_download
static int inflate_udp_download(byte *data, int inlen, int outlen)
Definition: download.c:361
cl_mod_flash
qhandle_t cl_mod_flash
Definition: tent.c:43
client_state_s::baseconfigstrings
char baseconfigstrings[MAX_CONFIGSTRINGS][MAX_QPATH]
Definition: client.h:288
V_Shutdown
void V_Shutdown(void)
Definition: view.c:560
svc_muzzleflash
#define svc_muzzleflash
Definition: g_local.h:36
Cmd_Argv
char * Cmd_Argv(int arg)
Definition: cmd.c:899
scr_chathud_x
static cvar_t * scr_chathud_x
Definition: screen.c:82
svc_stufftext
#define svc_stufftext
Definition: g_local.h:41
Sys_Milliseconds
unsigned Sys_Milliseconds(void)
Definition: system.c:644
player_update
static void player_update(server_frame_t *oldframe, server_frame_t *frame, int framediv)
Definition: entities.c:294
SCR_DebugGraph
void SCR_DebugGraph(float value, int color)
IN_UpUp
static void IN_UpUp(void)
Definition: input.c:386
in_grab
static cvar_t * in_grab
Definition: input.c:77
c_console
static const cmdreg_t c_console[]
Definition: console.c:417
console_s::chatPrompt
commandPrompt_t chatPrompt
Definition: console.c:67
tent_params_t::entity2
int entity2
Definition: client.h:668
cparticle_s::next
struct cparticle_s * next
Definition: client.h:781
Cmd_Argc
int Cmd_Argc(void)
Definition: cmd.c:889
CL_Stop_f
void CL_Stop_f(void)
Definition: demo.c:268
CL_ParseNuke
static void CL_ParseNuke(void)
Definition: tent.c:877
Con_RunConsole
void Con_RunConsole(void)
Definition: console.c:982
read_next_message
static int read_next_message(qhandle_t f)
Definition: demo.c:589
in_down
static kbutton_t in_down
Definition: input.c:293
CL_ParticleSmokeEffect
void CL_ParticleSmokeEffect(vec3_t org, vec3_t dir, int color, int count, int magnitude)
Definition: newfx.c:721
client_state_s::predicted_step
float predicted_step
Definition: client.h:189
LOC_Alloc
static location_t * LOC_Alloc(const char *name)
Definition: locs.c:42
r_maxfps
cvar_t * r_maxfps
Definition: main.c:33
Con_CarriageRet
static void Con_CarriageRet(void)
Definition: console.c:499
con_clock
static cvar_t * con_clock
Definition: console.c:82
CL_AddBeams
static void CL_AddBeams(void)
Definition: tent.c:594
server_frame_t::areabytes
int areabytes
Definition: client.h:135
SCR_DrawLoading
static void SCR_DrawLoading(void)
Definition: screen.c:1964
ch_health
static cvar_t * ch_health
Definition: screen.c:85
client_static_s::recording
qhandle_t recording
Definition: client.h:454
vec3_origin
vec3_t vec3_origin
Definition: shared.c:21
cl_sustain_s::org
vec3_t org
Definition: client.h:747
location_t::entry
list_t entry
Definition: locs.c:26
client_state_s::servercount
int servercount
Definition: client.h:276
Con_CheckTop
static void Con_CheckTop(void)
Definition: console.c:391
CL_BlasterParticles
void CL_BlasterParticles(vec3_t org, vec3_t dir)
Definition: effects.c:1300
cl_noskins
cvar_t * cl_noskins
Definition: main.c:25
width
static int width
Definition: physical_sky.c:38
con_speed
static cvar_t * con_speed
Definition: console.c:84
console_s::scale
float scale
Definition: console.c:55
Con_ClearNotify_f
void Con_ClearNotify_f(void)
Definition: console.c:276
CL_SendDefaultCmd
static void CL_SendDefaultCmd(void)
Definition: input.c:924
loc_dist
static cvar_t * loc_dist
Definition: locs.c:35
cinematics_t::height
int height
Definition: cin.c:41
CL_RegisterBspModels
void CL_RegisterBspModels(void)
Definition: precache.c:226
cl_sustain_s::dir
vec3_t dir
Definition: client.h:748
FS_FOpenFile
ssize_t FS_FOpenFile(const char *name, qhandle_t *f, unsigned mode)
Definition: files.c:1692
cparticle_s::alphavel
float alphavel
Definition: client.h:790
R_Init
qboolean R_Init(qboolean total)
Definition: main.c:234
cinematics_t::file_name
char file_name[MAX_QPATH]
Definition: cin.c:53
IN_UseUp
static void IN_UseUp(void)
Definition: input.c:433
Con_Paste
static void Con_Paste(void)
Definition: console.c:1096
MODE_MODELIST
#define MODE_MODELIST
Definition: refresh.c:40
cmd_buffer
cmdbuf_t cmd_buffer
Definition: cmd.c:49
scr_cmds
static const cmdreg_t scr_cmds[]
Definition: screen.c:1332
ch_alpha
static cvar_t * ch_alpha
Definition: screen.c:89
cl_protocol
cvar_t * cl_protocol
Definition: main.c:68
CL_PlainExplosion
static explosion_t * CL_PlainExplosion(qboolean big)
Definition: tent.c:169
CL_AdjustAngles
static void CL_AdjustAngles(int msec)
Definition: input.c:566
clientinfo_s::name
char name[MAX_QPATH]
Definition: client.h:113
client_state_s::sendPacketNow
qboolean sendPacketNow
Definition: client.h:180
DL_COLOR
#define DL_COLOR(r, g, b)
CL_ClearSustains
static void CL_ClearSustains(void)
Definition: tent.c:803
in_enable
static cvar_t * in_enable
Definition: input.c:73
cl_maxpackets
static cvar_t * cl_maxpackets
Definition: input.c:24
cparticle_s::rgba
color_t rgba
Definition: client.h:791
r_particles
particle_t r_particles[MAX_PARTICLES]
Definition: view.c:62
SCR_UpdateScreen
void SCR_UpdateScreen(void)
Definition: screen.c:2142
IN_UpDown
static void IN_UpDown(void)
Definition: input.c:385
client_static_s::challenge
int challenge
Definition: client.h:425
clientinfo_s::model
qhandle_t model
Definition: client.h:118
ca_precached
@ ca_precached
Definition: client.h:339
client_state_s::refdef
refdef_t refdef
Definition: client.h:253
scr_showturtle
static cvar_t * scr_showturtle
Definition: screen.c:61
IN_RightDown
static void IN_RightDown(void)
Definition: input.c:391
client_static_s::seeking
qboolean seeking
Definition: client.h:469
CL_ClientCommand
void CL_ClientCommand(const char *string)
Definition: main.c:299
ref_extra
static int ref_extra
Definition: main.c:3117
con_notifylines
static cvar_t * con_notifylines
Definition: console.c:81
Com_Error
void Com_Error(error_type_t type, const char *fmt,...)
Definition: g_main.c:258
BSP_Free
void BSP_Free(bsp_t *bsp)
Definition: bsp.c:932
demosnap_t
Definition: demo.c:757
client_state_s::frameflags
unsigned frameflags
Definition: client.h:210
R_RegisterModel
qhandle_t R_RegisterModel(const char *name)
Definition: models.c:305
dedicated
cvar_t * dedicated
Definition: g_main.c:46
allow_download_maps
cvar_t * allow_download_maps
Definition: common.c:109
allow_download_textures
cvar_t * allow_download_textures
Definition: common.c:110
client_state_s::playerEntityOrigin
vec3_t playerEntityOrigin
Definition: client.h:263
centity_s::current
entity_state_t current
Definition: client.h:86
CL_ForceWall
void CL_ForceWall(vec3_t start, vec3_t end, int color)
Definition: newfx.c:143
CL_DebugTrail
void CL_DebugTrail(vec3_t start, vec3_t end)
Definition: newfx.c:63
gl_modulate_entities
cvar_t * gl_modulate_entities
Definition: main.c:50
client_static_s::current
dlqueue_t * current
Definition: client.h:440
CL_ExplosionParticles
void CL_ExplosionParticles(vec3_t org)
Definition: effects.c:1221
S_UnqueueRawSamples
void S_UnqueueRawSamples()
Definition: mix.c:400
r_numparticles
int r_numparticles
Definition: view.c:61
ch_blue
static cvar_t * ch_blue
Definition: screen.c:88
client_state_s::localmove
vec3_t localmove
Definition: client.h:234
DL_MODEL
@ DL_MODEL
Definition: client.h:353
client_state_s::predicted_origin
vec3_t predicted_origin
Definition: client.h:193
cinematics_t::s_khz_original
int s_khz_original
Definition: cin.c:35
write_udp_download
static int write_udp_download(byte *data, int size)
Definition: download.c:344
CL_ShutdownRefresh
void CL_ShutdownRefresh(void)
Definition: refresh.c:375
client_static_s::others_dropped
int others_dropped
Definition: client.h:460
explosion_t::start
float start
Definition: client.h:78
Prompt_HistoryUp
void Prompt_HistoryUp(commandPrompt_t *prompt)
Definition: prompt.c:490
cinematics_t::s_width
int s_width
Definition: cin.c:37
m_forward
static cvar_t * m_forward
Definition: input.c:53
V_ClearScene
static void V_ClearScene(void)
Definition: view.c:75
emit_delta_frame
static void emit_delta_frame(server_frame_t *from, server_frame_t *to, int fromnum, int tonum)
Definition: demo.c:145
forward
static vec3_t forward
Definition: p_view.c:27
sb_nums
static const char *const sb_nums[2][STAT_PICS]
Definition: screen.c:107
r_numparticles
int r_numparticles
Definition: view.c:61
CL_Trace
static trace_t q_gameabi CL_Trace(vec3_t start, vec3_t mins, vec3_t maxs, vec3_t end)
Definition: predict.c:118
CL_ClampSpeed
static void CL_ClampSpeed(vec3_t move)
Definition: input.c:619
svc_temp_entity
#define svc_temp_entity
Definition: g_local.h:38
ignore_t::match
char match[1]
Definition: main.c:1836
downloads_pending
static qboolean downloads_pending(dltype_t type)
Definition: download.c:709
cl_async
cvar_t * cl_async
Definition: main.c:32
CL_WidowSplash
void CL_WidowSplash(void)
Definition: newfx.c:582
cl_mod_explosions
qhandle_t cl_mod_explosions[4]
Definition: tent.c:51
clientinfo_s::icon
qhandle_t icon
Definition: client.h:115
SCR_RegisterMedia
void SCR_RegisterMedia(void)
Definition: screen.c:1297
msg_write
sizebuf_t msg_write
Definition: msg.c:34
CL_ParticleEffect2
void CL_ParticleEffect2(vec3_t org, vec3_t dir, int color, int count)
Definition: effects.c:1060
SCR_FinishCinematic
void SCR_FinishCinematic(void)
Definition: cin.c:105
check_file_len
static qerror_t check_file_len(const char *path, size_t len, dltype_t type)
Definition: download.c:510
CL_ParseGamestate
static void CL_ParseGamestate(void)
Definition: parse.c:458
client_static_s::frames_read
int frames_read
Definition: client.h:461
Con_Clear_f
static void Con_Clear_f(void)
Definition: console.c:214
console_s::x
int x
Definition: console.c:48
c_demo
static const cmdreg_t c_demo[]
Definition: demo.c:1258
client_static_s::userinfo_modified
int userinfo_modified
Definition: client.h:383
scr_showpause
static cvar_t * scr_showpause
Definition: screen.c:56
scr_lag_y
static cvar_t * scr_lag_y
Definition: screen.c:66
cl_disconnectcmd
cvar_t * cl_disconnectcmd
Definition: main.c:59
client_state_s::predicted_step_frame
unsigned predicted_step_frame
Definition: client.h:191
Cvar_ClampValue
float Cvar_ClampValue(cvar_t *var, float min, float max)
Definition: cvar.c:571
console_s::color
int color
Definition: console.c:50
CL_FlyParticles
static void CL_FlyParticles(vec3_t origin, int count)
Definition: effects.c:1767
in_moveleft
static kbutton_t in_moveleft
Definition: input.c:291
con_font
static cvar_t * con_font
Definition: console.c:87
client_state_s::model_draw
qhandle_t model_draw[MAX_MODELS]
Definition: client.h:302
va
char * va(const char *format,...)
Definition: shared.c:429
Z_Free
void Z_Free(void *ptr)
Definition: zone.c:147
REQ_RCON
@ REQ_RCON
Definition: main.c:114
Pmove
void Pmove(pmove_t *pmove, pmoveParams_t *params)
Definition: pmove.c:1127
CL_BaseMove
static void CL_BaseMove(vec3_t move)
Definition: input.c:595
CL_ClearEffects
void CL_ClearEffects(void)
Definition: effects.c:2067
DL_DONE
@ DL_DONE
Definition: client.h:364
clientinfo_s::weaponmodel
qhandle_t weaponmodel[MAX_CLIENTWEAPONMODELS]
Definition: client.h:119
CHAT_LINE_MASK
#define CHAT_LINE_MASK
Definition: screen.c:887
client_static_s::serverProtocol
int serverProtocol
Definition: client.h:422
vid_display
cvar_t * vid_display
Definition: refresh.c:35
CL_ParseCenterPrint
static void CL_ParseCenterPrint(void)
Definition: parse.c:995
client_state_s::layout
char layout[MAX_NET_STRING]
Definition: client.h:269
cl_cmdbuf
cmdbuf_t cl_cmdbuf
Definition: main.c:104
server_frame_t::areabits
byte areabits[MAX_MAP_AREA_BYTES]
Definition: client.h:134
cl_demowait
static cvar_t * cl_demowait
Definition: demo.c:29
Cmd_Register
void Cmd_Register(const cmdreg_t *reg)
Definition: cmd.c:1572
cl_sfx_footsteps
qhandle_t cl_sfx_footsteps[4]
Definition: tent.c:36
Con_CheckResize
void Con_CheckResize(void)
Definition: console.c:367
clientinfo_s::model_name
char model_name[MAX_QPATH]
Definition: client.h:116
MSG_ReadLong
int MSG_ReadLong(void)
Definition: msg.c:1517
cparticle_s::org
vec3_t org
Definition: client.h:785
in_impulse
static int in_impulse
Definition: input.c:295
cinematics_t::width
int width
Definition: cin.c:40
IN_StrafeUp
static void IN_StrafeUp(void)
Definition: input.c:408
CL_ParseTEntPacket
static void CL_ParseTEntPacket(void)
Definition: parse.c:659
CONNECT_DELAY
#define CONNECT_DELAY
Definition: client.h:327
Key_IsDown
int Key_IsDown(int key)
Definition: keys.c:204
dlqueue_t::state
dlstate_t state
Definition: client.h:370
main_msec
static int main_msec
Definition: main.c:3116
con_scroll
static cvar_t * con_scroll
Definition: console.c:89
S_Init
void S_Init(void)
Definition: main.c:148
origin
static vec3_t origin
Definition: mesh.c:27
R_DrawString
int(* R_DrawString)(int x, int y, int flags, size_t maxChars, const char *string, qhandle_t font)
Definition: refresh.c:417
phys_extra
static int phys_extra
Definition: main.c:3117
client_state_s::baseclientinfo
clientinfo_t baseclientinfo
Definition: client.h:309
cl_sustain_s::magnitude
int magnitude
Definition: client.h:751
CL_AddTEnts
void CL_AddTEnts(void)
Definition: tent.c:1445
client_state_s::cmds
usercmd_t cmds[CMD_BACKUP]
Definition: client.h:183
console_s::prompt
commandPrompt_t prompt
Definition: console.c:68
AngleVectors
void AngleVectors(vec3_t angles, vec3_t forward, vec3_t right, vec3_t up)
Definition: shared.c:23
client_state_s::time
int time
Definition: client.h:244
CL_ClearState
void CL_ClearState(void)
Definition: main.c:699
scr_centerstring
static char scr_centerstring[MAX_STRING_CHARS]
Definition: screen.c:450
client_history_t::sent
unsigned sent
Definition: client.h:123
con
static console_t con
Definition: console.c:78
ASYNC_FULL
@ ASYNC_FULL
Definition: main.c:3100
Prompt_LoadHistory
void Prompt_LoadHistory(commandPrompt_t *prompt, const char *filename)
Definition: prompt.c:588
CL_ParseTEnt
void CL_ParseTEnt(void)
Definition: tent.c:1069
Con_InteractiveMode
static void Con_InteractiveMode(void)
Definition: console.c:1055
CL_AddParticles
void CL_AddParticles(void)
Definition: effects.c:1989
CL_ClampPitch
static void CL_ClampPitch(void)
Definition: input.c:628
fs_game
cvar_t * fs_game
Definition: files.c:202
Prompt_SaveHistory
void Prompt_SaveHistory(commandPrompt_t *prompt, const char *filename, int lines)
Definition: prompt.c:559
v_cmds
static const cmdreg_t v_cmds[]
Definition: view.c:515
listener_forward
vec3_t listener_forward
Definition: main.c:36
cl_demosnaps
static cvar_t * cl_demosnaps
Definition: demo.c:27
STAT_PICS
#define STAT_PICS
Definition: screen.c:23
SCR_ScoreShot_f
static void SCR_ScoreShot_f(void)
Definition: ascii.c:293
client_static_s::pending
int pending
Definition: client.h:439
IN_LookdownUp
static void IN_LookdownUp(void)
Definition: input.c:400
in_use
static kbutton_t in_use
Definition: input.c:292
explosion_t::ent
entity_t ent
Definition: client.h:74
client_static_s::servername
char servername[MAX_OSPATH]
Definition: client.h:410
NOPART_ROCKET_EXPLOSION
#define NOPART_ROCKET_EXPLOSION
Definition: client.h:497
console_s::display
int display
Definition: console.c:49
NET_Config
void NET_Config(netflag_t flag)
Definition: net.c:1312
Q_strlcpy
size_t Q_strlcpy(char *dst, const char *src, size_t size)
Definition: shared.c:715
CL_ParseMuzzleFlashPacket
static void CL_ParseMuzzleFlashPacket(int mask)
Definition: parse.c:788
Com_LPrintf
void Com_LPrintf(print_type_t type, const char *fmt,...)
Definition: g_main.c:242
cl_mod_dmspot
qhandle_t cl_mod_dmspot
Definition: tent.c:50
client_static_s::percent
int percent
Definition: client.h:441
CL_ParseLaser
static void CL_ParseLaser(int colors)
Definition: tent.c:487
cl_sustain_s::endtime
int endtime
Definition: client.h:744
cl_mod_bfg_explo
qhandle_t cl_mod_bfg_explo
Definition: tent.c:47
Con_Close
void Con_Close(qboolean force)
Definition: console.c:124
CL_UpdateGibSetting
static void CL_UpdateGibSetting(void)
Definition: main.c:203
cl_railspiral_color_changed
static void cl_railspiral_color_changed(cvar_t *self)
Definition: tent.c:914
cl_add_blend_changed
static void cl_add_blend_changed(cvar_t *self)
Definition: view.c:523
client_state_s::lastTransmitCmdNumber
unsigned lastTransmitCmdNumber
Definition: client.h:178
V_AddLight
#define V_AddLight(org, intensity, r, g, b)
Definition: client.h:728
Com_GetLastError
char * Com_GetLastError(void)
Definition: common.c:391
cl_sidespeed
static cvar_t * cl_sidespeed
Definition: input.c:39
cl_entities
centity_t cl_entities[MAX_EDICTS]
Definition: main.c:101
ASYNC_VIDEO
@ ASYNC_VIDEO
Definition: main.c:3098
MSG_WriteShort
void MSG_WriteShort(int c)
Definition: msg.c:125
scr_font
static cvar_t * scr_font
Definition: screen.c:74
dlqueue_t::path
char path[1]
Definition: client.h:371
cl_demomsglen
static cvar_t * cl_demomsglen
Definition: demo.c:28
cin
static cinematics_t cin
Definition: cin.c:60
server_frame_t
Definition: client.h:128
client_state_s::clientinfo
clientinfo_t clientinfo[MAX_CLIENTS]
Definition: client.h:308
set_active_state
static void set_active_state(void)
Definition: entities.c:237
SCR_ReadNextFrame
qhandle_t SCR_ReadNextFrame(void)
Definition: cin.c:337
IN_MoveleftDown
static void IN_MoveleftDown(void)
Definition: input.c:401
Con_Say
static void Con_Say(char *msg)
Definition: console.c:1049
precache_sexed_total
static int precache_sexed_total
Definition: download.c:38
IN_Activate
void IN_Activate(void)
Definition: input.c:117
UI_Draw
void UI_Draw(int realtime)
Definition: ui.c:420
NOEXP_ROCKET
#define NOEXP_ROCKET
Definition: client.h:502
ch_x
static cvar_t * ch_x
Definition: screen.c:92
UI_Shutdown
void UI_Shutdown(void)
Definition: ui.c:674
cl_mod_powerscreen
qhandle_t cl_mod_powerscreen
Definition: tent.c:48
in_state_t::api
inputAPI_t api
Definition: input.c:66
LOC_Here_m
static size_t LOC_Here_m(char *buffer, size_t size)
Definition: locs.c:221
CL_ClearParticles
static void CL_ClearParticles(void)
Definition: effects.c:844
con_alpha
static cvar_t * con_alpha
Definition: console.c:85
precache_sexed_sounds
static int precache_sexed_sounds[MAX_SOUNDS]
Definition: download.c:37
m_invert
cvar_t * m_invert
Definition: input.c:51
m_yaw
cvar_t * m_yaw
Definition: input.c:52
scr_demobar
static cvar_t * scr_demobar
Definition: screen.c:73
UI_OpenMenu
void UI_OpenMenu(uiMenu_t type)
Definition: ui.c:208
CL_BlasterParticles2
void CL_BlasterParticles2(vec3_t org, vec3_t dir, unsigned int color)
Definition: newfx.c:761
client_state_s::mapname
char mapname[MAX_QPATH]
Definition: client.h:290
S_ParseStartSound
void S_ParseStartSound(void)
Definition: main.c:889
cl_railcore_color_changed
static void cl_railcore_color_changed(cvar_t *self)
Definition: tent.c:905
cl_autopause
cvar_t * cl_autopause
Definition: main.c:34
CL_CheckForPause
void CL_CheckForPause(void)
Definition: main.c:3056
PRECACHE_MODELS
@ PRECACHE_MODELS
Definition: download.c:30
OGG_PlayTrack
void OGG_PlayTrack(int trackNo)
Definition: ogg.c:323
FS_Length
ssize_t FS_Length(qhandle_t f)
Definition: files.c:487
location_t
Definition: locs.c:25
cl_mod_smoke
qhandle_t cl_mod_smoke
Definition: tent.c:42
CHAT_NONE
@ CHAT_NONE
Definition: console.c:31
centity_s
Definition: client.h:85
scr_viewsize
cvar_t * scr_viewsize
Definition: screen.c:54
client_history_t::cmdNumber
unsigned cmdNumber
Definition: client.h:125
toggle_console
static void toggle_console(consoleMode_t mode, chatMode_t chat)
Definition: console.c:169
CL_BloodParticleEffect
void CL_BloodParticleEffect(vec3_t org, vec3_t dir, int color, int count)
Definition: effects.c:1006
Prompt_Clear
void Prompt_Clear(commandPrompt_t *prompt)
Definition: prompt.c:540
IN_LookdownDown
static void IN_LookdownDown(void)
Definition: input.c:399
scr_center_lines
static int scr_center_lines
Definition: screen.c:452
UI_ModeChanged
void UI_ModeChanged(void)
Definition: ui.c:602
cl
client_state_t cl
Definition: main.c:99
server_frame_t::clientNum
int clientNum
Definition: client.h:138
FS_Write
ssize_t FS_Write(const void *buf, size_t len, qhandle_t f)
Definition: files.c:1643
dirtoangles
static void dirtoangles(vec3_t angles)
Definition: tent.c:1049
chatline_t
Definition: screen.c:889
ch_scale
static cvar_t * ch_scale
Definition: screen.c:91
CL_AddEntities
void CL_AddEntities(void)
Definition: entities.c:1378
client_static_s::frametime
float frametime
Definition: client.h:390
in_forward
static kbutton_t in_forward
Definition: input.c:290
client_state_s::predicted_step_time
unsigned predicted_step_time
Definition: client.h:190
Con_PostInit
void Con_PostInit(void)
Definition: console.c:479
phys_msec
static int phys_msec
Definition: main.c:3116
cinematics_t::file
qhandle_t file
Definition: cin.c:54
CL_ClearLasers
static void CL_ClearLasers(void)
Definition: tent.c:429
cl_batchcmds
static cvar_t * cl_batchcmds
Definition: input.c:31
cl_vwep
cvar_t * cl_vwep
Definition: main.c:72
allow_download_sounds
cvar_t * allow_download_sounds
Definition: common.c:108
CL_ParseInventory
static void CL_ParseInventory(void)
Definition: parse.c:1024
demosnap_t::entry
list_t entry
Definition: demo.c:758
CL_SmokeAndFlash
void CL_SmokeAndFlash(vec3_t origin)
Definition: tent.c:207
cls
client_static_t cls
Definition: main.c:98
ca_uninitialized
@ ca_uninitialized
Definition: client.h:333
client_state_s::frames
server_frame_t frames[UPDATE_BACKUP]
Definition: client.h:209
FOR_EACH_DLQ
#define FOR_EACH_DLQ(q)
Definition: client.h:344
CL_ParseFrame
static void CL_ParseFrame(int extrabits)
Definition: parse.c:189
exec_server_string
static void exec_server_string(cmdbuf_t *buf, const char *text)
Definition: main.c:2560
ca_cinematic
@ ca_cinematic
Definition: client.h:341
MSG_WriteString
void MSG_WriteString(const char *string)
Definition: msg.c:160
c
statCounters_t c
Definition: main.c:30
DL_RUNNING
@ DL_RUNNING
Definition: client.h:363
cparticle_s::color
int color
Definition: client.h:788
V_CalcFov
float V_CalcFov(float fov_x, float width, float height)
Definition: view.c:379
lerp_client_fov
static float lerp_client_fov(float ofov, float nfov, float lerp)
Definition: entities.c:1218
IN_AttackDown
static void IN_AttackDown(void)
Definition: input.c:410
cinematics_t::palette_active
qboolean palette_active
Definition: cin.c:51
OGG_Stop
void OGG_Stop(void)
Definition: ogg.c:488
CL_WriteConfig
void CL_WriteConfig(void)
Definition: main.c:2391
client_static_s::queue
list_t queue
Definition: client.h:438
CL_PrepRefresh
void CL_PrepRefresh(void)
Definition: precache.c:333
cl_railspiral_radius
static cvar_t * cl_railspiral_radius
Definition: tent.c:903
in_attack
static kbutton_t in_attack
Definition: input.c:292
demosnap_t::framenum
int framenum
Definition: demo.c:759
client_state_s::numEntityStates
int numEntityStates
Definition: client.h:205
r_particles
particle_t r_particles[MAX_PARTICLES]
Definition: view.c:62
client_static_s::eof
qboolean eof
Definition: client.h:470
cl_mod_parasite_segment
qhandle_t cl_mod_parasite_segment
Definition: tent.c:44
R_Shutdown
void(* R_Shutdown)(qboolean total)
Definition: refresh.c:404
cl_mod_laser
qhandle_t cl_mod_laser
Definition: tent.c:49
SHOWMISS
#define SHOWMISS(...)
Definition: client.h:533
cl_mod_explode
qhandle_t cl_mod_explode
Definition: tent.c:41
Cvar_FixCheats
void Cvar_FixCheats(void)
Definition: cvar.c:601
R_GetPicSize
qboolean R_GetPicSize(int *w, int *h, qhandle_t pic)
Definition: images.c:1289
client_state_s::cmd
usercmd_t cmd
Definition: client.h:182
LAG_WARN_BIT
#define LAG_WARN_BIT
Definition: screen.c:521
CL_ClearBeams
static void CL_ClearBeams(void)
Definition: tent.c:524
client_state_s::predicted_origins
short predicted_origins[CMD_BACKUP][3]
Definition: client.h:185
client_state_s::v_right
vec3_t v_right
Definition: client.h:258
CL_SendKeepAlive
static void CL_SendKeepAlive(void)
Definition: input.c:1104
V_Init
void V_Init(void)
Definition: view.c:533
server_frame_t::numEntities
int numEntities
Definition: client.h:140
kbutton_s::state
int state
Definition: input.c:286
Con_DrawNotify
static void Con_DrawNotify(void)
Definition: console.c:704
cl_mod_lightning
qhandle_t cl_mod_lightning
Definition: tent.c:53
ch_y
static cvar_t * ch_y
Definition: screen.c:93
mz
mz_params_t mz
Definition: parse.c:656
entity_event
static void entity_event(int number)
Definition: entities.c:198
MAX_CLIENTWEAPONMODELS
#define MAX_CLIENTWEAPONMODELS
Definition: client.h:110
cl_ignores
static list_t cl_ignores
Definition: main.c:1839
scr_chathud
static cvar_t * scr_chathud
Definition: screen.c:79
up
static vec3_t up
Definition: p_view.c:27
cl_fuzzhack
static cvar_t * cl_fuzzhack
Definition: input.c:26
PARTICLE_GRAVITY
#define PARTICLE_GRAVITY
Definition: client.h:776
client_state_s::fov_x
float fov_x
Definition: client.h:254
location_t::origin
vec3_t origin
Definition: locs.c:27
ca_challenging
@ ca_challenging
Definition: client.h:335
Cvar_ClampInteger
int Cvar_ClampInteger(cvar_t *var, int min, int max)
Definition: cvar.c:549
SCR_Init
void SCR_Init(void)
Definition: screen.c:1348
scr_centertime
static cvar_t * scr_centertime
Definition: screen.c:55
scr_fps
static cvar_t * scr_fps
Definition: screen.c:71
mz_params_t::silenced
int silenced
Definition: client.h:675
cinematics_t::s_rate
int s_rate
Definition: cin.c:36
finish_udp_download
static void finish_udp_download(const char *msg)
Definition: download.c:311
client_history_t::rcvd
unsigned rcvd
Definition: client.h:124
lookspring
static cvar_t * lookspring
Definition: input.c:46
right
static vec3_t right
Definition: p_view.c:27
Con_Linefeed
static void Con_Linefeed(void)
Definition: console.c:516
client_static_s::download
struct client_static_s::@2 download
m_side
static cvar_t * m_side
Definition: input.c:54
MSG_ReadString
size_t MSG_ReadString(char *dest, size_t size)
Definition: msg.c:1531
m_autosens
cvar_t * m_autosens
Definition: input.c:35
svc_inventory
#define svc_inventory
Definition: g_local.h:40
CL_TeleportParticles
void CL_TeleportParticles(vec3_t org)
Definition: effects.c:1942
console_s::charsetImage
qhandle_t charsetImage
Definition: console.c:62
server_frame_t::ps
player_state_t ps
Definition: client.h:137
R_RenderFrame
void(* R_RenderFrame)(refdef_t *fd)
Definition: refresh.c:408
LOC_Add_f
static void LOC_Add_f(void)
Definition: locs.c:268
CL_FRAMETIME
#define CL_FRAMETIME
Definition: client.h:161
vid_geometry
cvar_t * vid_geometry
Definition: refresh.c:31
demosnap_t::msglen
size_t msglen
Definition: demo.c:761
Com_SetLastError
void Com_SetLastError(const char *msg)
Definition: common.c:382
S_EndRegistration
void S_EndRegistration(void)
Definition: main.c:522
R_BeginRegistration
void(* R_BeginRegistration)(const char *map)
Definition: refresh.c:405
in_lookdown
static kbutton_t in_lookdown
Definition: input.c:291
centity_s::trailcount
int trailcount
Definition: client.h:93
CL_UpdatePredictSetting
static void CL_UpdatePredictSetting(void)
Definition: main.c:233
S_FreeAllSounds
void S_FreeAllSounds(void)
Definition: main.c:226
te
tent_params_t te
Definition: parse.c:655
Key_WriteBindings
void Key_WriteBindings(qhandle_t f)
Definition: keys.c:475
CL_ParseConfigstring
static void CL_ParseConfigstring(int index)
Definition: parse.c:408
client_static_s::frames_dropped
int frames_dropped
Definition: client.h:459
CL_GTV_EmitFrame
void CL_GTV_EmitFrame(void)
Definition: gtv.c:107
IF_Clear
void IF_Clear(inputField_t *field)
Definition: field.c:56
allow_download_pics
cvar_t * allow_download_pics
Definition: common.c:111
scr_centertime_start
static unsigned scr_centertime_start
Definition: screen.c:451
client_history_t
Definition: client.h:122
SYNC_MAXFPS
@ SYNC_MAXFPS
Definition: main.c:3094
CL_RegisterSounds
void CL_RegisterSounds(void)
Definition: precache.c:203
centity_s::fly_stoptime
int fly_stoptime
Definition: client.h:103
Con_CheckResize
void Con_CheckResize(void)
Definition: console.c:367
CL_ParseStuffText
static void CL_ParseStuffText(void)
Definition: parse.c:1009
CL_Download_f
static void CL_Download_f(void)
Definition: download.c:909
IN_AttackUp
static void IN_AttackUp(void)
Definition: input.c:419
scr_lag_draw
static cvar_t * scr_lag_draw
Definition: screen.c:67
finish_demo
static void finish_demo(int ret)
Definition: demo.c:622
client_static_s::disable_screen
unsigned disable_screen
Definition: client.h:381
err
int err
Definition: win.h:24
Huff1TableInit
void Huff1TableInit(void)
Definition: cin.c:155
console_s::chat
chatMode_t chat
Definition: console.c:70
R_UnregisterImage
void R_UnregisterImage(qhandle_t handle)
Definition: images.c:1270
IN_Restart_f
static void IN_Restart_f(void)
Definition: input.c:129
clientinfo_s::skin_name
char skin_name[MAX_QPATH]
Definition: client.h:117
ch_red
static cvar_t * ch_red
Definition: screen.c:86
IN_ForwardUp
static void IN_ForwardUp(void)
Definition: input.c:394
Con_Popup
void Con_Popup(qboolean force)
Definition: console.c:152
R_SetScale
void(* R_SetScale)(float scale)
Definition: refresh.c:415
LOC_There_m
static size_t LOC_There_m(char *buffer, size_t size)
Definition: locs.c:244
CL_GTV_Resume
void CL_GTV_Resume(void)
Definition: gtv.c:256
LOC_FindClosest
static location_t * LOC_FindClosest(vec3_t pos)
Definition: locs.c:138
scr_font_changed
static void scr_font_changed(cvar_t *self)
Definition: screen.c:1322
mz_params_t::weapon
int weapon
Definition: client.h:674
fps_to_msec
static int fps_to_msec(int fps)
Definition: main.c:3120
allow_download
cvar_t * allow_download
Definition: common.c:105
cl_mod_grapple_cable
qhandle_t cl_mod_grapple_cable
Definition: tent.c:45
monster_flash_offset
const vec3_t monster_flash_offset[256]
Definition: m_flash.c:25
server_frame_t::number
int number
Definition: client.h:131
LOAD_CLIENTS
@ LOAD_CLIENTS
Definition: client.h:611
scr_vrect
vrect_t scr_vrect
Definition: screen.c:105
LOAD_MODELS
@ LOAD_MODELS
Definition: client.h:609
DL_PENDING
@ DL_PENDING
Definition: client.h:362
CL_BFGExplosionParticles
void CL_BFGExplosionParticles(vec3_t org)
Definition: effects.c:1905
CL_UpdateFrameTimes
void CL_UpdateFrameTimes(void)
Definition: main.c:3136
ca_connecting
@ ca_connecting
Definition: client.h:336
DI_FillAPI
void DI_FillAPI(inputAPI_t *api)
Definition: dinput.c:316
client_static_s::time_frames
unsigned time_frames
Definition: client.h:456
CL_LoadClientinfo
void CL_LoadClientinfo(clientinfo_t *ci, const char *s)
Definition: precache.c:104
CL_ParticleEffectWaterSplash
void CL_ParticleEffectWaterSplash(vec3_t org, vec3_t dir, int color, int count)
Definition: effects.c:959
m_autosens_changed
static void m_autosens_changed(cvar_t *self)
Definition: input.c:689
cls
client_static_t cls
Definition: main.c:98
con_param_changed
static void con_param_changed(cvar_t *self)
Definition: console.c:403
SCR_ClearChatHUD_f
void SCR_ClearChatHUD_f(void)
Definition: screen.c:897
cl_maxfps
cvar_t * cl_maxfps
Definition: main.c:31
listener_entnum
int listener_entnum
Definition: main.c:39
ignore_t
Definition: main.c:1833
freelook
static cvar_t * freelook
Definition: input.c:45
client_static_s::realtime
unsigned realtime
Definition: client.h:389
SCR_BeginLoadingPlaque
void SCR_BeginLoadingPlaque(void)
Definition: screen.c:1424
ignore_t::hits
unsigned hits
Definition: main.c:1835
client_static_s::temp
char temp[MAX_QPATH+4]
Definition: client.h:444
CL_SendUserinfo
static void CL_SendUserinfo(void)
Definition: input.c:1127
CL_ParseStartSoundPacket
static void CL_ParseStartSoundPacket(void)
Definition: parse.c:802
IN_LookupUp
static void IN_LookupUp(void)
Definition: input.c:398
svc_layout
#define svc_layout
Definition: g_local.h:39
R_EndFrame
void(* R_EndFrame)(void)
Definition: refresh.c:425
ca_loading
@ ca_loading
Definition: client.h:338
Cmd_AddMacro
void Cmd_AddMacro(const char *name, xmacro_t function)
Definition: cmd.c:770
cl_pitchspeed
static cvar_t * cl_pitchspeed
Definition: input.c:41
CL_AllocParticle
cparticle_t * CL_AllocParticle(void)
Definition: effects.c:856
CL_BubbleTrail
void CL_BubbleTrail(vec3_t start, vec3_t end)
Definition: effects.c:1718
scr_chathud_lines
static cvar_t * scr_chathud_lines
Definition: screen.c:80
CL_ClientCommand
void CL_ClientCommand(const char *string)
Definition: main.c:299
sv_running
cvar_t * sv_running
Definition: common.c:95
in_back
static kbutton_t in_back
Definition: input.c:290
cl_nodelta
static cvar_t * cl_nodelta
Definition: input.c:23
CL_CleanupDownloads
void CL_CleanupDownloads(void)
Definition: download.c:136
BSP_Load
qerror_t BSP_Load(const char *name, bsp_t **bsp_p)
Definition: bsp.c:1087
cl_forwardspeed
static cvar_t * cl_forwardspeed
Definition: input.c:38
CL_ParticleEffect
void CL_ParticleEffect(vec3_t org, vec3_t dir, int color, int count)
Definition: effects.c:877
color
static vec4_t color
Definition: mesh.c:33
console_s::current
int current
Definition: console.c:47
vid_modelist_changed
static void vid_modelist_changed(cvar_t *self)
Definition: refresh.c:279
client_state_s::history
client_history_t history[CMD_BACKUP]
Definition: client.h:186
cl_sfx_ric2
qhandle_t cl_sfx_ric2
Definition: tent.c:25
CL_UpdateGunSetting
static void CL_UpdateGunSetting(void)
Definition: main.c:180
CL_UpdateFrameTimes
void CL_UpdateFrameTimes(void)
Definition: main.c:3136
CL_LoadState
void CL_LoadState(load_state_t state)
Definition: console.c:541
cl
client_state_t cl
Definition: main.c:99
client_state_s::playerEntityAngles
vec3_t playerEntityAngles
Definition: client.h:264
CONNECT_FAST
#define CONNECT_FAST
Definition: client.h:330
Netchan_Close
void Netchan_Close(netchan_t *netchan)
Definition: chan.c:866
vid_geometry_changed
static void vid_geometry_changed(cvar_t *self)
Definition: refresh.c:269
FRAME_PRE
#define FRAME_PRE
Definition: demo.c:176
scr_chatlines
static chatline_t scr_chatlines[MAX_CHAT_LINES]
Definition: screen.c:894
client_state_s::fov_y
float fov_y
Definition: client.h:255
MODE_FULLSCREEN
#define MODE_FULLSCREEN
Definition: refresh.c:39
FS_FCloseFile
void FS_FCloseFile(qhandle_t f)
Definition: files.c:759
Q_concat
size_t Q_concat(char *dest, size_t size,...)
Definition: shared.c:758
Con_ClearTyping
void Con_ClearTyping(void)
Definition: console.c:109
CL_ColorExplosionParticles
void CL_ColorExplosionParticles(vec3_t org, int color, int run)
Definition: newfx.c:690
client_static_s::snapshots
list_t snapshots
Definition: client.h:467
LOC_LoadLocations
void LOC_LoadLocations(void)
Definition: locs.c:59
allow_download_models
cvar_t * allow_download_models
Definition: common.c:107
splash_color
static const byte splash_color[]
Definition: tent.c:1067
cparticle_s::time
float time
Definition: client.h:783
Cvar_VariableValue
float Cvar_VariableValue(const char *var_name)
Definition: cvar.c:89
MSG_ReadByte
int MSG_ReadByte(void)
Definition: msg.c:1475
con_notifytime
static cvar_t * con_notifytime
Definition: console.c:80
vid_rtx
cvar_t * vid_rtx
Definition: refresh.c:30
IN_MoverightDown
static void IN_MoverightDown(void)
Definition: input.c:403
scr_showitemname
static cvar_t * scr_showitemname
Definition: screen.c:62
Con_ClearNotify_f
void Con_ClearNotify_f(void)
Definition: console.c:276
tent_params_t::type
int type
Definition: client.h:660
cl_entities
centity_t cl_entities[MAX_EDICTS]
Definition: main.c:101
IN_LookupDown
static void IN_LookupDown(void)
Definition: input.c:397
client_static_s::serverAddress
netadr_t serverAddress
Definition: client.h:409
check_file
#define check_file(path, type)
Definition: download.c:570
avelocities
static vec3_t avelocities[NUMVERTEXNORMALS]
Definition: effects.c:25
CL_BubbleTrail2
void CL_BubbleTrail2(vec3_t start, vec3_t end, int dist)
Definition: newfx.c:228
CL_AddRequest
static request_t * CL_AddRequest(const netadr_t *adr, requestType_t type)
Definition: main.c:129
start_udp_download
static qboolean start_udp_download(dlqueue_t *q)
Definition: download.c:236
s_started
sndstarted_t s_started
Definition: main.c:32
Con_Action
static void Con_Action(void)
Definition: console.c:1062
ch_green
static cvar_t * ch_green
Definition: screen.c:87
vid_fullscreen
cvar_t * vid_fullscreen
Definition: refresh.c:33
CL_ParseDownload
static void CL_ParseDownload(int cmd)
Definition: parse.c:1033
CL_RestartRefresh
void CL_RestartRefresh(qboolean total)
Definition: main.c:2483
cl_railtrail_time
static cvar_t * cl_railtrail_time
Definition: tent.c:899
LOAD_MAP
@ LOAD_MAP
Definition: client.h:608
client_state_s::maxclients
int maxclients
Definition: client.h:279
CL_CleanupDemos
void CL_CleanupDemos(void)
Definition: demo.c:1179
IN_DownUp
static void IN_DownUp(void)
Definition: input.c:388
INSTANT_PARTICLE
#define INSTANT_PARTICLE
Definition: client.h:778
lookstrafe
static cvar_t * lookstrafe
Definition: input.c:47
IN_MoveleftUp
static void IN_MoveleftUp(void)
Definition: input.c:402
CL_ProcessSustain
static void CL_ProcessSustain(void)
Definition: tent.c:821
bytedirs
const vec3_t bytedirs[NUMVERTEXNORMALS]
Definition: math.c:80
IN_SpeedDown
static void IN_SpeedDown(void)
Definition: input.c:405
console_s::backImage
qhandle_t backImage
Definition: console.c:61
gl_brightness
cvar_t * gl_brightness
Definition: main.c:45
S_StartSound
void S_StartSound(const vec3_t origin, int entnum, int entchannel, qhandle_t hSfx, float vol, float attenuation, float timeofs)
Definition: main.c:824
cl_sfx_spark5
qhandle_t cl_sfx_spark5
Definition: tent.c:29
Key_AnyKeyDown
int Key_AnyKeyDown(void)
Definition: keys.c:220
cl_sfx_spark6
qhandle_t cl_sfx_spark6
Definition: tent.c:30
client_static_s::file_size
int file_size
Definition: client.h:463
CL_ParticleSteamEffect
void CL_ParticleSteamEffect(vec3_t org, vec3_t dir, int color, int count, int magnitude)
Definition: newfx.c:341
mz_params_t::entity
int entity
Definition: client.h:673
dlqueue_t::type
dltype_t type
Definition: client.h:369
Con_DrawConsole
void Con_DrawConsole(void)
Definition: console.c:1032
client_static_s::file_offset
int file_offset
Definition: client.h:464
precache_spawncount
static int precache_spawncount
Definition: main.c:1748
cparticle_s::alpha
float alpha
Definition: client.h:789
DL_RADIUS
#define DL_RADIUS(r)
sync_mode
static sync_mode_t sync_mode
Definition: main.c:3118
cl_sfx_rockexp
qhandle_t cl_sfx_rockexp
Definition: tent.c:33
in_changed_hard
static void in_changed_hard(cvar_t *self)
Definition: input.c:195
S_BeginRegistration
void S_BeginRegistration(void)
Definition: main.c:379
cl_adjustfov
static cvar_t * cl_adjustfov
Definition: view.c:51
tent_params_t::count
int count
Definition: client.h:665
load_state_t
load_state_t
Definition: client.h:606
SYNC_SLEEP_60
@ SYNC_SLEEP_60
Definition: main.c:3096
IF_Init
void IF_Init(inputField_t *field, size_t visibleChars, size_t maxChars)
Definition: field.c:36
CL_ParticleEffect3
void CL_ParticleEffect3(vec3_t org, vec3_t dir, int color, int count)
Definition: newfx.c:989
tent_params_t::color
int color
Definition: client.h:666
cl_railspiral_color
static cvar_t * cl_railspiral_color
Definition: tent.c:902
BEAMLENGTH
#define BEAMLENGTH
Definition: effects.c:1765
SCR_DrawActive
static void SCR_DrawActive(void)
Definition: screen.c:2080
cl_explosion_sprites
cvar_t * cl_explosion_sprites
Definition: main.c:56
explosion_t::frames
int frames
Definition: client.h:75
client_static_s::position
int position
Definition: client.h:442
client_static_s::netchan
netchan_t * netchan
Definition: client.h:421
listener_right
vec3_t listener_right
Definition: main.c:37
IN_Impulse
static void IN_Impulse(void)
Definition: input.c:438
IN_Shutdown
void IN_Shutdown(void)
Definition: input.c:173
CL_BigTeleportParticles
void CL_BigTeleportParticles(vec3_t org)
Definition: effects.c:1256
scr_draw2d
static cvar_t * scr_draw2d
Definition: screen.c:64
scr_chathud_y
static cvar_t * scr_chathud_y
Definition: screen.c:83
console_s::newline
int newline
Definition: console.c:51
cl_particle_num_factor
static cvar_t * cl_particle_num_factor
Definition: effects.c:836
CL_ParseSetting
static void CL_ParseSetting(void)
Definition: parse.c:1144
DL_DIE
#define DL_DIE(t)
cl_railcore_width
static cvar_t * cl_railcore_width
Definition: tent.c:901
IN_CenterView
static void IN_CenterView(void)
Definition: input.c:443
tent_params_t::pos2
vec3_t pos2
Definition: client.h:662
scr_chathud_time
static cvar_t * scr_chathud_time
Definition: screen.c:81
Con_RegisterMedia
void Con_RegisterMedia(void)
Definition: console.c:628
cl_anglespeedkey
static cvar_t * cl_anglespeedkey
Definition: input.c:43
in_state_t::modified
qboolean modified
Definition: input.c:65
R_RegisterFunctionsGL
void R_RegisterFunctionsGL()
Definition: main.c:1147
VectorNormalize
vec_t VectorNormalize(vec3_t v)
Definition: shared.c:55
in_changed_soft
static void in_changed_soft(cvar_t *self)
Definition: input.c:200
server_frame_t::firstEntity
int firstEntity
Definition: client.h:141
mode_changed
static int mode_changed
Definition: refresh.c:42
CL_AllocParticle
cparticle_t * CL_AllocParticle(void)
Definition: effects.c:856
free_particles
static cparticle_t * free_particles
Definition: effects.c:828
CL_ParseSteam
static void CL_ParseSteam(void)
Definition: tent.c:836
demosnap_t::data
byte data[1]
Definition: demo.c:762
IN_SpeedUp
static void IN_SpeedUp(void)
Definition: input.c:406
client_state_s::numSolidEntities
int numSolidEntities
Definition: client.h:200
r_config
refcfg_t r_config
Definition: refresh.c:401
vid_displaylist
cvar_t * vid_displaylist
Definition: refresh.c:36
SZ_Clear
void SZ_Clear(sizebuf_t *buf)
Definition: sizebuf.c:40
m_pitch
cvar_t * m_pitch
Definition: input.c:50
vid_fullscreen_changed
static void vid_fullscreen_changed(cvar_t *self)
Definition: refresh.c:274
CL_FRAMESYNC
#define CL_FRAMESYNC
Definition: client.h:164
ref_msec
static int ref_msec
Definition: main.c:3116
CL_ParseLayout
static void CL_ParseLayout(void)
Definition: parse.c:1018
cl_mod_heatbeam
qhandle_t cl_mod_heatbeam
Definition: tent.c:54
CL_UpdateRecordingSetting
void CL_UpdateRecordingSetting(void)
Definition: main.c:265
explosion_t::light
float light
Definition: client.h:76
clientinfo_s::skin
qhandle_t skin
Definition: client.h:114
client_state_s::pmp
pmoveParams_t pmp
Definition: client.h:280
CL_InitLocal
static void CL_InitLocal(void)
Definition: main.c:2708
CON_POPUP
@ CON_POPUP
Definition: console.c:37
MSG_ReadShort
int MSG_ReadShort(void)
Definition: msg.c:1489
client_state_s::predicted_angles
vec3_t predicted_angles
Definition: client.h:194
COM_strclr
size_t COM_strclr(char *s)
Definition: shared.c:398
client_static_s::paused
qboolean paused
Definition: client.h:468
LAG_CRIT_BIT
#define LAG_CRIT_BIT
Definition: screen.c:520
chatline_t::time
unsigned time
Definition: screen.c:891
CL_AddExplosions
static void CL_AddExplosions(void)
Definition: tent.c:305
console_s::times
unsigned times[CON_TIMES]
Definition: console.c:57
cvar_pt_particle_emissive
cvar_t * cvar_pt_particle_emissive
Definition: effects.c:835