This repository has been archived on 2022-06-27. You can view files and clone it, but cannot push or open issues or pull requests.
Xash3DArchive/engine/client/client.h

1090 lines
34 KiB
C
Raw Permalink Normal View History

2011-05-09 22:00:00 +02:00
/*
client.h - primary header for client
Copyright (C) 2009 Uncle Mike
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
*/
2007-11-04 22:00:00 +01:00
#ifndef CLIENT_H
#define CLIENT_H
2007-06-21 22:00:00 +02:00
2008-01-12 22:00:00 +01:00
#include "mathlib.h"
2010-08-20 22:00:00 +02:00
#include "cdll_int.h"
2010-11-15 22:00:00 +01:00
#include "menu_int.h"
2010-08-07 22:00:00 +02:00
#include "cl_entity.h"
2011-04-06 22:00:00 +02:00
#include "mod_local.h"
2010-08-12 22:00:00 +02:00
#include "pm_defs.h"
2010-10-07 22:00:00 +02:00
#include "pm_movevars.h"
2017-02-15 22:00:00 +01:00
#include "ref_params.h"
2011-12-04 21:00:00 +01:00
#include "render_api.h"
2013-10-30 21:00:00 +01:00
#include "cdll_exp.h"
2010-10-31 22:00:00 +01:00
#include "screenfade.h"
2010-10-09 22:00:00 +02:00
#include "protocol.h"
2010-10-07 22:00:00 +02:00
#include "netchan.h"
2011-09-28 22:00:00 +02:00
#include "net_api.h"
2010-07-19 22:00:00 +02:00
#include "world.h"
2007-11-05 22:00:00 +01:00
2009-10-13 22:00:00 +02:00
#define MAX_DEMOS 32
2010-09-30 22:00:00 +02:00
#define MAX_MOVIES 8
2010-11-19 22:00:00 +01:00
#define MAX_CDTRACKS 32
2018-03-07 22:00:00 +01:00
#define MAX_CLIENT_SPRITES 256 // SpriteTextures
2018-02-12 22:00:00 +01:00
#define MAX_EFRAGS 8192 // Arcane Dimensions required
2016-11-19 22:00:00 +01:00
#define MAX_REQUESTS 64
2007-06-21 22:00:00 +02:00
2010-12-09 22:00:00 +01:00
// screenshot types
#define VID_SCREENSHOT 0
#define VID_LEVELSHOT 1
#define VID_MINISHOT 2
2011-08-21 22:00:00 +02:00
#define VID_MAPSHOT 3 // special case for overview layer
2011-09-03 22:00:00 +02:00
#define VID_SNAPSHOT 4 // save screenshot into root dir and no gamma correction
2010-12-09 22:00:00 +01:00
2017-03-02 22:00:00 +01:00
// client sprite types
#define SPR_CLIENT 0 // client sprite for temp-entities or user-textures
#define SPR_HUDSPRITE 1 // hud sprite
2018-02-12 22:00:00 +01:00
#define SPR_MAPSPRITE 2 // contain overview.bmp that diced into frames 128x128
2017-03-02 22:00:00 +01:00
2011-02-28 22:00:00 +01:00
typedef int sound_t;
2018-06-13 23:00:00 +02:00
typedef enum
{
DEMO_INACTIVE = 0,
DEMO_XASH3D,
DEMO_QUAKE1
} demo_mode;
2007-06-21 22:00:00 +02:00
//=============================================================================
2016-11-14 22:00:00 +01:00
typedef struct netbandwithgraph_s
{
word client;
word players;
2017-01-14 22:00:00 +01:00
word entities; // entities bytes, except for players
word tentities; // temp entities
2016-11-14 22:00:00 +01:00
word sound;
word event;
word usr;
word msgbytes;
word voicebytes;
} netbandwidthgraph_t;
2008-07-16 22:00:00 +02:00
typedef struct frame_s
2007-06-21 22:00:00 +02:00
{
2010-10-14 22:00:00 +02:00
// received from server
double receivedtime; // time message was received, or -1
double latency;
double time; // server timestamp
2017-01-14 22:00:00 +01:00
qboolean valid; // cleared if delta parsing was invalid
2017-03-02 22:00:00 +01:00
qboolean choked;
2010-10-14 22:00:00 +02:00
2017-02-21 22:00:00 +01:00
clientdata_t clientdata; // local client private data
2010-11-15 22:00:00 +01:00
entity_state_t playerstate[MAX_CLIENTS];
2016-11-21 22:00:00 +01:00
weapon_data_t weapondata[MAX_LOCAL_WEAPONS];
2016-11-14 22:00:00 +01:00
netbandwidthgraph_t graphdata;
2017-02-21 22:00:00 +01:00
byte flags[MAX_VISIBLE_PACKET_VIS_BYTES];
2010-10-15 22:00:00 +02:00
int num_entities;
int first_entity; // into the circular cl_packet_entities[]
2007-06-21 22:00:00 +02:00
} frame_t;
2016-03-17 22:00:00 +01:00
typedef struct runcmd_s
{
double senttime;
double receivedtime;
float frame_lerp;
usercmd_t cmd;
qboolean processedfuncs;
qboolean heldback;
int sendsize;
} runcmd_t;
2017-08-24 23:00:00 +02:00
// add angles
typedef struct
{
float starttime;
float total;
} pred_viewangle_t;
2016-11-14 22:00:00 +01:00
#define ANGLE_BACKUP 16
#define ANGLE_MASK (ANGLE_BACKUP - 1)
2010-04-02 22:00:00 +02:00
#define CL_UPDATE_MASK (CL_UPDATE_BACKUP - 1)
extern int CL_UPDATE_BACKUP;
2017-02-13 22:00:00 +01:00
#define SIGNONS 2 // signon messages to receive before connected
2013-10-30 21:00:00 +01:00
#define INVALID_HANDLE 0xFFFF // for XashXT cache system
2017-02-15 22:00:00 +01:00
#define MIN_UPDATERATE 10.0f
#define MAX_UPDATERATE 102.0f
#define MIN_EX_INTERP 50.0f
#define MAX_EX_INTERP 100.0f
2018-02-20 22:00:00 +01:00
#define CL_MIN_RESEND_TIME 1.5f // mininum time gap (in seconds) before a subsequent connection request is sent.
#define CL_MAX_RESEND_TIME 20.0f // max time. The cvar cl_resend is bounded by these.
2016-11-14 22:00:00 +01:00
#define cl_serverframetime() (cl.mtime[0] - cl.mtime[1])
2017-01-21 22:00:00 +01:00
#define cl_clientframetime() (cl.time - cl.oldtime)
2016-11-14 22:00:00 +01:00
2016-08-13 23:00:00 +02:00
typedef struct
{
2017-02-15 22:00:00 +01:00
// got from prediction system
vec3_t predicted_origins[CMD_BACKUP];
vec3_t prediction_error;
2016-08-13 23:00:00 +02:00
vec3_t lastorigin;
2017-02-15 22:00:00 +01:00
int lastground;
// interp info
float interp_amount;
// misc local info
2017-03-13 22:00:00 +01:00
qboolean repredicting; // repredicting in progress
2017-02-15 22:00:00 +01:00
qboolean thirdperson;
2018-02-06 22:00:00 +01:00
qboolean apply_effects; // local player will not added but we should apply their effects: flashlight etc
2017-02-15 22:00:00 +01:00
float idealpitch;
2016-08-13 23:00:00 +02:00
int viewmodel;
2017-02-12 22:00:00 +01:00
int health; // client health
2016-08-13 23:00:00 +02:00
int onground;
2017-02-15 22:00:00 +01:00
int light_level;
2016-08-13 23:00:00 +02:00
int waterlevel;
int usehull;
int moving;
2017-02-15 22:00:00 +01:00
int pushmsec;
int weapons;
float maxspeed;
float scr_fov;
// weapon predict stuff
int weaponsequence;
float weaponstarttime;
} cl_local_data_t;
2016-08-13 23:00:00 +02:00
2017-03-11 22:00:00 +01:00
typedef struct
{
char name[MAX_OSPATH];
char modelname[MAX_OSPATH];
model_t *model;
} player_model_t;
2018-02-20 22:00:00 +01:00
typedef struct
{
qboolean bUsed;
float fTime;
int nBytesRemaining;
} downloadtime_t;
typedef struct
{
qboolean doneregistering;
int percent;
qboolean downloadrequested;
downloadtime_t rgStats[8];
int nCurStat;
int nTotalSize;
int nTotalToTransfer;
int nRemainingToTransfer;
float fLastStatusUpdate;
qboolean custom;
} incomingtransfer_t;
2018-02-12 22:00:00 +01:00
// the client_t structure is wiped completely
// at every server map change
2007-06-21 22:00:00 +02:00
typedef struct
{
2010-10-14 22:00:00 +02:00
int servercount; // server identification for prespawns
int validsequence; // this is the sequence number of the last good
// world snapshot/update we got. If this is 0, we can't
// render a frame yet
int parsecount; // server message counter
int parsecountmod; // modulo with network window
2010-10-26 22:00:00 +02:00
qboolean video_prepped; // false if on new level or new ref dll
qboolean audio_prepped; // false if on new level or new snd dll
2017-02-15 22:00:00 +01:00
qboolean paused;
2007-06-21 22:00:00 +02:00
2010-10-14 22:00:00 +02:00
int delta_sequence; // acknowledged sequence number
double mtime[2]; // the timestamp of the last two messages
2017-08-24 23:00:00 +02:00
float lerpFrac;
2010-10-14 22:00:00 +02:00
2015-07-08 23:00:00 +02:00
int last_command_ack;
2010-10-14 22:00:00 +02:00
int last_incoming_sequence;
2016-11-14 22:00:00 +01:00
qboolean send_reply;
2011-02-22 22:00:00 +01:00
qboolean background; // not real game, just a background
2016-11-14 22:00:00 +01:00
qboolean first_frame; // first rendering frame
2017-02-13 22:00:00 +01:00
qboolean proxy_redirect; // spectator stuff
2018-10-05 23:00:00 +02:00
qboolean skip_interp; // skip interpolation this frame
2009-09-16 22:00:00 +02:00
2010-10-31 22:00:00 +01:00
uint checksum; // for catching cheater maps
2017-02-15 22:00:00 +01:00
frame_t frames[MULTIPLAYER_BACKUP]; // alloced on svc_serverdata
runcmd_t commands[MULTIPLAYER_BACKUP]; // each mesage will send several old cmds
local_state_t predicted_frames[MULTIPLAYER_BACKUP]; // local client state
2011-03-31 22:00:00 +02:00
2010-10-09 22:00:00 +02:00
double time; // this is the time value that the client
2010-07-23 22:00:00 +02:00
// is rendering at. always <= cls.realtime
2010-06-20 22:00:00 +02:00
// a lerp point for other data
2010-10-09 22:00:00 +02:00
double oldtime; // previous cl.time, time-oldtime is used
// to decay light values and smooth step ups
2017-01-21 22:00:00 +01:00
float timedelta; // floating delta between two updates
2007-06-21 22:00:00 +02:00
2017-02-12 22:00:00 +01:00
char serverinfo[MAX_SERVERINFO_STRING];
2017-03-11 22:00:00 +01:00
player_model_t player_models[MAX_CLIENTS]; // cache of player models
2017-02-15 22:00:00 +01:00
player_info_t players[MAX_CLIENTS]; // collected info about all other players include himself
2018-03-14 22:00:00 +01:00
double lastresourcecheck;
2018-02-20 22:00:00 +01:00
string downloadUrl;
2009-12-02 22:00:00 +01:00
event_state_t events;
2017-02-15 22:00:00 +01:00
// predicting stuff but not only...
cl_local_data_t local;
// player final info
usercmd_t *cmd; // cl.commands[outgoing_sequence].cmd
int viewentity;
vec3_t viewangles;
vec3_t viewheight;
vec3_t punchangle;
int intermission; // don't change view angle, full screen, et
vec3_t crosshairangle;
2017-08-24 23:00:00 +02:00
pred_viewangle_t predicted_angle[ANGLE_BACKUP];// accumulate angles from server
int angle_position;
float addangletotal;
float prevaddangletotal;
2017-02-15 22:00:00 +01:00
// predicted origin and velocity
vec3_t simorg;
vec3_t simvel;
2009-09-20 22:00:00 +02:00
2007-06-21 22:00:00 +02:00
// server state information
2007-11-06 22:00:00 +01:00
int playernum;
2010-08-20 22:00:00 +02:00
int maxclients;
2009-09-28 22:00:00 +02:00
2018-02-15 22:00:00 +01:00
entity_state_t instanced_baseline[MAX_CUSTOM_BASELINES];
int instanced_baseline_count;
2018-02-05 22:00:00 +01:00
char sound_precache[MAX_SOUNDS][MAX_QPATH];
char event_precache[MAX_EVENTS][MAX_QPATH];
2018-03-09 22:00:00 +01:00
char files_precache[MAX_CUSTOM][MAX_QPATH];
2010-10-28 22:00:00 +02:00
lightstyle_t lightstyles[MAX_LIGHTSTYLES];
2018-03-07 22:00:00 +01:00
model_t *models[MAX_MODELS+1]; // precached models (plus sentinel slot)
2018-02-25 22:00:00 +01:00
int nummodels;
2018-03-09 22:00:00 +01:00
int numfiles;
2010-10-26 22:00:00 +02:00
2018-02-20 22:00:00 +01:00
consistency_t consistency_list[MAX_MODELS];
int num_consistency;
qboolean need_force_consistency_response;
resource_t resourcesonhand;
resource_t resourcesneeded;
resource_t resourcelist[MAX_RESOURCES];
int num_resources;
2018-02-12 22:00:00 +01:00
short sound_index[MAX_SOUNDS];
short decal_index[MAX_DECALS];
2010-08-30 22:00:00 +02:00
2010-10-26 22:00:00 +02:00
model_t *worldmodel; // pointer to world
2007-11-04 22:00:00 +01:00
} client_t;
2007-06-21 22:00:00 +02:00
/*
==================================================================
the client_static_t structure is persistant through an arbitrary number
of server connections
==================================================================
*/
2007-11-17 22:00:00 +01:00
typedef enum
{
2017-02-13 22:00:00 +01:00
ca_disconnected = 0,// not talking to a server
2009-09-16 22:00:00 +02:00
ca_connecting, // sending request packets to the server
ca_connected, // netchan_t established, waiting for svc_serverdata
2017-02-13 22:00:00 +01:00
ca_validate, // download resources, validating, auth on server
2009-09-16 22:00:00 +02:00
ca_active, // game views should be displayed
2017-02-13 22:00:00 +01:00
ca_cinematic, // playing a cinematic, not connected to a server
2007-06-21 22:00:00 +02:00
} connstate_t;
2009-09-23 22:00:00 +02:00
typedef enum
{
scrshot_inactive,
2011-03-31 22:00:00 +02:00
scrshot_normal, // in-game screenshot
2011-09-03 22:00:00 +02:00
scrshot_snapshot, // in-game snapshot
2009-09-23 22:00:00 +02:00
scrshot_plaque, // levelshot
scrshot_savegame, // saveshot
2010-03-26 22:00:00 +01:00
scrshot_envshot, // cubemap view
2011-08-21 22:00:00 +02:00
scrshot_skyshot, // skybox view
scrshot_mapshot // overview layer
2010-07-20 22:00:00 +02:00
} scrshot_t;
2009-09-23 22:00:00 +02:00
2010-08-15 22:00:00 +02:00
// client screen state
typedef enum
{
CL_LOADING = 1, // draw loading progress-bar
CL_ACTIVE, // draw normal hud
CL_PAUSED, // pause when active
CL_CHANGELEVEL, // draw 'loading' during changelevel
} scrstate_t;
2010-06-22 22:00:00 +02:00
typedef struct
{
char name[32];
2009-09-16 22:00:00 +02:00
int number; // svc_ number
int size; // if size == -1, size come from first byte after svcnum
pfnUserMsgHook func; // user-defined function
2010-06-22 22:00:00 +02:00
} cl_user_message_t;
2008-12-25 22:00:00 +01:00
2010-10-26 22:00:00 +02:00
typedef void (*pfnEventHook)( event_args_t *args );
2009-12-02 22:00:00 +01:00
typedef struct
{
2018-02-05 22:00:00 +01:00
char name[MAX_QPATH];
2009-12-02 22:00:00 +01:00
word index; // event index
pfnEventHook func; // user-defined function
2011-10-09 22:00:00 +02:00
} cl_user_event_t;
2009-12-02 22:00:00 +01:00
2017-07-16 23:00:00 +02:00
#define FONT_FIXED 0
#define FONT_VARIABLE 1
2010-07-17 22:00:00 +02:00
typedef struct
{
2010-12-02 22:00:00 +01:00
int hFontTexture; // handle to texture
2010-07-17 22:00:00 +02:00
wrect_t fontRc[256]; // rectangles
2011-09-28 22:00:00 +02:00
byte charWidths[256];
int charHeight;
2017-07-16 23:00:00 +02:00
int type;
2011-09-28 22:00:00 +02:00
qboolean valid; // all rectangles are valid
2010-07-17 22:00:00 +02:00
} cl_font_t;
2009-12-03 22:00:00 +01:00
typedef struct
{
// temp handle
2010-12-02 22:00:00 +01:00
const model_t *pSprite; // pointer to current SpriteTexture
2009-12-03 22:00:00 +01:00
// scissor test
int scissor_x;
int scissor_y;
int scissor_width;
int scissor_height;
2010-10-26 22:00:00 +02:00
qboolean scissor_test;
2011-09-28 22:00:00 +02:00
qboolean adjust_size; // allow to adjust scale for fonts
2009-12-03 22:00:00 +01:00
2017-02-21 22:00:00 +01:00
int renderMode; // override kRenderMode from TriAPI
2011-04-25 22:00:00 +02:00
int cullMode; // override CULL FACE from TriAPI
2010-07-20 22:00:00 +02:00
// holds text color
rgba_t textColor;
2010-12-14 22:00:00 +01:00
rgba_t spriteColor;
2017-02-21 22:00:00 +01:00
vec4_t triRGBA;
2010-07-20 22:00:00 +02:00
2009-12-03 22:00:00 +01:00
// crosshair members
2010-12-02 22:00:00 +01:00
const model_t *pCrosshair;
2009-12-03 22:00:00 +01:00
wrect_t rcCrosshair;
rgba_t rgbaCrosshair;
2010-12-02 22:00:00 +01:00
} client_draw_t;
2015-12-04 22:00:00 +01:00
typedef struct cl_predicted_player_s
{
2016-03-17 22:00:00 +01:00
int movetype;
int solid;
int usehull;
qboolean active;
2017-02-15 22:00:00 +01:00
vec3_t origin; // interpolated origin
2016-03-17 22:00:00 +01:00
vec3_t angles;
2015-12-04 22:00:00 +01:00
} predicted_player_t;
2010-12-02 22:00:00 +01:00
typedef struct
{
2011-10-09 22:00:00 +02:00
int gl_texturenum; // this is a real texnum
2010-12-02 22:00:00 +01:00
// scissor test
int scissor_x;
int scissor_y;
int scissor_width;
int scissor_height;
qboolean scissor_test;
// holds text color
rgba_t textColor;
} gameui_draw_t;
2009-12-03 22:00:00 +01:00
2018-04-03 23:00:00 +02:00
typedef struct
{
char szListName[MAX_QPATH];
client_sprite_t *pList;
int count;
} cached_spritelist_t;
2010-07-19 22:00:00 +02:00
typedef struct
{
// centerprint stuff
2011-09-03 22:00:00 +02:00
float time;
int y, lines;
2010-07-19 22:00:00 +02:00
char message[2048];
int totalWidth;
int totalHeight;
} center_print_t;
2010-10-31 22:00:00 +01:00
typedef struct
{
float time;
float duration;
float amplitude;
float frequency;
float next_shake;
vec3_t offset;
float angle;
vec3_t applied_offset;
float applied_angle;
} screen_shake_t;
2011-07-22 22:00:00 +02:00
typedef struct
{
2018-03-07 22:00:00 +01:00
unsigned short textures[MAX_SKINS];// alias textures
2011-07-22 22:00:00 +02:00
struct mstudiotex_s *ptexture; // array of textures with local copy of remapped textures
short numtextures; // textures count
short topcolor; // cached value
short bottomcolor; // cached value
model_t *model; // for catch model changes
} remap_info_t;
2016-11-15 22:00:00 +01:00
typedef enum
{
NET_REQUEST_CANCEL = 0, // request was cancelled for some reasons
NET_REQUEST_GAMEUI, // called from GameUI
NET_REQUEST_CLIENT, // called from Client
} net_request_type_t;
2011-09-28 22:00:00 +02:00
typedef struct
{
net_response_t resp;
net_api_response_func_t pfnFunc;
double timeout;
double timesend; // time when request was sended
int flags; // FNETAPI_MULTIPLE_RESPONSE etc
} net_request_t;
2018-02-02 22:00:00 +01:00
// new versions of client dlls have a single export with all callbacks
2013-10-23 22:00:00 +02:00
typedef void (*CL_EXPORT_FUNCS)( void *pv );
2008-12-25 22:00:00 +01:00
typedef struct
{
2009-06-24 22:00:00 +02:00
void *hInstance; // pointer to client.dll
2013-10-30 21:00:00 +01:00
cldll_func_t dllFuncs; // dll exported funcs
2011-12-04 21:00:00 +01:00
render_interface_t drawFuncs; // custom renderer support
2009-11-27 22:00:00 +01:00
byte *mempool; // client edicts pool
2010-08-20 22:00:00 +02:00
string mapname; // map name
2009-10-11 22:00:00 +02:00
string maptitle; // display map title
2010-07-08 22:00:00 +02:00
string itemspath; // path to items description for auto-complete func
2009-06-24 22:00:00 +02:00
2010-08-07 22:00:00 +02:00
cl_entity_t *entities; // dynamically allocated entity array
2011-10-06 22:00:00 +02:00
cl_entity_t *static_entities; // dynamically allocated static entity array
2011-07-22 22:00:00 +02:00
remap_info_t **remap_info; // store local copy of all remap textures for each entity
2009-06-24 22:00:00 +02:00
2010-08-20 22:00:00 +02:00
int maxEntities;
2011-07-22 22:00:00 +02:00
int maxRemapInfos; // maxEntities + cl.viewEnt; also used for catch entcount
2011-10-06 22:00:00 +02:00
int numStatics; // actual static entity count
2018-02-02 22:00:00 +01:00
int maxModels;
2010-08-20 22:00:00 +02:00
2009-11-26 22:00:00 +01:00
// movement values from server
movevars_t movevars;
movevars_t oldmovevars;
playermove_t *pmove; // pmove state
2016-12-09 22:00:00 +01:00
qboolean pushed; // used by PM_Push\Pop state
int oldviscount; // used by PM_Push\Pop state
int oldphyscount; // used by PM_Push\Pop state
2010-08-19 22:00:00 +02:00
2010-06-22 22:00:00 +02:00
cl_user_message_t msg[MAX_USER_MESSAGES]; // keep static to avoid fragment memory
2011-10-09 22:00:00 +02:00
cl_user_event_t *events[MAX_EVENTS];
2009-09-28 22:00:00 +02:00
2010-11-19 22:00:00 +01:00
string cdtracks[MAX_CDTRACKS]; // 32 cd-tracks read from cdaudio.txt
2018-03-07 22:00:00 +01:00
model_t sprites[MAX_CLIENT_SPRITES]; // client spritetextures
2017-02-15 22:00:00 +01:00
int viewport[4]; // viewport sizes
2010-12-02 22:00:00 +01:00
client_draw_t ds; // draw2d stuff (hud, weaponmenu etc)
2010-10-31 22:00:00 +01:00
screenfade_t fade; // screen fade
screen_shake_t shake; // screen shake
2010-07-19 22:00:00 +02:00
center_print_t centerPrint; // centerprint variables
2009-12-03 22:00:00 +01:00
SCREENINFO scrInfo; // actual screen info
2011-08-21 22:00:00 +02:00
ref_overview_t overView; // overView params
2017-02-21 22:00:00 +01:00
color24 palette[256]; // palette used for particle colors
2010-07-13 22:00:00 +02:00
2018-04-03 23:00:00 +02:00
cached_spritelist_t sprlist[MAX_CLIENT_SPRITES]; // client list sprites
2010-03-28 22:00:00 +02:00
client_textmessage_t *titles; // title messages, not network messages
2009-10-23 22:00:00 +02:00
int numTitles;
2016-11-15 22:00:00 +01:00
net_request_type_t request_type; // filter the requests
2011-09-28 22:00:00 +02:00
net_request_t net_requests[MAX_REQUESTS]; // no reason to keep more
2016-11-15 22:00:00 +01:00
net_request_t *master_request; // queued master request
2011-09-28 22:00:00 +02:00
2012-05-28 22:00:00 +02:00
efrag_t *free_efrags; // linked efrags
2010-08-07 22:00:00 +02:00
cl_entity_t viewent; // viewmodel
2008-12-25 22:00:00 +01:00
} clgame_static_t;
2007-06-21 22:00:00 +02:00
2010-07-18 22:00:00 +02:00
typedef struct
{
void *hInstance; // pointer to client.dll
UI_FUNCTIONS dllFuncs; // dll exported funcs
byte *mempool; // client edicts pool
2010-08-07 22:00:00 +02:00
cl_entity_t playermodel; // uiPlayerSetup drawing model
2011-01-03 22:00:00 +01:00
player_info_t playerinfo; // local playerinfo
2010-08-07 22:00:00 +02:00
2010-12-02 22:00:00 +01:00
gameui_draw_t ds; // draw2d stuff (menu images)
2010-07-18 22:00:00 +02:00
GAMEINFO gameInfo; // current gameInfo
2010-11-15 22:00:00 +01:00
GAMEINFO *modsInfo[MAX_MODS]; // simplified gameInfo for MainUI
2010-07-18 22:00:00 +02:00
ui_globalvars_t *globals;
2010-10-09 22:00:00 +02:00
2010-10-26 22:00:00 +02:00
qboolean drawLogo; // set to TRUE if logo.avi missed or corrupted
2010-09-30 22:00:00 +02:00
long logo_xres;
long logo_yres;
2011-02-05 22:00:00 +01:00
float logo_length;
2016-11-17 22:00:00 +01:00
} gameui_static_t;
2010-07-18 22:00:00 +02:00
2007-06-21 22:00:00 +02:00
typedef struct
{
connstate_t state;
2010-10-26 22:00:00 +02:00
qboolean initialized;
qboolean changelevel; // during changelevel
2012-08-29 22:00:00 +02:00
qboolean changedemo; // during changedemo
2018-02-20 22:00:00 +01:00
double timestart; // just for profiling
2008-08-04 22:00:00 +02:00
2010-12-09 22:00:00 +01:00
// screen rendering information
float disable_screen; // showing loading plaque between levels
// or changing rendering dlls
// if time gets > 30 seconds ahead, break it
int disable_servercount; // when we receive a frame and cl.servercount
// > cls.disable_servercount, clear disable_screen
qboolean draw_changelevel; // draw changelevel image 'Loading...'
2008-07-09 22:00:00 +02:00
keydest_t key_dest;
2008-12-25 22:00:00 +01:00
2009-06-24 22:00:00 +02:00
byte *mempool; // client premamnent pool: edicts etc
2017-02-12 22:00:00 +01:00
netadr_t hltv_listen_address;
2017-02-13 22:00:00 +01:00
int signon; // 0 to SIGNONS, for the signon sequence.
2009-06-24 22:00:00 +02:00
int quakePort; // a 16 bit value that allows quake servers
// to work around address translating routers
2011-04-08 22:00:00 +02:00
// g-cont. this port allow many copies of engine in multiplayer game
2007-11-14 22:00:00 +01:00
// connection information
2017-02-13 22:00:00 +01:00
char servername[MAX_QPATH]; // name of server from original connect
2011-04-08 22:00:00 +02:00
double connect_time; // for connection retransmits
2018-03-11 22:00:00 +01:00
int max_fragment_size; // we needs to test a real network bandwidth
int connect_retry; // how many times we send a connect packet to the server
2017-02-12 22:00:00 +01:00
qboolean spectator; // not a real player, just spectator
local_state_t spectator_state; // init as client startup
2011-04-08 22:00:00 +02:00
2017-02-12 22:00:00 +01:00
char userinfo[MAX_INFO_STRING];
char physinfo[MAX_INFO_STRING]; // read-only
2011-04-08 22:00:00 +02:00
sizebuf_t datagram; // unreliable stuff. gets sent in CL_Move about cl_cmdrate times per second.
2018-03-07 22:00:00 +01:00
byte datagram_buf[MAX_DATAGRAM];
2008-07-11 22:00:00 +02:00
netchan_t netchan;
2008-06-30 22:00:00 +02:00
int challenge; // from the server to use for connecting
2010-07-08 22:00:00 +02:00
2010-10-14 22:00:00 +02:00
float packet_loss;
double packet_loss_recalc_time;
2018-06-13 23:00:00 +02:00
int starting_count; // message num readed bits
2010-10-14 22:00:00 +02:00
float nextcmdtime; // when can we send the next command packet?
int lastoutgoingcommand; // sequence number of last outgoing command
2017-02-15 22:00:00 +01:00
int lastupdate_sequence; // prediction stuff
2010-10-14 22:00:00 +02:00
2018-02-12 22:00:00 +01:00
int td_lastframe; // to meter out one message a frame
int td_startframe; // host_framecount at start
double td_starttime; // realtime at second frame of timedemo
2018-06-13 23:00:00 +02:00
int forcetrack; // -1 = use normal cd track
2018-02-12 22:00:00 +01:00
2017-03-06 22:00:00 +01:00
// game images
2010-12-02 22:00:00 +01:00
int pauseIcon; // draw 'paused' when game in-pause
2011-09-19 22:00:00 +02:00
int tileImage; // for draw any areas not covered by the refresh
2017-03-06 22:00:00 +01:00
int loadingBar; // 'loading' progress bar
2010-07-20 22:00:00 +02:00
cl_font_t creditsFont; // shared creditsfont
2010-10-15 22:00:00 +02:00
2016-03-17 22:00:00 +01:00
float latency; // rolling average of frame latencey (receivedtime - senttime) values.
2010-10-15 22:00:00 +02:00
int num_client_entities; // cl.maxclients * CL_UPDATE_BACKUP * MAX_PACKET_ENTITIES
int next_client_entities; // next client_entity to use
entity_state_t *packet_entities; // [num_client_entities]
2007-06-21 22:00:00 +02:00
2015-12-04 22:00:00 +01:00
predicted_player_t predicted_players[MAX_CLIENTS];
2017-02-15 22:00:00 +01:00
double correction_time;
2015-12-04 22:00:00 +01:00
2010-07-20 22:00:00 +02:00
scrshot_t scrshot_request; // request for screen shot
scrshot_t scrshot_action; // in-action
2010-03-26 22:00:00 +01:00
const float *envshot_vieworg; // envshot position
2014-05-08 22:00:00 +02:00
int envshot_viewsize; // override cvar
qboolean envshot_disable_vis; // disable VIS on server while makes an envshots
2009-09-23 22:00:00 +02:00
string shotname;
2011-07-07 22:00:00 +02:00
// download info
2018-02-20 22:00:00 +01:00
incomingtransfer_t dl;
2011-07-07 22:00:00 +02:00
2009-10-13 22:00:00 +02:00
// demo loop control
int demonum; // -1 = don't play demos
2014-05-11 22:00:00 +02:00
int olddemonum; // restore playing
2018-06-13 23:00:00 +02:00
char demos[MAX_DEMOS][MAX_QPATH]; // when not playing
qboolean demos_pending;
2009-10-13 22:00:00 +02:00
2010-09-30 22:00:00 +02:00
// movie playlist
int movienum;
string movies[MAX_MOVIES];
2008-08-02 22:00:00 +02:00
// demo recording info must be here, so it isn't clearing on level change
2010-10-26 22:00:00 +02:00
qboolean demorecording;
qboolean demoplayback;
qboolean demowaiting; // don't record until a non-delta message is received
2010-11-03 22:00:00 +01:00
qboolean timedemo;
2008-08-02 22:00:00 +02:00
string demoname; // for demo looping
2014-05-09 22:00:00 +02:00
double demotime; // recording time
2018-11-01 22:00:00 +01:00
qboolean set_lastdemo; // store name of last played demo into the cvar
2008-05-20 22:00:00 +02:00
2007-06-21 22:00:00 +02:00
file_t *demofile;
2012-03-01 21:00:00 +01:00
file_t *demoheader; // contain demo startup info in case we record a demo on this level
2007-06-21 22:00:00 +02:00
} client_static_t;
2010-11-16 22:00:00 +01:00
#ifdef __cplusplus
extern "C" {
#endif
2010-07-20 22:00:00 +02:00
extern client_t cl;
2007-06-21 22:00:00 +02:00
extern client_static_t cls;
2008-12-26 22:00:00 +01:00
extern clgame_static_t clgame;
2016-11-17 22:00:00 +01:00
extern gameui_static_t gameui;
2009-12-20 22:00:00 +01:00
2010-11-16 22:00:00 +01:00
#ifdef __cplusplus
}
#endif
2007-06-21 22:00:00 +02:00
//
// cvars
//
2017-02-21 22:00:00 +01:00
extern convar_t mp_decals;
2018-02-20 22:00:00 +01:00
extern convar_t cl_logofile;
extern convar_t cl_logocolor;
extern convar_t cl_allow_download;
extern convar_t cl_allow_upload;
extern convar_t cl_download_ingame;
2017-02-12 22:00:00 +01:00
extern convar_t *cl_nopred;
2010-10-22 22:00:00 +02:00
extern convar_t *cl_showfps;
extern convar_t *cl_envshot_size;
2011-04-09 22:00:00 +02:00
extern convar_t *cl_timeout;
2010-10-22 22:00:00 +02:00
extern convar_t *cl_nodelta;
2012-03-24 21:00:00 +01:00
extern convar_t *cl_interp;
2016-03-17 22:00:00 +01:00
extern convar_t *cl_showerror;
2016-08-13 23:00:00 +02:00
extern convar_t *cl_nosmooth;
extern convar_t *cl_smoothtime;
2010-10-22 22:00:00 +02:00
extern convar_t *cl_crosshair;
extern convar_t *cl_testlights;
2016-11-14 22:00:00 +01:00
extern convar_t *cl_cmdrate;
extern convar_t *cl_updaterate;
2010-10-22 22:00:00 +02:00
extern convar_t *cl_solid_players;
extern convar_t *cl_idealpitchscale;
extern convar_t *cl_allow_levelshots;
2010-12-11 22:00:00 +01:00
extern convar_t *cl_lightstyle_lerping;
2010-11-03 22:00:00 +01:00
extern convar_t *cl_draw_particles;
2017-02-21 22:00:00 +01:00
extern convar_t *cl_draw_tracers;
2010-10-22 22:00:00 +02:00
extern convar_t *cl_levelshot_name;
2010-11-10 22:00:00 +01:00
extern convar_t *cl_draw_beams;
2017-01-21 22:00:00 +01:00
extern convar_t *cl_clockreset;
extern convar_t *cl_fixtimerate;
2016-11-14 22:00:00 +01:00
extern convar_t *gl_showtextures;
2016-08-13 23:00:00 +02:00
extern convar_t *cl_bmodelinterp;
2017-03-06 22:00:00 +01:00
extern convar_t *cl_righthand;
2016-08-12 23:00:00 +02:00
extern convar_t *cl_lw; // local weapons
2017-02-13 22:00:00 +01:00
extern convar_t *cl_showevents;
2010-10-22 22:00:00 +02:00
extern convar_t *scr_centertime;
2011-04-10 22:00:00 +02:00
extern convar_t *scr_viewsize;
2010-10-22 22:00:00 +02:00
extern convar_t *scr_loading;
2018-03-04 22:00:00 +01:00
extern convar_t *v_dark; // start from dark
2017-02-28 22:00:00 +01:00
extern convar_t *net_graph;
2017-02-21 22:00:00 +01:00
extern convar_t *rate;
2007-06-21 22:00:00 +02:00
//=============================================================================
2008-07-11 22:00:00 +02:00
2013-09-14 22:00:00 +02:00
void CL_SetLightstyle( int style, const char* s, float f );
2010-03-15 22:00:00 +01:00
void CL_RunLightStyles( void );
2010-12-03 22:00:00 +01:00
void CL_DecayLights( void );
2007-06-21 22:00:00 +02:00
//=================================================
2008-08-04 22:00:00 +02:00
//
// cl_cmds.c
//
2010-03-28 22:00:00 +02:00
void CL_Quit_f( void );
2007-11-06 22:00:00 +01:00
void CL_ScreenShot_f( void );
2011-09-03 22:00:00 +02:00
void CL_SnapShot_f( void );
2010-11-19 22:00:00 +01:00
void CL_PlayCDTrack_f( void );
2008-11-09 22:00:00 +01:00
void CL_EnvShot_f( void );
void CL_SkyShot_f( void );
2009-09-10 22:00:00 +02:00
void CL_SaveShot_f( void );
2007-11-06 22:00:00 +01:00
void CL_LevelShot_f( void );
2007-11-13 22:00:00 +01:00
void CL_SetSky_f( void );
2008-08-04 22:00:00 +02:00
void SCR_Viewpos_f( void );
2010-07-20 22:00:00 +02:00
void SCR_TimeRefresh_f( void );
2007-06-21 22:00:00 +02:00
2018-02-20 22:00:00 +01:00
//
// cl_custom.c
//
2018-03-06 22:00:00 +01:00
qboolean CL_CheckFile( sizebuf_t *msg, resource_t *pResource );
2018-02-20 22:00:00 +01:00
void CL_AddToResourceList( resource_t *pResource, resource_t *pList );
void CL_RemoveFromResourceList( resource_t *pResource );
void CL_MoveToOnHandList( resource_t *pResource );
void CL_ClearResourceLists( void );
2018-06-13 23:00:00 +02:00
//
// cl_debug.c
//
void CL_Parse_Debug( qboolean enable );
void CL_Parse_RecordCommand( int cmd, int startoffset );
void CL_ResetFrame( frame_t *frame );
void CL_WriteMessageHistory( void );
const char *CL_MsgInfo( int cmd );
2007-06-21 22:00:00 +02:00
//
2012-03-01 21:00:00 +01:00
// cl_main.c
2007-06-21 22:00:00 +02:00
//
2008-06-29 22:00:00 +02:00
void CL_Init( void );
2009-02-03 22:00:00 +01:00
void CL_SendCommand( void );
2009-11-03 22:00:00 +01:00
void CL_Disconnect_f( void );
2011-07-07 22:00:00 +02:00
void CL_ProcessFile( qboolean successfully_received, const char *filename );
2012-03-01 21:00:00 +01:00
void CL_WriteUsercmd( sizebuf_t *msg, int from, int to );
2018-03-11 22:00:00 +01:00
int CL_GetFragmentSize( void *unused );
2018-02-20 22:00:00 +01:00
qboolean CL_PrecacheResources( void );
void CL_SetupOverviewParams( void );
2017-02-21 22:00:00 +01:00
void CL_UpdateFrameLerp( void );
2017-02-15 22:00:00 +01:00
int CL_IsDevOverviewMode( void );
2009-11-03 22:00:00 +01:00
void CL_PingServers_f( void );
2017-02-13 22:00:00 +01:00
void CL_SignonReply( void );
2009-12-05 22:00:00 +01:00
void CL_ClearState( void );
2007-06-21 22:00:00 +02:00
//
// cl_demo.c
//
2012-03-01 21:00:00 +01:00
void CL_StartupDemoHeader( void );
2008-07-12 22:00:00 +02:00
void CL_DrawDemoRecording( void );
2012-03-01 21:00:00 +01:00
void CL_WriteDemoUserCmd( int cmdnumber );
void CL_WriteDemoMessage( qboolean startup, int start, sizebuf_t *msg );
void CL_WriteDemoUserMessage( const byte *buffer, size_t size );
qboolean CL_DemoReadMessage( byte *buffer, size_t *length );
2016-11-14 22:00:00 +01:00
void CL_DemoInterpolateAngles( void );
2018-06-13 23:00:00 +02:00
void CL_CheckStartupDemos( void );
2012-03-01 21:00:00 +01:00
void CL_WriteDemoJumpTime( void );
void CL_CloseDemoHeader( void );
2018-06-13 23:00:00 +02:00
void CL_DemoCompleted( void );
2008-05-20 22:00:00 +02:00
void CL_StopPlayback( void );
void CL_StopRecord( void );
void CL_PlayDemo_f( void );
2018-02-12 22:00:00 +01:00
void CL_TimeDemo_f( void );
2009-10-13 22:00:00 +02:00
void CL_StartDemos_f( void );
void CL_Demos_f( void );
2010-01-07 22:00:00 +01:00
void CL_DeleteDemo_f( void );
2008-05-20 22:00:00 +02:00
void CL_Record_f( void );
void CL_Stop_f( void );
2007-06-21 22:00:00 +02:00
2011-10-09 22:00:00 +02:00
//
// cl_events.c
//
void CL_ParseEvent( sizebuf_t *msg );
void CL_ParseReliableEvent( sizebuf_t *msg );
void CL_SetEventIndex( const char *szEvName, int ev_index );
void CL_QueueEvent( int flags, int index, float delay, event_args_t *args );
void CL_PlaybackEvent( int flags, const edict_t *pInvoker, word eventindex, float delay, float *origin,
float *angles, float fparam1, float fparam2, int iparam1, int iparam2, int bparam1, int bparam2 );
void CL_RegisterEvent( int lastnum, const char *szEvName, pfnEventHook func );
2018-03-14 22:00:00 +01:00
void CL_BatchResourceRequest( qboolean initialize );
int CL_EstimateNeededResources( void );
2011-10-09 22:00:00 +02:00
void CL_ResetEvent( event_info_t *ei );
2018-03-09 22:00:00 +01:00
word CL_EventIndex( const char *name );
2011-10-09 22:00:00 +02:00
void CL_FireEvents( void );
2008-12-25 22:00:00 +01:00
//
// cl_game.c
//
void CL_UnloadProgs( void );
2010-10-26 22:00:00 +02:00
qboolean CL_LoadProgs( const char *name );
2010-08-06 22:00:00 +02:00
void CL_ParseUserMessage( sizebuf_t *msg, int svc_num );
2010-06-22 22:00:00 +02:00
void CL_LinkUserMessage( char *pszName, const int svc_num, int iSize );
2017-07-18 23:00:00 +02:00
void CL_ParseFinaleCutscene( sizebuf_t *msg, int level );
2010-11-15 22:00:00 +01:00
void CL_ParseTextMessage( sizebuf_t *msg );
2010-07-20 22:00:00 +02:00
void CL_DrawHUD( int state );
void CL_InitEdicts( void );
void CL_FreeEdicts( void );
2010-12-06 22:00:00 +01:00
void CL_ClearWorld( void );
2012-12-23 21:00:00 +01:00
void CL_DrawCenterPrint( void );
2018-03-07 22:00:00 +01:00
void CL_ClearSpriteTextures( void );
2010-08-07 22:00:00 +02:00
void CL_FreeEntity( cl_entity_t *pEdict );
2010-07-19 22:00:00 +02:00
void CL_CenterPrint( const char *text, float y );
2010-03-28 22:00:00 +02:00
void CL_TextMessageParse( byte *pMemFile, int fileSize );
2011-01-03 22:00:00 +01:00
client_textmessage_t *CL_TextMessageGet( const char *pName );
2010-07-01 22:00:00 +02:00
int pfnDecalIndexFromName( const char *szDecalName );
2010-12-25 22:00:00 +01:00
int pfnIndexFromTrace( struct pmtrace_s *pTrace );
2018-02-25 22:00:00 +01:00
model_t *CL_ModelHandle( int modelindex );
2016-11-15 22:00:00 +01:00
void NetAPI_CancelAllRequests( void );
2010-11-06 22:00:00 +01:00
int CL_FindModelIndex( const char *m );
2017-07-16 23:00:00 +02:00
cl_entity_t *CL_GetLocalPlayer( void );
2017-03-02 22:00:00 +01:00
model_t *CL_LoadClientSprite( const char *filename );
2018-02-25 22:00:00 +01:00
model_t *CL_LoadModel( const char *modelname, int *index );
2010-11-15 22:00:00 +01:00
HSPRITE pfnSPR_Load( const char *szPicName );
2012-01-27 21:00:00 +01:00
HSPRITE pfnSPR_LoadExt( const char *szPicName, uint texFlags );
2011-09-28 22:00:00 +02:00
void PicAdjustSize( float *x, float *y, float *w, float *h );
2016-11-14 22:00:00 +01:00
void CL_FillRGBA( int x, int y, int width, int height, int r, int g, int b, int a );
2012-02-11 21:00:00 +01:00
void CL_PlayerTrace( float *start, float *end, int traceFlags, int ignore_pe, pmtrace_t *tr );
void CL_PlayerTraceExt( float *start, float *end, int traceFlags, int (*pfnIgnore)( physent_t *pe ), pmtrace_t *tr );
void CL_SetTraceHull( int hull );
2010-03-06 22:00:00 +01:00
2011-04-06 22:00:00 +02:00
_inline cl_entity_t *CL_EDICT_NUM( int n )
2008-12-25 22:00:00 +01:00
{
2010-08-20 22:00:00 +02:00
if(( n >= 0 ) && ( n < clgame.maxEntities ))
2010-08-07 22:00:00 +02:00
return clgame.entities + n;
2011-04-06 22:00:00 +02:00
Host_Error( "CL_EDICT_NUM: bad number %i\n", n );
2008-12-25 22:00:00 +01:00
return NULL;
}
2008-07-01 22:00:00 +02:00
2007-06-21 22:00:00 +02:00
//
// cl_parse.c
//
2017-03-02 22:00:00 +01:00
void CL_ParseServerMessage( sizebuf_t *msg, qboolean normal_message );
2010-11-06 22:00:00 +01:00
void CL_ParseTempEntity( sizebuf_t *msg );
2018-03-07 22:00:00 +01:00
void CL_StartResourceDownloading( const char *pszMessage, qboolean bCustom );
2010-11-15 22:00:00 +01:00
qboolean CL_DispatchUserMessage( const char *pszName, int iSize, void *pbuf );
2018-03-04 22:00:00 +01:00
qboolean CL_RequestMissingResources( void );
2018-03-06 22:00:00 +01:00
void CL_RegisterResources ( sizebuf_t *msg );
2018-06-13 23:00:00 +02:00
void CL_ParseViewEntity( sizebuf_t *msg );
void CL_ParseServerTime( sizebuf_t *msg );
2007-06-21 22:00:00 +02:00
2008-07-04 22:00:00 +02:00
//
// cl_scrn.c
//
2010-11-22 22:00:00 +01:00
void SCR_VidInit( void );
2011-09-19 22:00:00 +02:00
void SCR_TileClear( void );
2017-02-21 22:00:00 +01:00
void SCR_DirtyScreen( void );
2011-09-19 22:00:00 +02:00
void SCR_AddDirtyPoint( int x, int y );
2012-12-23 21:00:00 +01:00
void SCR_InstallParticlePalette( void );
2010-12-09 22:00:00 +01:00
void SCR_EndLoadingPlaque( void );
2012-12-23 21:00:00 +01:00
void SCR_RegisterTextures( void );
void SCR_LoadCreditsFont( void );
2009-09-23 22:00:00 +02:00
void SCR_MakeScreenShot( void );
2009-10-18 22:00:00 +02:00
void SCR_MakeLevelShot( void );
2010-07-26 22:00:00 +02:00
void SCR_NetSpeeds( void );
2009-09-01 22:00:00 +02:00
void SCR_RSpeeds( void );
2016-11-17 22:00:00 +01:00
void SCR_DrawFPS( int height );
2008-07-04 22:00:00 +02:00
2016-11-14 22:00:00 +01:00
//
// cl_netgraph.c
//
void CL_InitNetgraph( void );
void SCR_DrawNetGraph( void );
2007-06-21 22:00:00 +02:00
//
// cl_view.c
//
void V_Init (void);
2008-07-17 22:00:00 +02:00
void V_Shutdown( void );
2010-10-26 22:00:00 +02:00
qboolean V_PreRender( void );
2007-11-06 22:00:00 +01:00
void V_PostRender( void );
2007-11-05 22:00:00 +01:00
void V_RenderView( void );
2007-06-21 22:00:00 +02:00
//
2010-08-19 22:00:00 +02:00
// cl_pmove.c
2007-06-21 22:00:00 +02:00
//
2010-08-19 22:00:00 +02:00
void CL_SetSolidEntities( void );
void CL_SetSolidPlayers( int playernum );
2009-12-05 22:00:00 +01:00
void CL_InitClientMove( void );
2017-02-15 22:00:00 +01:00
void CL_PredictMovement( qboolean repredicting );
2009-01-11 22:00:00 +01:00
void CL_CheckPredictionError( void );
2010-10-26 22:00:00 +02:00
qboolean CL_IsPredicted( void );
2010-11-15 22:00:00 +01:00
int CL_TruePointContents( const vec3_t p );
int CL_PointContents( const vec3_t p );
2011-02-15 22:00:00 +01:00
int CL_WaterEntity( const float *rgflPos );
2011-09-03 22:00:00 +02:00
cl_entity_t *CL_GetWaterEntity( const float *rgflPos );
2016-03-17 22:00:00 +01:00
void CL_SetupPMove( playermove_t *pmove, local_state_t *from, usercmd_t *ucmd, qboolean runfuncs, double time );
2017-12-31 22:00:00 +01:00
int CL_TestLine( const vec3_t start, const vec3_t end, int flags );
2017-03-26 23:00:00 +02:00
pmtrace_t *CL_VisTraceLine( vec3_t start, vec3_t end, int flags );
2012-02-11 21:00:00 +01:00
pmtrace_t CL_TraceLine( vec3_t start, vec3_t end, int flags );
2018-05-08 23:00:00 +02:00
void CL_PushTraceBounds( int hullnum, const float *mins, const float *maxs );
void CL_PopTraceBounds( void );
2017-02-21 22:00:00 +01:00
void CL_MoveSpectatorCamera( void );
2017-02-15 22:00:00 +01:00
void CL_SetLastUpdate( void );
void CL_RedoPrediction( void );
2011-04-18 22:00:00 +02:00
void CL_ClearPhysEnts( void );
2016-08-13 23:00:00 +02:00
void CL_PushPMStates( void );
void CL_PopPMStates( void );
void CL_SetUpPlayerPrediction( int dopred, int bIncludeLocalClient );
2010-11-15 22:00:00 +01:00
2018-06-13 23:00:00 +02:00
//
// cl_qparse.c
//
void CL_ParseQuakeMessage( sizebuf_t *msg, qboolean normal_message );
2010-11-15 22:00:00 +01:00
//
// cl_studio.c
//
2011-12-04 21:00:00 +01:00
void CL_InitStudioAPI( void );
2009-12-05 22:00:00 +01:00
2008-06-12 22:00:00 +02:00
//
2009-10-15 22:00:00 +02:00
// cl_frame.c
2008-06-12 22:00:00 +02:00
//
2016-11-14 22:00:00 +01:00
int CL_ParsePacketEntities( sizebuf_t *msg, qboolean delta );
2010-11-15 22:00:00 +01:00
qboolean CL_AddVisibleEntity( cl_entity_t *ent, int entityType );
2017-02-21 22:00:00 +01:00
void CL_ResetLatchedVars( cl_entity_t *ent, qboolean full_reset );
2017-01-14 22:00:00 +01:00
qboolean CL_GetEntitySpatialization( struct channel_s *ch );
qboolean CL_GetMovieSpatialization( struct rawchan_s *ch );
2018-09-28 23:00:00 +02:00
void CL_ProcessPlayerState( int playerindex, entity_state_t *state );
2017-02-15 22:00:00 +01:00
void CL_ComputePlayerOrigin( cl_entity_t *clent );
2018-06-13 23:00:00 +02:00
void CL_ProcessPacket( frame_t *frame );
2018-03-04 22:00:00 +01:00
void CL_MoveThirdpersonCamera( void );
2010-10-26 22:00:00 +02:00
qboolean CL_IsPlayerIndex( int idx );
2016-08-13 23:00:00 +02:00
void CL_SetIdealPitch( void );
2017-02-21 22:00:00 +01:00
void CL_EmitEntities( void );
2008-06-12 22:00:00 +02:00
2011-07-22 22:00:00 +02:00
//
// cl_remap.c
//
remap_info_t *CL_GetRemapInfoForEntity( cl_entity_t *e );
void CL_AllocRemapInfo( int topcolor, int bottomcolor );
void CL_FreeRemapInfo( remap_info_t *info );
void R_StudioSetRemapColors( int top, int bottom );
void CL_UpdateRemapInfo( int topcolor, int bottomcolor );
void CL_ClearAllRemaps( void );
2007-06-21 22:00:00 +02:00
//
2010-07-20 22:00:00 +02:00
// cl_tent.c
2007-06-21 22:00:00 +02:00
//
2010-10-31 22:00:00 +01:00
int CL_AddEntity( int entityType, cl_entity_t *pEnt );
2010-08-12 22:00:00 +02:00
void CL_WeaponAnim( int iAnim, int body );
2008-06-30 22:00:00 +02:00
void CL_ClearEffects( void );
2013-10-23 22:00:00 +02:00
void CL_ClearEfrags( void );
2009-01-22 22:00:00 +01:00
void CL_TestLights( void );
2017-03-31 23:00:00 +02:00
void CL_DrawParticlesExternal( const ref_viewpass_t *rvp, qboolean trans_pass, float frametime );
2013-10-23 22:00:00 +02:00
void CL_FireCustomDecal( int textureIndex, int entityIndex, int modelIndex, float *pos, int flags, float scale );
2010-12-23 22:00:00 +01:00
void CL_DecalShoot( int textureIndex, int entityIndex, int modelIndex, float *pos, int flags );
2018-03-11 22:00:00 +01:00
void CL_PlayerDecal( int playerIndex, int textureIndex, int entityIndex, float *pos );
2017-03-21 22:00:00 +01:00
void R_FreeDeadParticles( struct particle_s **ppparticles );
2018-03-11 22:00:00 +01:00
void CL_AddClientResource( const char *filename, int type );
2018-03-08 22:00:00 +01:00
void CL_AddClientResources( void );
2017-02-21 22:00:00 +01:00
int CL_FxBlend( cl_entity_t *e );
2010-11-03 22:00:00 +01:00
void CL_InitParticles( void );
void CL_ClearParticles( void );
void CL_FreeParticles( void );
2017-02-21 22:00:00 +01:00
void CL_DrawParticles( double frametime );
void CL_DrawTracers( double frametime );
2010-11-10 22:00:00 +01:00
void CL_InitTempEnts( void );
void CL_ClearTempEnts( void );
void CL_FreeTempEnts( void );
2017-02-21 22:00:00 +01:00
void CL_TempEntUpdate( void );
2010-11-10 22:00:00 +01:00
void CL_InitViewBeams( void );
void CL_ClearViewBeams( void );
void CL_FreeViewBeams( void );
void CL_DrawBeams( int fTrans );
void CL_AddCustomBeam( cl_entity_t *pEnvBeam );
void CL_KillDeadBeams( cl_entity_t *pDeadEntity );
void CL_ParseViewBeam( sizebuf_t *msg, int beamType );
2017-03-02 22:00:00 +01:00
void CL_LoadClientSprites( void );
2011-09-03 22:00:00 +02:00
void CL_ReadPointFile_f( void );
void CL_ReadLineFile_f( void );
2016-11-22 22:00:00 +01:00
void CL_RunLightStyles( void );
2010-02-23 22:00:00 +01:00
2007-11-04 22:00:00 +01:00
//
2010-07-19 22:00:00 +02:00
// console.c
2007-11-04 22:00:00 +01:00
//
2011-09-28 22:00:00 +02:00
extern convar_t *con_fontsize;
2010-10-26 22:00:00 +02:00
qboolean Con_Visible( void );
2017-07-16 23:00:00 +02:00
qboolean Con_FixedFont( void );
2010-07-19 22:00:00 +02:00
void Con_VidInit( void );
2016-11-19 22:00:00 +01:00
void Con_Shutdown( void );
2007-11-04 22:00:00 +01:00
void Con_ToggleConsole_f( void );
void Con_ClearNotify( void );
2011-04-08 22:00:00 +02:00
void Con_DrawDebug( void );
2007-11-04 22:00:00 +01:00
void Con_RunConsole( void );
void Con_DrawConsole( void );
2010-12-28 22:00:00 +01:00
void Con_DrawVersion( void );
2010-07-20 22:00:00 +02:00
void Con_DrawStringLen( const char *pText, int *length, int *height );
int Con_DrawString( int x, int y, const char *string, rgba_t setColor );
2011-09-03 22:00:00 +02:00
int Con_DrawCharacter( int x, int y, int number, rgba_t color );
void Con_DrawCharacterLen( int number, int *width, int *height );
2010-07-20 22:00:00 +02:00
void Con_DefaultColor( int r, int g, int b );
2012-12-23 21:00:00 +01:00
void Con_InvalidateFonts( void );
2011-09-28 22:00:00 +02:00
void Con_SetFont( int fontNum );
2010-07-19 22:00:00 +02:00
void Con_CharEvent( int key );
2011-09-28 22:00:00 +02:00
void Con_RestoreFont( void );
2010-07-19 22:00:00 +02:00
void Key_Console( int key );
2011-07-07 22:00:00 +02:00
void Key_Message( int key );
2016-11-19 22:00:00 +01:00
void Con_FastClose( void );
2007-11-05 22:00:00 +01:00
2010-11-20 22:00:00 +01:00
//
2011-04-08 22:00:00 +02:00
// s_main.c
2010-11-20 22:00:00 +01:00
//
void S_StreamRawSamples( int samples, int rate, int width, int channels, const byte *data );
2018-10-01 23:00:00 +02:00
void S_StreamAviSamples( void *Avi, int entnum, float fvol, float attn, float synctime );
2018-02-15 22:00:00 +01:00
void S_StartBackgroundTrack( const char *intro, const char *loop, long position, qboolean fullpath );
2010-11-20 22:00:00 +01:00
void S_StopBackgroundTrack( void );
void S_StreamSetPause( int pause );
void S_StartStreaming( void );
void S_StopStreaming( void );
void S_BeginRegistration( void );
sound_t S_RegisterSound( const char *sample );
void S_EndRegistration( void );
2012-05-14 22:00:00 +02:00
void S_RestoreSound( const vec3_t pos, int ent, int chan, sound_t handle, float fvol, float attn, int pitch, int flags, double sample, double end, int wordIndex );
2010-11-20 22:00:00 +01:00
void S_StartSound( const vec3_t pos, int ent, int chan, sound_t sfx, float vol, float attn, int pitch, int flags );
2010-12-25 22:00:00 +01:00
void S_AmbientSound( const vec3_t pos, int ent, sound_t handle, float fvol, float attn, int pitch, int flags );
2010-11-20 22:00:00 +01:00
void S_FadeClientVolume( float fadePercent, float fadeOutSeconds, float holdTime, float fadeInSeconds );
2013-10-30 21:00:00 +01:00
void S_FadeMusicVolume( float fadePercent );
2014-10-31 22:00:00 +01:00
void S_StartLocalSound( const char *name, float volume, qboolean reliable );
2017-02-15 22:00:00 +01:00
void SND_UpdateSound( void );
2010-11-20 22:00:00 +01:00
void S_ExtraUpdate( void );
2008-06-28 22:00:00 +02:00
//
2016-11-17 22:00:00 +01:00
// cl_gameui.c
2008-06-28 22:00:00 +02:00
//
2010-07-18 22:00:00 +02:00
void UI_UnloadProgs( void );
2011-03-20 22:00:00 +01:00
qboolean UI_LoadProgs( void );
2010-07-18 22:00:00 +02:00
void UI_UpdateMenu( float realtime );
2010-10-26 22:00:00 +02:00
void UI_KeyEvent( int key, qboolean down );
2009-09-10 22:00:00 +02:00
void UI_MouseMove( int x, int y );
2010-10-26 22:00:00 +02:00
void UI_SetActiveMenu( qboolean fActive );
2009-09-10 22:00:00 +02:00
void UI_AddServerToList( netadr_t adr, const char *info );
2010-07-18 22:00:00 +02:00
void UI_GetCursorPos( int *pos_x, int *pos_y );
2010-01-02 22:00:00 +01:00
void UI_SetCursorPos( int pos_x, int pos_y );
2010-10-26 22:00:00 +02:00
void UI_ShowCursor( qboolean show );
qboolean UI_CreditsActive( void );
2010-02-16 22:00:00 +01:00
void UI_CharEvent( int key );
2010-10-26 22:00:00 +02:00
qboolean UI_MouseInRect( void );
qboolean UI_IsVisible( void );
2010-12-02 22:00:00 +01:00
void pfnPIC_Set( HIMAGE hPic, int r, int g, int b, int a );
void pfnPIC_Draw( int x, int y, int width, int height, const wrect_t *prc );
void pfnPIC_DrawTrans( int x, int y, int width, int height, const wrect_t *prc );
void pfnPIC_DrawHoles( int x, int y, int width, int height, const wrect_t *prc );
void pfnPIC_DrawAdditive( int x, int y, int width, int height, const wrect_t *prc );
2008-06-28 22:00:00 +02:00
2007-11-06 22:00:00 +01:00
//
2009-11-23 22:00:00 +01:00
// cl_video.c
2007-11-06 22:00:00 +01:00
//
2009-11-23 22:00:00 +01:00
void SCR_InitCinematic( void );
2010-09-30 22:00:00 +02:00
void SCR_FreeCinematic( void );
2010-10-26 22:00:00 +02:00
qboolean SCR_PlayCinematic( const char *name );
qboolean SCR_DrawCinematic( void );
2014-04-01 22:00:00 +02:00
qboolean SCR_NextMovie( void );
2007-11-06 22:00:00 +01:00
void SCR_RunCinematic( void );
void SCR_StopCinematic( void );
2008-08-02 22:00:00 +02:00
void CL_PlayVideo_f( void );
2007-11-06 22:00:00 +01:00
2007-11-04 22:00:00 +01:00
#endif//CLIENT_H