2007-06-21 22:00:00 +02:00
|
|
|
/*
|
|
|
|
Copyright (C) 1997-2001 Id Software, Inc.
|
|
|
|
|
|
|
|
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 2
|
|
|
|
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.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
|
|
|
|
*/
|
|
|
|
// client.h -- primary header for client
|
|
|
|
|
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"
|
2008-12-25 22:00:00 +01:00
|
|
|
#include "entity_def.h"
|
|
|
|
#include "clgame_api.h"
|
2008-11-09 22:00:00 +01:00
|
|
|
#include "render_api.h"
|
2009-01-22 22:00:00 +01:00
|
|
|
#include "pm_movevars.h"
|
2007-11-05 22:00:00 +01:00
|
|
|
|
|
|
|
#define MAX_EDIT_LINE 256
|
|
|
|
#define COMMAND_HISTORY 32
|
2008-06-22 22:00:00 +02:00
|
|
|
#define MAX_SERVERS 64
|
2008-07-23 22:00:00 +02:00
|
|
|
#define ColorIndex(c) (((c) - '0') & 7)
|
2007-06-21 22:00:00 +02:00
|
|
|
|
2009-06-24 22:00:00 +02:00
|
|
|
#define NUM_FOR_EDICT(e) ((int)((edict_t *)(e) - clgame.edicts))
|
2008-12-26 22:00:00 +01:00
|
|
|
#define EDICT_NUM( num ) CL_EDICT_NUM( num, __FILE__, __LINE__ )
|
|
|
|
#define STRING( offset ) CL_GetString( offset )
|
|
|
|
#define MAKE_STRING(str) CL_AllocString( str )
|
2008-12-25 22:00:00 +01:00
|
|
|
|
2007-06-21 22:00:00 +02:00
|
|
|
//=============================================================================
|
2008-07-16 22:00:00 +02:00
|
|
|
typedef struct frame_s
|
2007-06-21 22:00:00 +02:00
|
|
|
{
|
|
|
|
bool valid; // cleared if delta parsing was invalid
|
2008-07-10 22:00:00 +02:00
|
|
|
int serverframe;
|
2009-06-24 22:00:00 +02:00
|
|
|
double servertime;
|
2008-07-10 22:00:00 +02:00
|
|
|
int deltaframe;
|
2008-09-09 22:00:00 +02:00
|
|
|
byte areabits[MAX_MAP_AREA_BYTES]; // portalarea visibility bits
|
2008-07-10 22:00:00 +02:00
|
|
|
int num_entities;
|
2008-07-11 22:00:00 +02:00
|
|
|
int parse_entities; // non-masked index into cl_parse_entities array
|
2009-06-24 22:00:00 +02:00
|
|
|
entity_state_t ps; // player state
|
2007-06-21 22:00:00 +02:00
|
|
|
} frame_t;
|
|
|
|
|
2007-11-05 22:00:00 +01:00
|
|
|
// console stuff
|
|
|
|
typedef struct field_s
|
|
|
|
{
|
|
|
|
int cursor;
|
|
|
|
int scroll;
|
|
|
|
int widthInChars;
|
|
|
|
char buffer[MAX_EDIT_LINE];
|
|
|
|
int maxchars; // menu stuff
|
|
|
|
} field_t;
|
|
|
|
|
2008-07-11 22:00:00 +02:00
|
|
|
#define CMD_BACKUP 64 // allow a lot of command backups for very fast systems
|
|
|
|
#define CMD_MASK (CMD_BACKUP - 1)
|
2007-06-21 22:00:00 +02:00
|
|
|
|
|
|
|
//
|
2007-11-04 22:00:00 +01:00
|
|
|
// the client_t structure is wiped completely at every
|
2007-06-21 22:00:00 +02:00
|
|
|
// server map change
|
|
|
|
//
|
|
|
|
typedef struct
|
|
|
|
{
|
2008-05-20 22:00:00 +02:00
|
|
|
int timeoutcount;
|
2007-06-21 22:00:00 +02:00
|
|
|
|
2008-08-03 22:00:00 +02:00
|
|
|
bool video_prepped; // false if on new level or new ref dll
|
|
|
|
bool audio_prepped; // false if on new level or new snd dll
|
2007-06-21 22:00:00 +02:00
|
|
|
|
2007-11-06 22:00:00 +01:00
|
|
|
int parse_entities; // index (not anded off) into cl_parse_entities[]
|
2007-06-21 22:00:00 +02:00
|
|
|
|
2008-07-06 22:00:00 +02:00
|
|
|
int cmd_number;
|
2008-12-26 22:00:00 +01:00
|
|
|
usercmd_t cmds[CMD_BACKUP]; // each mesage will send several old cmds
|
2009-06-24 22:00:00 +02:00
|
|
|
float cmd_time[CMD_BACKUP]; // for netgraph ping calculation
|
2008-12-26 22:00:00 +01:00
|
|
|
int predicted_origins[CMD_BACKUP][3];// for debug comparing against server
|
2007-06-21 22:00:00 +02:00
|
|
|
|
2008-12-26 22:00:00 +01:00
|
|
|
float predicted_step; // for stair up smoothing
|
2008-07-03 22:00:00 +02:00
|
|
|
uint predicted_step_time;
|
2007-06-21 22:00:00 +02:00
|
|
|
|
2008-12-26 22:00:00 +01:00
|
|
|
vec3_t predicted_origin; // generated by CL_PredictMovement
|
2007-06-21 22:00:00 +02:00
|
|
|
vec3_t predicted_angles;
|
|
|
|
vec3_t prediction_error;
|
|
|
|
|
2008-12-26 22:00:00 +01:00
|
|
|
frame_t frame; // received from server
|
|
|
|
int surpressCount; // number of messages rate supressed
|
2007-06-21 22:00:00 +02:00
|
|
|
frame_t frames[UPDATE_BACKUP];
|
2008-07-06 22:00:00 +02:00
|
|
|
|
|
|
|
// mouse current position
|
|
|
|
int mouse_x[2];
|
|
|
|
int mouse_y[2];
|
|
|
|
int mouse_step;
|
|
|
|
float mouse_sens;
|
2007-06-21 22:00:00 +02:00
|
|
|
|
|
|
|
// the client maintains its own idea of view angles, which are
|
|
|
|
// sent to the server each frame. It is cleared to 0 upon entering each level.
|
|
|
|
// the server sends a delta each frame which is added to the locally
|
|
|
|
// tracked view angles to account for standing on rotating objects,
|
|
|
|
// and teleport direction changes
|
|
|
|
vec3_t viewangles;
|
|
|
|
|
2009-02-03 22:00:00 +01:00
|
|
|
double mtime[2]; // the timestamp of the last two messages
|
|
|
|
double time; // this is the time value that the client
|
|
|
|
double oldtime; // cl.oldtime
|
2007-10-31 22:00:00 +01:00
|
|
|
// is rendering at. always <= cls.realtime
|
2009-07-15 22:00:00 +02:00
|
|
|
int render_flags; // clearing at end of frame
|
2009-07-28 22:00:00 +02:00
|
|
|
bool old_areabits; // a bit who indicated RDF_OLDAREABITS
|
2008-12-26 22:00:00 +01:00
|
|
|
ref_params_t refdef; // shared refdef
|
2009-01-03 22:00:00 +01:00
|
|
|
edict_t viewent; // viewmodel
|
2009-01-05 22:00:00 +01:00
|
|
|
client_data_t data; // hud data
|
2007-06-21 22:00:00 +02:00
|
|
|
|
2008-12-26 22:00:00 +01:00
|
|
|
// misc 2d drawing stuff
|
2009-02-03 22:00:00 +01:00
|
|
|
float centerPrintTime;
|
2007-11-06 22:00:00 +01:00
|
|
|
int centerPrintCharWidth;
|
|
|
|
int centerPrintY;
|
|
|
|
char centerPrint[1024];
|
|
|
|
int centerPrintLines;
|
2008-12-26 22:00:00 +01:00
|
|
|
bool need_levelshot;
|
2007-11-06 22:00:00 +01:00
|
|
|
|
2007-06-21 22:00:00 +02:00
|
|
|
//
|
|
|
|
// server state information
|
|
|
|
//
|
2007-11-06 22:00:00 +01:00
|
|
|
int playernum;
|
2009-06-24 22:00:00 +02:00
|
|
|
int servercount; // server identification for prespawns
|
|
|
|
float serverframetime; // server frametime
|
2008-10-27 22:00:00 +01:00
|
|
|
char configstrings[MAX_CONFIGSTRINGS][CS_SIZE];
|
2007-06-21 22:00:00 +02:00
|
|
|
|
|
|
|
// locally derived information from server state
|
2008-07-30 22:00:00 +02:00
|
|
|
cmodel_t *models[MAX_MODELS];
|
|
|
|
cmodel_t *worldmodel;
|
2008-08-02 22:00:00 +02:00
|
|
|
string_t edict_classnames[MAX_CLASSNAMES];
|
2007-11-01 22:00:00 +01:00
|
|
|
sound_t sound_precache[MAX_SOUNDS];
|
2008-12-15 22:00:00 +01:00
|
|
|
shader_t decal_shaders[MAX_DECALS];
|
2007-11-04 22:00:00 +01:00
|
|
|
} client_t;
|
2007-06-21 22:00:00 +02:00
|
|
|
|
2007-11-04 22:00:00 +01:00
|
|
|
extern client_t cl;
|
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
|
|
|
|
{
|
2008-07-12 22:00:00 +02:00
|
|
|
ca_uninitialized = 0,
|
2007-06-21 22:00:00 +02:00
|
|
|
ca_disconnected, // not talking to a server
|
2007-11-01 22:00:00 +01:00
|
|
|
ca_connecting, // sending request packets to the server
|
|
|
|
ca_connected, // netchan_t established, waiting for svc_serverdata
|
|
|
|
ca_active, // game views should be displayed
|
|
|
|
ca_cinematic, // playing a cinematic, not connected to a server
|
2007-06-21 22:00:00 +02:00
|
|
|
} connstate_t;
|
|
|
|
|
2008-08-03 22:00:00 +02:00
|
|
|
typedef enum
|
|
|
|
{
|
2007-06-21 22:00:00 +02:00
|
|
|
dl_none,
|
|
|
|
dl_model,
|
|
|
|
dl_sound,
|
2008-08-03 22:00:00 +02:00
|
|
|
dl_generic,
|
2007-06-21 22:00:00 +02:00
|
|
|
} dltype_t; // download type
|
|
|
|
|
2008-12-25 22:00:00 +01:00
|
|
|
// cl_private_edict_t
|
2008-12-26 22:00:00 +01:00
|
|
|
struct cl_priv_s
|
2008-07-24 22:00:00 +02:00
|
|
|
{
|
|
|
|
int serverframe; // if not current, this ent isn't in the frame
|
|
|
|
|
|
|
|
entity_state_t baseline; // delta from this if not from a previous frame
|
|
|
|
entity_state_t current;
|
|
|
|
entity_state_t prev; // will always be valid, but might just be a copy of current
|
|
|
|
};
|
|
|
|
|
2008-06-22 22:00:00 +02:00
|
|
|
typedef struct serverinfo_s
|
|
|
|
{
|
|
|
|
char *mapname;
|
|
|
|
char *hostname;
|
|
|
|
char *shortname;
|
|
|
|
char *gamename;
|
|
|
|
char *netaddress;
|
|
|
|
|
|
|
|
char *playerstr;
|
|
|
|
int numplayers;
|
|
|
|
int maxplayers;
|
|
|
|
|
|
|
|
char *pingstring;
|
|
|
|
bool statusPacket;
|
|
|
|
int ping;
|
|
|
|
|
|
|
|
} serverinfo_t;
|
|
|
|
|
2009-01-09 22:00:00 +01:00
|
|
|
typedef enum { key_console = 0, key_game, key_hudmenu, key_message, key_menu } keydest_t;
|
2008-12-25 22:00:00 +01:00
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
2008-12-26 22:00:00 +01:00
|
|
|
char name[CS_SIZE];
|
2008-12-25 22:00:00 +01:00
|
|
|
int number; // svc_ number
|
|
|
|
int size; // if size == -1, size come from first byte after svcnum
|
|
|
|
pfnUserMsgHook func; // user-defined function
|
|
|
|
} user_message_t;
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
2009-06-24 22:00:00 +02:00
|
|
|
void *hInstance; // pointer to client.dll
|
|
|
|
HUD_FUNCTIONS dllFuncs; // dll exported funcs
|
|
|
|
byte *private; // client.dll private pool
|
|
|
|
|
|
|
|
union
|
|
|
|
{
|
|
|
|
edict_t *edicts; // acess by edict number
|
|
|
|
void *vp; // acess by offset in bytes
|
|
|
|
};
|
|
|
|
|
2008-12-25 22:00:00 +01:00
|
|
|
int maxClients;
|
|
|
|
int numEntities;
|
|
|
|
int maxEntities;
|
|
|
|
user_message_t *msg[MAX_USER_MESSAGES];
|
|
|
|
int numMessages; // actual count of user messages
|
|
|
|
int hStringTable; // stringtable handle
|
2009-01-11 22:00:00 +01:00
|
|
|
|
2009-01-22 22:00:00 +01:00
|
|
|
// movement values from server
|
|
|
|
movevars_t movevars;
|
2008-12-25 22:00:00 +01:00
|
|
|
} clgame_static_t;
|
2007-06-21 22:00:00 +02:00
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
connstate_t state;
|
2008-08-04 22:00:00 +02:00
|
|
|
bool initialized;
|
|
|
|
|
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
|
2008-12-26 22:00:00 +01:00
|
|
|
|
2008-06-22 22:00:00 +02:00
|
|
|
int framecount;
|
2009-02-03 22:00:00 +01:00
|
|
|
double frametime; // seconds since last frame
|
2009-06-24 22:00:00 +02:00
|
|
|
double realtime;
|
|
|
|
|
|
|
|
int quakePort; // a 16 bit value that allows quake servers
|
|
|
|
// to work around address translating routers
|
2007-06-21 22:00:00 +02:00
|
|
|
|
2007-11-14 22:00:00 +01:00
|
|
|
// connection information
|
2008-05-20 22:00:00 +02:00
|
|
|
string servername; // name of server from original connect
|
2007-06-21 22:00:00 +02:00
|
|
|
float connect_time; // for connection retransmits
|
2008-07-11 22:00:00 +02:00
|
|
|
|
|
|
|
netchan_t netchan;
|
|
|
|
int serverProtocol; // in case we are doing some kind of version hack
|
2007-06-21 22:00:00 +02:00
|
|
|
|
2008-06-30 22:00:00 +02:00
|
|
|
int challenge; // from the server to use for connecting
|
2008-11-09 22:00:00 +01:00
|
|
|
shader_t consoleFont; // current console font
|
2008-11-15 22:00:00 +01:00
|
|
|
shader_t clientFont; // current client font
|
2008-11-09 22:00:00 +01:00
|
|
|
shader_t consoleBack; // console background
|
2008-12-26 22:00:00 +01:00
|
|
|
shader_t netIcon; // netIcon displayed bad network connection
|
2008-11-09 22:00:00 +01:00
|
|
|
|
2008-06-30 22:00:00 +02:00
|
|
|
file_t *download; // file transfer from server
|
2008-07-23 22:00:00 +02:00
|
|
|
string downloadname;
|
2008-08-03 22:00:00 +02:00
|
|
|
string downloadtempname;
|
2008-05-20 22:00:00 +02:00
|
|
|
int downloadnumber;
|
|
|
|
dltype_t downloadtype;
|
2007-06-21 22:00:00 +02:00
|
|
|
|
2008-08-02 22:00:00 +02:00
|
|
|
// demo recording info must be here, so it isn't clearing on level change
|
2008-05-20 22:00:00 +02:00
|
|
|
bool demorecording;
|
|
|
|
bool demoplayback;
|
2008-08-02 22:00:00 +02:00
|
|
|
bool demowaiting; // don't record until a non-delta message is received
|
|
|
|
string demoname; // for demo looping
|
2008-05-20 22:00:00 +02:00
|
|
|
|
2007-06-21 22:00:00 +02:00
|
|
|
file_t *demofile;
|
2008-06-22 22:00:00 +02:00
|
|
|
serverinfo_t serverlist[MAX_SERVERS]; // servers to join
|
|
|
|
int numservers;
|
2009-02-03 22:00:00 +01:00
|
|
|
float pingtime; // servers timebase
|
2008-07-06 22:00:00 +02:00
|
|
|
|
|
|
|
// cursor mouse pos for uimenu
|
|
|
|
int mouse_x;
|
|
|
|
int mouse_y;
|
2007-06-21 22:00:00 +02:00
|
|
|
} client_static_t;
|
|
|
|
|
|
|
|
extern client_static_t cls;
|
2008-12-26 22:00:00 +01:00
|
|
|
extern clgame_static_t clgame;
|
2007-06-21 22:00:00 +02:00
|
|
|
|
2008-07-04 22:00:00 +02:00
|
|
|
/*
|
|
|
|
==============================================================
|
|
|
|
|
|
|
|
SCREEN CONSTS
|
|
|
|
|
|
|
|
==============================================================
|
|
|
|
*/
|
2008-08-04 22:00:00 +02:00
|
|
|
extern vec4_t g_color_table[8];
|
2008-01-15 22:00:00 +01:00
|
|
|
|
2007-06-21 22:00:00 +02:00
|
|
|
//
|
|
|
|
// cvars
|
|
|
|
//
|
|
|
|
extern cvar_t *cl_add_lights;
|
|
|
|
extern cvar_t *cl_add_particles;
|
|
|
|
extern cvar_t *cl_add_entities;
|
|
|
|
extern cvar_t *cl_predict;
|
|
|
|
extern cvar_t *cl_footsteps;
|
2008-01-20 22:00:00 +01:00
|
|
|
extern cvar_t *cl_showfps;
|
2007-06-21 22:00:00 +02:00
|
|
|
extern cvar_t *cl_upspeed;
|
|
|
|
extern cvar_t *cl_forwardspeed;
|
|
|
|
extern cvar_t *cl_sidespeed;
|
2008-07-16 22:00:00 +02:00
|
|
|
extern cvar_t *cl_shownet;
|
2007-06-21 22:00:00 +02:00
|
|
|
extern cvar_t *cl_yawspeed;
|
|
|
|
extern cvar_t *cl_pitchspeed;
|
2008-11-09 22:00:00 +01:00
|
|
|
extern cvar_t *cl_envshot_size;
|
2007-06-21 22:00:00 +02:00
|
|
|
extern cvar_t *cl_run;
|
2008-11-15 22:00:00 +01:00
|
|
|
extern cvar_t *cl_font;
|
2007-06-21 22:00:00 +02:00
|
|
|
|
|
|
|
extern cvar_t *cl_anglespeedkey;
|
2008-07-11 22:00:00 +02:00
|
|
|
|
2007-06-21 22:00:00 +02:00
|
|
|
extern cvar_t *cl_showmiss;
|
|
|
|
extern cvar_t *cl_showclamp;
|
2008-11-16 22:00:00 +01:00
|
|
|
extern cvar_t *cl_particles;
|
|
|
|
extern cvar_t *cl_particlelod;
|
2007-06-21 22:00:00 +02:00
|
|
|
|
|
|
|
extern cvar_t *lookspring;
|
|
|
|
extern cvar_t *lookstrafe;
|
2008-06-09 22:00:00 +02:00
|
|
|
extern cvar_t *cl_sensitivity;
|
|
|
|
extern cvar_t *ui_sensitivity;
|
2007-06-21 22:00:00 +02:00
|
|
|
|
|
|
|
extern cvar_t *m_pitch;
|
|
|
|
extern cvar_t *m_yaw;
|
2008-07-06 22:00:00 +02:00
|
|
|
extern cvar_t *m_forward;
|
2008-07-11 22:00:00 +02:00
|
|
|
extern cvar_t *m_side;
|
2008-07-06 22:00:00 +02:00
|
|
|
extern cvar_t *cl_mouselook;
|
2008-08-04 22:00:00 +02:00
|
|
|
extern cvar_t *cl_testentities;
|
|
|
|
extern cvar_t *cl_testlights;
|
2009-09-06 22:00:00 +02:00
|
|
|
extern cvar_t *cl_testflashlight;
|
2007-06-21 22:00:00 +02:00
|
|
|
extern cvar_t *cl_lightlevel; // FIXME HACK
|
|
|
|
extern cvar_t *cl_paused;
|
2007-11-13 22:00:00 +01:00
|
|
|
extern cvar_t *cl_levelshot_name;
|
2007-06-21 22:00:00 +02:00
|
|
|
|
2008-06-29 22:00:00 +02:00
|
|
|
extern cvar_t *scr_centertime;
|
|
|
|
extern cvar_t *scr_showpause;
|
2008-11-09 22:00:00 +01:00
|
|
|
extern cvar_t *con_font;
|
2008-06-29 22:00:00 +02:00
|
|
|
|
2007-06-21 22:00:00 +02:00
|
|
|
typedef struct
|
|
|
|
{
|
2008-08-02 22:00:00 +02:00
|
|
|
// these values shared with dlight_t so don't move them
|
2009-02-01 22:00:00 +01:00
|
|
|
vec3_t origin;
|
|
|
|
union
|
|
|
|
{
|
|
|
|
vec3_t color; // dlight color
|
|
|
|
vec3_t angles; // spotlight angles
|
|
|
|
};
|
|
|
|
float radius;
|
|
|
|
shader_t texture; // light image e.g. for flashlight
|
|
|
|
vec2_t cone; // spotlight cone
|
2008-08-02 22:00:00 +02:00
|
|
|
|
|
|
|
// cdlight_t private starts here
|
2009-02-01 22:00:00 +01:00
|
|
|
int key; // so entities can reuse same entry
|
|
|
|
float die; // stop lighting after this time
|
|
|
|
float decay; // drop this each second
|
2007-06-21 22:00:00 +02:00
|
|
|
} cdlight_t;
|
|
|
|
|
|
|
|
extern cdlight_t cl_dlights[MAX_DLIGHTS];
|
|
|
|
|
|
|
|
// the cl_parse_entities must be large enough to hold UPDATE_BACKUP frames of
|
|
|
|
// entities, so that when a delta compressed message arives from the server
|
|
|
|
// it can be un-deltad from the original
|
|
|
|
#define MAX_PARSE_ENTITIES 1024
|
|
|
|
extern entity_state_t cl_parse_entities[MAX_PARSE_ENTITIES];
|
|
|
|
|
|
|
|
//=============================================================================
|
2008-07-11 22:00:00 +02:00
|
|
|
|
2008-08-02 22:00:00 +02:00
|
|
|
bool CL_CheckOrDownloadFile( const char *filename );
|
2007-06-21 22:00:00 +02:00
|
|
|
|
|
|
|
void CL_TeleporterParticles (entity_state_t *ent);
|
|
|
|
void CL_ParticleEffect (vec3_t org, vec3_t dir, int color, int count);
|
|
|
|
void CL_ParticleEffect2 (vec3_t org, vec3_t dir, int color, int count);
|
|
|
|
|
|
|
|
// RAFAEL
|
|
|
|
void CL_ParticleEffect3 (vec3_t org, vec3_t dir, int color, int count);
|
|
|
|
|
|
|
|
|
|
|
|
//=================================================
|
2008-08-04 22:00:00 +02:00
|
|
|
//
|
|
|
|
// cinematic.c
|
|
|
|
//
|
|
|
|
bool CIN_PlayCinematic( const char *filename ); // play cinematic with specified name
|
|
|
|
void CIN_DrawCinematic( void ); // draw current frame
|
|
|
|
void CIN_RunCinematic( void ); // decompress next frame
|
|
|
|
void CIN_StopCinematic( void ); // stop video playing
|
|
|
|
|
2008-06-14 22:00:00 +02:00
|
|
|
void CL_TeleportSplash( vec3_t org );
|
2008-05-20 22:00:00 +02:00
|
|
|
int CL_ParseEntityBits( sizebuf_t *msg, uint *bits );
|
|
|
|
void CL_ParseFrame( sizebuf_t *msg );
|
2007-06-21 22:00:00 +02:00
|
|
|
|
2008-06-30 22:00:00 +02:00
|
|
|
void CL_ParseTempEnts( sizebuf_t *msg );
|
2008-05-20 22:00:00 +02:00
|
|
|
void CL_ParseConfigString( sizebuf_t *msg );
|
2008-08-03 22:00:00 +02:00
|
|
|
void CL_WriteConfiguration( void );
|
2007-06-21 22:00:00 +02:00
|
|
|
void CL_SetLightstyle (int i);
|
|
|
|
void CL_RunParticles (void);
|
|
|
|
void CL_RunDLights (void);
|
|
|
|
void CL_RunLightStyles (void);
|
|
|
|
|
|
|
|
void CL_AddEntities (void);
|
|
|
|
void CL_AddDLights (void);
|
|
|
|
void CL_AddLightStyles (void);
|
|
|
|
|
|
|
|
//=================================================
|
|
|
|
|
2008-08-03 22:00:00 +02:00
|
|
|
void CL_PrepVideo( void );
|
|
|
|
void CL_PrepSound( void );
|
2007-06-21 22:00:00 +02:00
|
|
|
|
2008-08-04 22:00:00 +02:00
|
|
|
//
|
|
|
|
// cl_cmds.c
|
|
|
|
//
|
2007-06-21 22:00:00 +02:00
|
|
|
void CL_Quit_f (void);
|
2007-11-06 22:00:00 +01:00
|
|
|
void CL_ScreenShot_f( void );
|
2008-11-09 22:00:00 +01:00
|
|
|
void CL_EnvShot_f( void );
|
|
|
|
void CL_SkyShot_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-01-20 22:00:00 +01:00
|
|
|
void CL_SetFont_f( void );
|
2008-08-04 22:00:00 +02:00
|
|
|
void SCR_Viewpos_f( void );
|
2007-06-21 22:00:00 +02:00
|
|
|
|
|
|
|
//
|
|
|
|
// cl_main
|
|
|
|
//
|
2007-09-13 22:00:00 +02:00
|
|
|
extern render_exp_t *re;
|
2007-06-21 22:00:00 +02:00
|
|
|
|
2008-06-29 22:00:00 +02:00
|
|
|
void CL_Init( void );
|
2009-01-14 22:00:00 +01:00
|
|
|
void CL_InitServerCommands( void );
|
2009-02-03 22:00:00 +01:00
|
|
|
void CL_SendCommand( void );
|
2007-06-21 22:00:00 +02:00
|
|
|
void CL_Disconnect (void);
|
|
|
|
void CL_Disconnect_f (void);
|
|
|
|
void CL_GetChallengePacket (void);
|
|
|
|
void CL_PingServers_f (void);
|
|
|
|
void CL_Snd_Restart_f (void);
|
|
|
|
void CL_RequestNextDownload (void);
|
|
|
|
|
|
|
|
//
|
2008-07-11 22:00:00 +02:00
|
|
|
// cl_input.c
|
2007-06-21 22:00:00 +02:00
|
|
|
//
|
2007-11-17 22:00:00 +01:00
|
|
|
void CL_InitInput( void );
|
|
|
|
void CL_ShutdownInput( void );
|
|
|
|
void CL_UpdateMouse( void );
|
2007-06-21 22:00:00 +02:00
|
|
|
void CL_SendCmd (void);
|
|
|
|
void CL_SendMove (usercmd_t *cmd);
|
|
|
|
|
|
|
|
void CL_ClearState (void);
|
|
|
|
|
|
|
|
void CL_ReadPackets (void);
|
|
|
|
|
|
|
|
int CL_ReadFromServer (void);
|
|
|
|
void CL_WriteToServer (usercmd_t *cmd);
|
|
|
|
void CL_BaseMove (usercmd_t *cmd);
|
|
|
|
|
|
|
|
void IN_CenterView (void);
|
2008-07-11 22:00:00 +02:00
|
|
|
|
2007-11-04 22:00:00 +01:00
|
|
|
void CL_CharEvent( int key );
|
2007-06-21 22:00:00 +02:00
|
|
|
char *Key_KeynumToString (int keynum);
|
|
|
|
|
|
|
|
//
|
|
|
|
// cl_demo.c
|
|
|
|
//
|
2008-07-12 22:00:00 +02:00
|
|
|
void CL_DrawDemoRecording( void );
|
|
|
|
void CL_WriteDemoMessage( sizebuf_t *msg, int head_size );
|
2008-05-20 22:00:00 +02:00
|
|
|
void CL_ReadDemoMessage( void );
|
|
|
|
void CL_StopPlayback( void );
|
|
|
|
void CL_StopRecord( void );
|
|
|
|
void CL_PlayDemo_f( void );
|
|
|
|
void CL_Record_f( void );
|
|
|
|
void CL_Stop_f( void );
|
2007-06-21 22:00:00 +02:00
|
|
|
|
2008-05-23 22:00:00 +02:00
|
|
|
//
|
|
|
|
// cl_progs.c
|
|
|
|
//
|
|
|
|
void CL_InitClientProgs( void );
|
|
|
|
void CL_FreeClientProgs( void );
|
2008-08-05 22:00:00 +02:00
|
|
|
int CL_GetMaxClients( void );
|
2008-12-26 22:00:00 +01:00
|
|
|
void CL_DrawHUD( int state );
|
2008-12-25 22:00:00 +01:00
|
|
|
edict_t *CL_GetEdict( int entnum );
|
2008-06-30 22:00:00 +02:00
|
|
|
float *CL_FadeColor( float starttime, float endtime );
|
2008-07-01 22:00:00 +02:00
|
|
|
void CL_FreeEdicts( void );
|
2008-12-25 22:00:00 +01:00
|
|
|
|
|
|
|
//
|
|
|
|
// cl_game.c
|
|
|
|
//
|
|
|
|
void CL_UnloadProgs( void );
|
|
|
|
bool CL_LoadProgs( const char *name );
|
|
|
|
void CL_ParseUserMessage( sizebuf_t *msg, int svc_num );
|
2008-12-26 22:00:00 +01:00
|
|
|
void CL_LinkUserMessage( char *pszName, const int svc_num );
|
|
|
|
void CL_SortUserMessages( void );
|
2008-12-25 22:00:00 +01:00
|
|
|
edict_t *CL_AllocEdict( void );
|
2009-01-04 22:00:00 +01:00
|
|
|
void CL_InitEdict( edict_t *pEdict );
|
2008-12-25 22:00:00 +01:00
|
|
|
void CL_FreeEdict( edict_t *pEdict );
|
2008-12-26 22:00:00 +01:00
|
|
|
string_t CL_AllocString( const char *szValue );
|
|
|
|
const char *CL_GetString( string_t iString );
|
2009-02-01 22:00:00 +01:00
|
|
|
bool CL_RenderTrace( const vec3_t start, const vec3_t mins, const vec3_t maxs, const vec3_t end );
|
2008-12-25 22:00:00 +01:00
|
|
|
|
2008-12-26 22:00:00 +01:00
|
|
|
_inline edict_t *CL_EDICT_NUM( int n, const char *file, const int line )
|
2008-12-25 22:00:00 +01:00
|
|
|
{
|
2008-12-26 22:00:00 +01:00
|
|
|
if((n >= 0) && (n < clgame.maxEntities))
|
2009-06-24 22:00:00 +02:00
|
|
|
return clgame.edicts + n;
|
2008-12-26 22:00:00 +01:00
|
|
|
Host_Error( "CL_EDICT_NUM: bad number %i (called at %s:%i)\n", n, file, line );
|
2008-12-25 22:00:00 +01:00
|
|
|
return NULL;
|
|
|
|
}
|
2008-07-01 22:00:00 +02:00
|
|
|
|
2007-11-24 22:00:00 +01:00
|
|
|
//
|
|
|
|
// cl_sound.c
|
|
|
|
//
|
2008-12-03 22:00:00 +01:00
|
|
|
#define S_Shutdown if( se ) se->Shutdown
|
2007-11-24 22:00:00 +01:00
|
|
|
|
|
|
|
// if origin is NULL, the sound will be dynamically sourced from the entity
|
2008-12-03 22:00:00 +01:00
|
|
|
#define S_StartStreaming if( se ) se->StartStreaming
|
|
|
|
#define S_StartSound( a,b,c,d,e,f,g ) if( se ) se->StartSound( a, b, c, d, e, f, g, true );
|
2009-01-05 22:00:00 +01:00
|
|
|
#define S_StartLocalSound( a,b,c,d ) if( se ) se->StartLocalSound( a, b, c, d )
|
2008-12-03 22:00:00 +01:00
|
|
|
#define S_StartBackgroundTrack if( se ) se->StartBackgroundTrack
|
|
|
|
#define S_StopBackgroundTrack if( se ) se->StopBackgroundTrack
|
|
|
|
#define S_RawSamples if( se ) se->StreamRawSamples
|
|
|
|
#define S_StopAllSounds if( se ) se->StopAllSounds
|
|
|
|
#define S_AddLoopingSound if( se ) se->AddLoopingSound
|
|
|
|
|
|
|
|
_inline sound_t S_RegisterSound( const char *name )
|
|
|
|
{
|
|
|
|
if( se )
|
|
|
|
return se->RegisterSound( name );
|
|
|
|
return 0;
|
|
|
|
}
|
2007-11-24 22:00:00 +01:00
|
|
|
|
|
|
|
// recompute the reletive volumes for all running sounds
|
|
|
|
// reletive to the given entityNum / orientation
|
2008-12-03 22:00:00 +01:00
|
|
|
#define S_Activate if( se ) se->Activate
|
|
|
|
#define S_Update if( se ) se->Frame
|
|
|
|
#define S_BeginRegistration if( se ) se->BeginRegistration
|
|
|
|
#define S_EndRegistration if( se ) se->EndRegistration
|
2007-11-24 22:00:00 +01:00
|
|
|
|
2007-06-21 22:00:00 +02:00
|
|
|
//
|
|
|
|
// cl_parse.c
|
|
|
|
//
|
2008-05-20 22:00:00 +02:00
|
|
|
void CL_ParseServerMessage( sizebuf_t *msg );
|
2008-12-03 22:00:00 +01:00
|
|
|
void CL_RunBackgroundTrack( void );
|
2008-08-02 22:00:00 +02:00
|
|
|
void CL_Download_f( void );
|
2007-06-21 22:00:00 +02:00
|
|
|
|
2008-07-04 22:00:00 +02:00
|
|
|
//
|
|
|
|
// cl_scrn.c
|
|
|
|
//
|
|
|
|
void SCR_Init( void );
|
|
|
|
void SCR_UpdateScreen( void );
|
|
|
|
void VID_Init( void );
|
2008-08-04 22:00:00 +02:00
|
|
|
void SCR_Shutdown( void );
|
2008-11-15 22:00:00 +01:00
|
|
|
void SCR_RegisterShaders( void );
|
2008-07-04 22:00:00 +02:00
|
|
|
void SCR_AdjustSize( float *x, float *y, float *w, float *h );
|
2008-11-09 22:00:00 +01:00
|
|
|
void SCR_DrawPic( float x, float y, float width, float height, shader_t shader );
|
2008-07-04 22:00:00 +02:00
|
|
|
void SCR_FillRect( float x, float y, float width, float height, const float *color );
|
|
|
|
void SCR_DrawSmallChar( int x, int y, int ch );
|
|
|
|
void SCR_DrawChar( int x, int y, float w, float h, int ch );
|
|
|
|
void SCR_DrawSmallStringExt( int x, int y, const char *string, float *setColor, bool forceColor );
|
|
|
|
void SCR_DrawStringExt( int x, int y, float w, float h, const char *string, float *setColor, bool forceColor );
|
|
|
|
void SCR_DrawBigString( int x, int y, const char *s, float alpha );
|
|
|
|
void SCR_DrawBigStringColor( int x, int y, const char *s, vec4_t color );
|
2009-09-01 22:00:00 +02:00
|
|
|
void SCR_RSpeeds( void );
|
2008-07-04 22:00:00 +02:00
|
|
|
void SCR_DrawFPS( void );
|
|
|
|
void SCR_DrawNet( 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 );
|
2009-01-22 22:00:00 +01:00
|
|
|
void V_ClearScene( void );
|
2007-11-06 22:00:00 +01:00
|
|
|
bool V_PreRender( void );
|
|
|
|
void V_PostRender( void );
|
2007-11-05 22:00:00 +01:00
|
|
|
void V_RenderView( void );
|
2008-06-28 22:00:00 +02:00
|
|
|
float V_CalcFov( float fov_x, float width, float height );
|
2007-06-21 22:00:00 +02:00
|
|
|
|
|
|
|
//
|
2008-12-25 22:00:00 +01:00
|
|
|
// cl_phys.c
|
2007-06-21 22:00:00 +02:00
|
|
|
//
|
|
|
|
void CL_InitPrediction (void);
|
|
|
|
void CL_PredictMove (void);
|
2009-01-11 22:00:00 +01:00
|
|
|
void CL_CheckPredictionError( void );
|
|
|
|
void CL_CheckVelocity( edict_t *ent );
|
2009-01-23 22:00:00 +01:00
|
|
|
bool CL_CheckWater( edict_t *ent );
|
2008-11-25 22:00:00 +01:00
|
|
|
int CL_PointContents( const vec3_t point );
|
2008-12-25 22:00:00 +01:00
|
|
|
int CL_ContentsMask( const edict_t *passedict );
|
|
|
|
trace_t CL_Trace( const vec3_t s1, const vec3_t m1, const vec3_t m2, const vec3_t s2, int type, edict_t *e, int mask );
|
2007-06-21 22:00:00 +02:00
|
|
|
|
2008-06-12 22:00:00 +02:00
|
|
|
//
|
|
|
|
// cl_ents.c
|
|
|
|
//
|
|
|
|
void CL_GetEntitySoundSpatialization( int ent, vec3_t origin, vec3_t velocity );
|
|
|
|
void CL_AddLoopingSounds( void );
|
|
|
|
|
2007-06-21 22:00:00 +02:00
|
|
|
//
|
|
|
|
// cl_fx.c
|
|
|
|
//
|
2008-11-27 22:00:00 +01:00
|
|
|
cdlight_t *CL_AllocDlight( int key );
|
|
|
|
void CL_AddParticles( void );
|
|
|
|
void CL_AddDecals( void );
|
2008-06-30 22:00:00 +02:00
|
|
|
void CL_ClearEffects( void );
|
2009-01-22 22:00:00 +01:00
|
|
|
void CL_TestLights( void );
|
|
|
|
void CL_TestEntities( void );
|
2009-01-03 22:00:00 +01:00
|
|
|
void CL_StudioEvent( dstudioevent_t *event, edict_t *ent );
|
|
|
|
edict_t *CL_GetEdictByIndex( int index );
|
|
|
|
edict_t *CL_GetLocalPlayer( void );
|
2009-09-03 22:00:00 +02:00
|
|
|
void CL_StudioFxTransform( edict_t *ent, float transform[4][4] );
|
2009-01-15 22:00:00 +01:00
|
|
|
bool pfnAddParticle( cparticle_t *src, HSPRITE shader, int flags );
|
|
|
|
void pfnAddDecal( float *org, float *dir, float *rgba, float rot, float rad, HSPRITE hSpr, int flags );
|
|
|
|
void pfnAddDLight( const float *org, const float *rgb, float radius, float decay, float time, int key );
|
2007-06-21 22:00:00 +02:00
|
|
|
|
|
|
|
//
|
|
|
|
// cl_pred.c
|
|
|
|
//
|
2007-11-04 22:00:00 +01:00
|
|
|
void CL_PredictMovement (void);
|
|
|
|
|
|
|
|
//
|
|
|
|
// cl_con.c
|
|
|
|
//
|
|
|
|
bool Con_Active( void );
|
|
|
|
void Con_CheckResize( void );
|
2007-11-14 22:00:00 +01:00
|
|
|
void Con_Print( const char *txt );
|
2007-11-04 22:00:00 +01:00
|
|
|
void Con_Init( void );
|
|
|
|
void Con_Clear_f( void );
|
|
|
|
void Con_ToggleConsole_f( void );
|
|
|
|
void Con_DrawNotify( void );
|
|
|
|
void Con_ClearNotify( void );
|
|
|
|
void Con_RunConsole( void );
|
|
|
|
void Con_DrawConsole( void );
|
|
|
|
void Con_PageUp( void );
|
|
|
|
void Con_PageDown( void );
|
|
|
|
void Con_Top( void );
|
|
|
|
void Con_Bottom( void );
|
|
|
|
void Con_Close( void );
|
|
|
|
|
2007-11-05 22:00:00 +01:00
|
|
|
extern bool chat_team;
|
|
|
|
extern bool anykeydown;
|
2007-11-04 22:00:00 +01:00
|
|
|
extern int g_console_field_width;
|
2007-11-05 22:00:00 +01:00
|
|
|
extern field_t historyEditLines[COMMAND_HISTORY];
|
|
|
|
extern field_t g_consoleField;
|
|
|
|
extern field_t chatField;
|
|
|
|
|
2008-06-28 22:00:00 +02:00
|
|
|
//
|
2008-08-05 22:00:00 +02:00
|
|
|
// cl_menu.c
|
2008-06-28 22:00:00 +02:00
|
|
|
//
|
|
|
|
extern bool ui_active;
|
|
|
|
|
|
|
|
void UI_Init( void );
|
|
|
|
void UI_DrawCredits( void );
|
|
|
|
void UI_KeyEvent( int key );
|
|
|
|
void UI_ShowMenu( void );
|
|
|
|
void UI_HideMenu( void );
|
|
|
|
void UI_Shutdown( void );
|
2009-01-25 22:00:00 +01:00
|
|
|
void UI_Restart( void );
|
2008-06-28 22:00:00 +02:00
|
|
|
void UI_Draw( void );
|
|
|
|
|
2007-11-05 22:00:00 +01:00
|
|
|
//
|
|
|
|
// cl_keys.c
|
|
|
|
//
|
|
|
|
void Field_Clear( field_t *edit );
|
|
|
|
void Field_CharEvent( field_t *edit, int ch );
|
|
|
|
void Field_KeyDownEvent( field_t *edit, int key );
|
|
|
|
void Field_Draw( field_t *edit, int x, int y, int width, bool showCursor );
|
|
|
|
void Field_BigDraw( field_t *edit, int x, int y, int width, bool showCursor );
|
|
|
|
|
|
|
|
bool Key_IsDown( int keynum );
|
|
|
|
char *Key_IsBind( int keynum );
|
2009-02-03 22:00:00 +01:00
|
|
|
void Key_Event( int key, bool down );
|
|
|
|
void Key_Init( void );
|
|
|
|
void Key_WriteBindings( file_t *f );
|
|
|
|
void Key_SetBinding( int keynum, char *binding );
|
|
|
|
void Key_ClearStates( void );
|
|
|
|
char *Key_KeynumToString( int keynum );
|
|
|
|
int Key_StringToKeynum( char *str );
|
2007-11-05 22:00:00 +01:00
|
|
|
int Key_GetKey( char *binding );
|
2008-08-05 22:00:00 +02:00
|
|
|
void Key_EnumCmds_f( void );
|
2007-11-04 22:00:00 +01:00
|
|
|
|
2007-11-06 22:00:00 +01:00
|
|
|
//
|
|
|
|
// cl_cin.c
|
|
|
|
//
|
2007-11-21 22:00:00 +01:00
|
|
|
bool SCR_PlayCinematic( char *name, int bits );
|
2007-11-06 22:00:00 +01:00
|
|
|
void SCR_DrawCinematic( void );
|
|
|
|
void SCR_RunCinematic( void );
|
|
|
|
void SCR_StopCinematic( void );
|
2007-11-21 22:00:00 +01:00
|
|
|
void SCR_ResetCinematic( void );
|
|
|
|
int SCR_GetCinematicState( 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
|