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

556 lines
16 KiB
C
Raw Normal View History

2009-11-23 22:00:00 +01:00
//=======================================================================
// Copyright XashXT Group 2009 <20>
// client.h -- primary header for client
//=======================================================================
2007-06-21 22:00:00 +02:00
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-07-18 22:00:00 +02:00
#include "gameui_api.h"
2010-08-07 22:00:00 +02:00
#include "cl_entity.h"
#include "com_model.h"
2010-08-12 22:00:00 +02:00
#include "cm_local.h"
#include "pm_defs.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
2007-06-21 22:00:00 +02:00
2010-08-07 22:00:00 +02:00
#define NUM_FOR_EDICT(e) ((int)((cl_entity_t *)(e) - clgame.entities))
2010-03-28 22:00:00 +02:00
#define EDICT_NUM( num ) CL_EDICT_NUM( num, __FILE__, __LINE__ )
2010-07-23 22:00:00 +02:00
#define cl_time() ( cl.time * 0.001f )
#define sv_time() ( cl.frame.servertime * 0.001f )
#define sv_frametime() ( cl.serverframetime * 0.001f )
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
{
2010-08-04 22:00:00 +02:00
bool valid; // cleared if delta parsing was invalid
int servertime;
int serverframe;
int deltaframe;
int num_entities;
int parse_entities; // non-masked index into cl_parse_entities array
clientdata_t cd; // current client data
2007-06-21 22:00:00 +02:00
} frame_t;
2010-06-20 22:00:00 +02:00
#define CMD_BACKUP 64 // allow a lot of command backups for very fast systems
2010-02-18 22:00:00 +01:00
#define CMD_MASK (CMD_BACKUP - 1)
2007-06-21 22:00:00 +02:00
2010-04-02 22:00:00 +02:00
#define CL_UPDATE_MASK (CL_UPDATE_BACKUP - 1)
extern int CL_UPDATE_BACKUP;
// the cl_parse_entities must be large enough to hold CL_UPDATE_BACKUP frames of
2009-09-28 22:00:00 +02:00
// entities, so that when a delta compressed message arives from the server
// it can be un-deltad from the original
2010-07-20 22:00:00 +02:00
#define MAX_PARSE_ENTITIES 2048
2009-09-28 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
2009-09-28 22:00:00 +02:00
bool force_refdef; // vid has changed, so we can't use a paused refdef
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
2009-09-16 22:00:00 +02:00
usercmd_t cmds[CMD_BACKUP]; // each mesage will send several old cmds
2008-12-26 22:00:00 +01:00
frame_t frame; // received from server
2009-09-16 22:00:00 +02:00
frame_t *oldframe; // previous frame to lerping from
int surpressCount; // number of messages rate supressed
2010-04-02 22:00:00 +02:00
frame_t *frames; // alloced on svc_serverdata
2008-07-06 22:00:00 +02:00
2010-07-23 22:00:00 +02:00
int time; // this is the time value that the client
// is rendering at. always <= cls.realtime
2010-06-20 22:00:00 +02:00
// a lerp point for other data
int render_flags; // clearing at end of frame
float lerpFrac; // interpolation value
ref_params_t refdef; // shared refdef
2007-06-21 22:00:00 +02:00
2009-11-23 22:00:00 +01:00
cinematics_t *cin;
2010-03-30 22:00:00 +02:00
char serverinfo[MAX_INFO_STRING];
2009-12-04 22:00:00 +01:00
player_info_t players[MAX_CLIENTS];
2009-12-02 22:00:00 +01:00
event_state_t events;
2009-09-20 22:00:00 +02:00
// predicting stuff
2010-08-04 22:00:00 +02:00
uint random_seed; // for predictable random values
2010-07-23 22:00:00 +02:00
vec3_t predicted_origins[CMD_BACKUP]; // for debug comparing against server
vec3_t predicted_origin; // generated by CL_PredictMovement
2009-12-05 22:00:00 +01:00
vec3_t predicted_viewofs;
2009-09-20 22:00:00 +02:00
vec3_t predicted_angles;
2009-12-05 22:00:00 +01:00
vec3_t predicted_velocity;
2009-09-20 22:00:00 +02:00
vec3_t prediction_error;
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-06-24 22:00:00 +02:00
int servercount; // server identification for prespawns
2010-06-22 22:00:00 +02:00
int movemessages;
2010-07-23 22:00:00 +02:00
int serverframetime; // server frametime
2008-10-27 22:00:00 +01:00
char configstrings[MAX_CONFIGSTRINGS][CS_SIZE];
2010-03-28 22:00:00 +02:00
entity_state_t entity_curstates[MAX_PARSE_ENTITIES]; // FIXME: this is must match with max_edicts ?
2009-09-28 22:00:00 +02:00
2007-06-21 22:00:00 +02:00
// locally derived information from server state
2009-10-28 22:00:00 +01:00
model_t models[MAX_MODELS];
2007-11-01 22:00:00 +01:00
sound_t sound_precache[MAX_SOUNDS];
2010-06-29 22:00:00 +02:00
shader_t decal_shaders[MAX_DECALNAMES];
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
{
2008-07-12 22:00:00 +02:00
ca_uninitialized = 0,
2009-09-16 22:00:00 +02:00
ca_disconnected, // not talking to a server
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;
2010-07-20 22:00:00 +02:00
typedef enum
{
key_console = 0,
key_game,
key_menu
} keydest_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,
2009-09-16 22:00:00 +02:00
} dltype_t; // download type
2007-06-21 22:00:00 +02:00
2009-09-23 22:00:00 +02:00
typedef enum
{
scrshot_inactive,
scrshot_plaque, // levelshot
scrshot_savegame, // saveshot
2010-03-26 22:00:00 +01:00
scrshot_demoshot, // for demos preview
scrshot_envshot, // cubemap view
scrshot_skyshot // skybox view
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
2009-12-02 22:00:00 +01:00
typedef struct
{
char name[CS_SIZE];
word index; // event index
pfnEventHook func; // user-defined function
} user_event_t;
2010-07-17 22:00:00 +02:00
typedef struct
{
HSPRITE hFontTexture; // handle to texture shader
wrect_t fontRc[256]; // rectangles
2010-07-20 22:00:00 +02:00
bool valid; // 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
HSPRITE hSprite;
// scissor test
int scissor_x;
int scissor_y;
int scissor_width;
int scissor_height;
bool scissor_test;
2010-07-20 22:00:00 +02:00
// holds text color
rgba_t textColor;
2009-12-03 22:00:00 +01:00
// crosshair members
HSPRITE hCrosshair;
wrect_t rcCrosshair;
rgba_t rgbaCrosshair;
} draw_stuff_t;
2010-07-19 22:00:00 +02:00
typedef struct
{
// centerprint stuff
int lines;
int y, time;
char message[2048];
int totalWidth;
int totalHeight;
} center_print_t;
2008-12-25 22:00:00 +01:00
typedef struct
{
2009-06-24 22:00:00 +02:00
void *hInstance; // pointer to client.dll
HUD_FUNCTIONS dllFuncs; // dll exported funcs
2009-11-27 22:00:00 +01:00
byte *mempool; // client edicts pool
2009-06-24 22:00:00 +02:00
byte *private; // client.dll private 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
2009-06-24 22:00:00 +02:00
2010-08-20 22:00:00 +02:00
int numEntities; // actual ents count
int maxEntities;
2009-11-26 22:00:00 +01:00
// movement values from server
movevars_t movevars;
movevars_t oldmovevars;
playermove_t *pmove; // pmove state
2010-08-19 22:00:00 +02:00
int trace_hull; // used by PM_SetTraceHull
int oldcount; // used by PM_Push\Pop state
2010-08-16 22:00:00 +02:00
vec3_t player_mins[4]; // 4 hulls allowed
vec3_t player_maxs[4]; // 4 hulls allowed
2010-06-22 22:00:00 +02:00
cl_user_message_t msg[MAX_USER_MESSAGES]; // keep static to avoid fragment memory
user_event_t *events[MAX_EVENTS];
2009-09-28 22:00:00 +02:00
2009-12-03 22:00:00 +01:00
draw_stuff_t ds; // draw2d stuff (hud, weaponmenu etc)
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
2010-07-13 22:00:00 +02:00
rgb_t palette[256]; // Quake1 palette used for particle colors
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;
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
2010-07-18 22:00:00 +02:00
draw_stuff_t ds; // draw2d stuff (hud, weaponmenu etc)
GAMEINFO gameInfo; // current gameInfo
GAMEINFO *modsInfo[MAX_MODS]; // simplified gameInfo for GameUI
ui_globalvars_t *globals;
} gameui_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;
2010-07-23 22:00:00 +02:00
bool changelevel; // during changelevel
2008-08-04 22:00:00 +02:00
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;
2010-07-23 22:00:00 +02:00
float frametime; // seconds since last frame
int realtime;
2009-06-24 22:00:00 +02:00
int quakePort; // a 16 bit value that allows quake servers
// to work around address translating routers
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
2010-07-23 22:00:00 +02:00
int 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
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
// internal shaders
2009-10-18 22:00:00 +02:00
shader_t fillShader; // used for emulate FillRGBA to avoid wrong draw-sort
2010-07-08 22:00:00 +02:00
shader_t pauseIcon; // draw 'paused' when game in-pause
shader_t loadingBar; // 'loading' progress bar
2010-07-20 22:00:00 +02:00
cl_font_t creditsFont; // shared creditsfont
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
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
2009-09-23 22:00:00 +02:00
string shotname;
2009-10-13 22:00:00 +02:00
// demo loop control
int demonum; // -1 = don't play demos
string demos[MAX_DEMOS]; // when not playing
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;
} client_static_t;
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;
2010-07-18 22:00:00 +02:00
extern gameui_static_t gameui;
2010-07-20 22:00:00 +02:00
extern render_exp_t *re;
2009-12-20 22:00:00 +01:00
2007-06-21 22:00:00 +02:00
//
// cvars
//
2009-09-17 22:00:00 +02:00
extern cvar_t *cl_predict;
2010-06-20 22:00:00 +02:00
extern cvar_t *cl_smooth;
2009-09-17 22:00:00 +02:00
extern cvar_t *cl_showfps;
extern cvar_t *cl_shownet;
extern cvar_t *cl_envshot_size;
2009-12-05 22:00:00 +01:00
extern cvar_t *cl_nodelta;
2009-12-03 22:00:00 +01:00
extern cvar_t *cl_crosshair;
2009-09-17 22:00:00 +02:00
extern cvar_t *cl_showmiss;
extern cvar_t *cl_testlights;
2010-08-19 22:00:00 +02:00
extern cvar_t *cl_solid_players;
2010-08-06 22:00:00 +02:00
extern cvar_t *cl_idealpitchscale;
2010-07-17 22:00:00 +02:00
extern cvar_t *cl_allow_levelshots;
2009-09-17 22:00:00 +02:00
extern cvar_t *cl_levelshot_name;
extern cvar_t *scr_centertime;
2009-11-02 22:00:00 +01:00
extern cvar_t *scr_download;
extern cvar_t *scr_loading;
2009-11-23 22:00:00 +01:00
extern cvar_t *userinfo;
2007-06-21 22:00:00 +02:00
//=============================================================================
2008-07-11 22:00:00 +02:00
2008-08-02 22:00:00 +02:00
bool CL_CheckOrDownloadFile( const char *filename );
2010-08-06 22:00:00 +02:00
void CL_ParseConfigString( sizebuf_t *msg );
2010-03-15 22:00:00 +01:00
void CL_SetLightstyle( int i );
void CL_RunLightStyles( void );
2007-06-21 22:00:00 +02:00
2010-03-15 22:00:00 +01:00
void CL_AddEntities( void );
void CL_AddDLights( void );
void CL_AddLightStyles( void );
2007-06-21 22:00:00 +02:00
//=================================================
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
//
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 );
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 );
2010-01-07 22:00:00 +01:00
void CL_DemoShot_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
//
// cl_main
//
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 );
void CL_GetChallengePacket( void );
void CL_PingServers_f( void );
void CL_RequestNextDownload( void );
2009-12-05 22:00:00 +01:00
void CL_ClearState( void );
2007-06-21 22:00:00 +02:00
//
2008-07-11 22:00:00 +02:00
// cl_input.c
2007-06-21 22:00:00 +02:00
//
2009-12-05 22:00:00 +01:00
void CL_MouseEvent( int mx, int my );
void CL_SendCmd( void );
2008-07-11 22:00:00 +02:00
2007-06-21 22:00:00 +02:00
//
// cl_demo.c
//
2008-07-12 22:00:00 +02:00
void CL_DrawDemoRecording( void );
2010-08-06 22:00:00 +02:00
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 );
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
2008-12-25 22:00:00 +01:00
//
// cl_game.c
//
void CL_UnloadProgs( void );
bool 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 );
2010-07-20 22:00:00 +02:00
void CL_DrawHUD( int state );
void CL_InitEdicts( void );
void CL_FreeEdicts( void );
void CL_InitWorld( void );
2010-08-07 22:00:00 +02:00
void CL_InitEntity( cl_entity_t *pEdict );
void CL_FreeEntity( cl_entity_t *pEdict );
2010-07-19 22:00:00 +02:00
void CL_CenterPrint( const char *text, float y );
2009-12-02 22:00:00 +01:00
void CL_SetEventIndex( const char *szEvName, int ev_index );
2010-03-28 22:00:00 +02:00
void CL_TextMessageParse( byte *pMemFile, int fileSize );
2010-07-01 22:00:00 +02:00
int pfnDecalIndexFromName( const char *szDecalName );
2010-07-18 22:00:00 +02:00
void *VGui_GetPanel( void );
void VGui_ViewportPaintBackground( int extents[4] );
2010-03-06 22:00:00 +01:00
2010-08-07 22:00:00 +02:00
_inline cl_entity_t *CL_EDICT_NUM( int n, const char *file, const int line )
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;
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-06-21 22:00:00 +02:00
//
// cl_parse.c
//
2010-08-16 22:00:00 +02:00
extern const char *svc_strings[256];
2010-08-06 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
//
2008-11-15 22:00:00 +01:00
void SCR_RegisterShaders( 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 );
2008-07-04 22:00:00 +02:00
void SCR_DrawFPS( 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 );
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 );
2010-07-20 22:00:00 +02:00
void CL_PredictMovement( void );
2009-01-11 22:00:00 +01:00
void CL_CheckPredictionError( void );
2010-03-14 22:00:00 +01:00
bool CL_IsPredicted( 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
//
2010-08-06 22:00:00 +02:00
void CL_ParseFrame( sizebuf_t *msg );
2010-06-27 22:00:00 +02:00
void CL_GetEntitySpatialization( int ent, vec3_t origin, vec3_t velocity );
2008-06-12 22:00:00 +02:00
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-08-20 22:00:00 +02:00
int CL_AddEntity( int entityType, cl_entity_t *pEnt, shader_t customShader );
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 );
2009-01-22 22:00:00 +01:00
void CL_TestLights( void );
2010-08-20 22:00:00 +02:00
struct dlight_s *CL_AllocDlight( int key );
struct dlight_s *CL_AllocElight( int key );
2010-03-15 22:00:00 +01:00
void CL_LightForPoint( const vec3_t point, vec3_t ambientLight );
2010-06-30 22:00:00 +02:00
void CL_DecalShoot( HSPRITE hDecal, int entityIndex, int modelIndex, float *pos, int flags );
void CL_PlayerDecal( HSPRITE hDecal, int entityIndex, float *pos, byte *color );
2009-12-02 22:00:00 +01:00
void CL_QueueEvent( int flags, int index, float delay, event_args_t *args );
2010-08-16 22:00:00 +02:00
void CL_PlaybackEvent( int flags, const cl_entity_t *pInvoker, word eventindex, float delay, float *origin,
float *angles, float fparam1, float fparam2, int iparam1, int iparam2, int bparam1, int bparam2 );
2009-12-02 22:00:00 +01:00
word CL_PrecacheEvent( const char *name );
void CL_ResetEvent( event_info_t *ei );
void CL_FireEvents( 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
//
2010-06-23 22:00:00 +02:00
bool Con_Visible( void );
2007-11-04 22:00:00 +01:00
void Con_Init( void );
2010-07-19 22:00:00 +02:00
void Con_VidInit( void );
2007-11-04 22:00:00 +01:00
void Con_ToggleConsole_f( void );
void Con_ClearNotify( void );
void Con_RunConsole( void );
void Con_DrawConsole( 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 );
void Con_DefaultColor( int r, int g, int b );
2010-07-19 22:00:00 +02:00
void Con_CharEvent( int key );
void Key_Console( int key );
2010-07-20 22:00:00 +02:00
void Con_Close( void );
2007-11-05 22:00:00 +01:00
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
//
2010-07-18 22:00:00 +02:00
void UI_UnloadProgs( void );
bool UI_LoadProgs( const char *name );
void UI_UpdateMenu( float realtime );
2010-01-02 22:00:00 +01:00
void UI_KeyEvent( int key, bool down );
2009-09-10 22:00:00 +02:00
void UI_MouseMove( int x, int y );
2010-07-18 22:00:00 +02:00
void UI_SetActiveMenu( bool 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 );
void UI_ShowCursor( bool show );
2009-09-11 22:00:00 +02:00
bool UI_CreditsActive( void );
2010-02-16 22:00:00 +01:00
void UI_CharEvent( int key );
2010-01-01 22:00:00 +01:00
bool UI_MouseInRect( void );
2009-09-10 22:00:00 +02:00
bool UI_IsVisible( void );
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 );
bool SCR_PlayCinematic( const char *name );
bool SCR_DrawCinematic( 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
2010-08-18 22:00:00 +02:00
//
// cl_world.c
//
2010-08-19 22:00:00 +02:00
extern areanode_t cl_areanodes[];
2010-08-18 22:00:00 +02:00
void CL_ClearWorld( void );
void CL_UnlinkEdict( cl_entity_t *ent );
void CL_LinkEdict( cl_entity_t *ent );
int CL_AreaEdicts( const vec3_t mins, const vec3_t maxs, cl_entity_t **list, int maxcount, int areatype );
int CL_TruePointContents( const vec3_t p );
int CL_PointContents( const vec3_t p );
2007-11-04 22:00:00 +01:00
#endif//CLIENT_H