2001-02-19 21:15:25 +00:00
|
|
|
/*
|
|
|
|
client.h
|
|
|
|
|
|
|
|
Client definitions
|
|
|
|
|
|
|
|
Copyright (C) 1996-1997 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:
|
|
|
|
|
|
|
|
Free Software Foundation, Inc.
|
|
|
|
59 Temple Place - Suite 330
|
|
|
|
Boston, MA 02111-1307, USA
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _CLIENT_H
|
|
|
|
#define _CLIENT_H
|
|
|
|
|
2001-03-27 20:33:07 +00:00
|
|
|
#include "QF/info.h"
|
2002-08-27 07:16:28 +00:00
|
|
|
#include "QF/quakefs.h"
|
2001-04-15 04:18:22 +00:00
|
|
|
#include "QF/vid.h"
|
2001-03-27 20:33:07 +00:00
|
|
|
#include "QF/zone.h"
|
2001-02-19 21:15:25 +00:00
|
|
|
|
2012-02-14 10:47:02 +00:00
|
|
|
#include "QF/plugin/vid_render.h"
|
2021-07-24 05:19:52 +00:00
|
|
|
#include "QF/scene/entity.h"
|
2012-02-14 10:47:02 +00:00
|
|
|
|
2022-02-22 06:23:09 +00:00
|
|
|
#include "client/chase.h"
|
2012-06-28 00:33:23 +00:00
|
|
|
#include "client/entities.h"
|
2022-02-22 06:23:09 +00:00
|
|
|
#include "client/input.h"
|
2013-01-31 08:18:29 +00:00
|
|
|
#include "client/state.h"
|
2021-03-19 11:18:45 +00:00
|
|
|
#include "client/view.h"
|
2012-06-28 00:33:23 +00:00
|
|
|
|
2003-02-11 22:48:57 +00:00
|
|
|
#include "netchan.h"
|
2010-08-24 00:53:54 +00:00
|
|
|
#include "qw/bothdefs.h"
|
2004-02-21 02:31:22 +00:00
|
|
|
#include "qw/protocol.h"
|
2001-05-09 05:41:34 +00:00
|
|
|
|
2001-05-18 18:33:37 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
player_state_t is the information needed by a player entity
|
|
|
|
to do move prediction and to generate a drawable entity
|
|
|
|
*/
|
2001-02-19 21:15:25 +00:00
|
|
|
typedef struct player_state_s {
|
2012-06-26 06:03:04 +00:00
|
|
|
int messagenum; // all player's won't be updated each frame
|
2001-02-19 21:15:25 +00:00
|
|
|
|
2012-06-26 06:03:04 +00:00
|
|
|
double state_time; // not the same as the packet time,
|
2001-02-19 21:15:25 +00:00
|
|
|
// because player commands come asyncronously
|
2012-06-26 06:03:04 +00:00
|
|
|
vec3_t viewangles; // only for demos, not from server
|
2001-02-19 21:15:25 +00:00
|
|
|
|
2005-04-30 03:59:23 +00:00
|
|
|
plent_state_t pls;
|
2001-02-19 21:15:25 +00:00
|
|
|
|
2012-06-26 06:03:04 +00:00
|
|
|
float waterjumptime;
|
|
|
|
int onground; // -1 = in air, else pmove entity number
|
|
|
|
int oldbuttons;
|
|
|
|
int oldonground;
|
2002-06-18 21:41:24 +00:00
|
|
|
|
2001-02-19 21:15:25 +00:00
|
|
|
} player_state_t;
|
|
|
|
|
2012-06-26 06:03:04 +00:00
|
|
|
typedef struct {
|
2001-02-19 21:15:25 +00:00
|
|
|
// generated on client side
|
2012-06-26 06:03:04 +00:00
|
|
|
usercmd_t cmd; // cmd that generated the frame
|
|
|
|
double senttime; // time cmd was sent off
|
|
|
|
int delta_sequence; // sequence number to delta from, -1 = full update
|
2001-02-19 21:15:25 +00:00
|
|
|
|
|
|
|
// received from server
|
2012-06-26 06:03:04 +00:00
|
|
|
double receivedtime; // time message was received, or -1
|
|
|
|
player_state_t playerstate[MAX_CLIENTS]; // message received that
|
2001-05-18 18:33:37 +00:00
|
|
|
// reflects performing the
|
|
|
|
// usercmd
|
2012-06-26 06:03:04 +00:00
|
|
|
packet_entities_t packet_entities;
|
|
|
|
qboolean invalid; // true if the packet_entities delta was invalid
|
2001-02-19 21:15:25 +00:00
|
|
|
} frame_t;
|
|
|
|
|
|
|
|
#define MAX_DEMOS 8
|
|
|
|
#define MAX_DEMONAME 16
|
2001-05-18 18:33:37 +00:00
|
|
|
|
2001-02-19 21:15:25 +00:00
|
|
|
typedef enum {
|
2001-05-18 18:33:37 +00:00
|
|
|
ca_disconnected, // full screen console with no connection
|
|
|
|
ca_demostart, // starting up a demo
|
2012-06-26 06:03:04 +00:00
|
|
|
ca_connected, // talking to a server
|
2001-05-18 18:33:37 +00:00
|
|
|
ca_onserver, // processing data lists, donwloading, etc
|
2012-06-26 06:03:04 +00:00
|
|
|
ca_active, // everything is in, so frames can be rendered
|
2001-02-19 21:15:25 +00:00
|
|
|
} cactive_t;
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
dl_none,
|
|
|
|
dl_model,
|
|
|
|
dl_sound,
|
|
|
|
dl_skin,
|
|
|
|
dl_single
|
|
|
|
} dltype_t; // download type
|
|
|
|
|
2001-05-18 18:33:37 +00:00
|
|
|
/*
|
|
|
|
the client_static_t structure is persistant through an arbitrary number
|
|
|
|
of server connections
|
|
|
|
*/
|
2012-06-26 00:05:02 +00:00
|
|
|
typedef struct {
|
2001-02-19 21:15:25 +00:00
|
|
|
// connection information
|
2012-06-26 00:05:02 +00:00
|
|
|
cactive_t state;
|
2012-05-21 23:23:22 +00:00
|
|
|
|
2001-02-19 21:15:25 +00:00
|
|
|
// network stuff
|
2012-06-26 00:05:02 +00:00
|
|
|
netchan_t netchan;
|
|
|
|
int qport;
|
|
|
|
int challenge;
|
|
|
|
float latency; // rolling average
|
2010-08-24 07:20:07 +00:00
|
|
|
struct dstring_s *servername; // name of server from original connect
|
2012-06-26 00:05:02 +00:00
|
|
|
netadr_t server_addr; // address of server
|
2001-02-19 21:15:25 +00:00
|
|
|
|
2012-05-24 11:32:41 +00:00
|
|
|
// private userinfo for sending to masterless servers
|
|
|
|
struct info_s *userinfo;
|
2012-06-29 05:40:57 +00:00
|
|
|
int chat;
|
2001-02-19 21:15:25 +00:00
|
|
|
|
2001-05-18 18:33:37 +00:00
|
|
|
// file transfer from server
|
2012-06-26 00:05:02 +00:00
|
|
|
QFile *download;
|
2007-03-20 14:16:43 +00:00
|
|
|
struct dstring_s *downloadtempname;
|
|
|
|
struct dstring_s *downloadname;
|
|
|
|
struct dstring_s *downloadurl;
|
2012-06-26 00:05:02 +00:00
|
|
|
int downloadnumber;
|
|
|
|
dltype_t downloadtype;
|
|
|
|
int downloadpercent;
|
2001-02-19 21:15:25 +00:00
|
|
|
|
|
|
|
// demo loop control
|
2012-06-26 00:05:02 +00:00
|
|
|
int demonum; // -1 = don't play demos
|
|
|
|
char demos[MAX_DEMOS][MAX_DEMONAME]; // when not playing
|
|
|
|
|
|
|
|
QFile *demofile;
|
|
|
|
qboolean demorecording;
|
2022-03-31 15:58:14 +00:00
|
|
|
int demo_capture;
|
2012-06-26 00:05:02 +00:00
|
|
|
qboolean demoplayback;
|
|
|
|
qboolean demoplayback2;
|
|
|
|
qboolean findtrack;
|
|
|
|
int lastto;
|
|
|
|
int lasttype;
|
|
|
|
int prevtime;
|
|
|
|
double basetime;
|
|
|
|
qboolean timedemo;
|
2013-02-27 05:32:29 +00:00
|
|
|
double td_lastframe; // to meter out one message a frame
|
2012-06-26 00:05:02 +00:00
|
|
|
int td_startframe; // host_framecount at start
|
2013-02-27 05:32:29 +00:00
|
|
|
double td_starttime; // realtime at second frame of timedemo
|
2001-02-19 21:15:25 +00:00
|
|
|
} client_static_t;
|
|
|
|
|
|
|
|
extern client_static_t cls;
|
|
|
|
|
2012-06-26 00:05:02 +00:00
|
|
|
#define FPD_NO_MACROS 0x0001 // Many clients ignore this, and it isn't used, but let's honor it
|
|
|
|
#define FPD_NO_TIMERS 0x0002 // We never allow timers anyway
|
|
|
|
#define FPD_NO_STRIGGER 0x0004 // Don't have soundtrigger yet, but this disables it
|
|
|
|
#define FPD_HIDE_PERCENTE 0x0020 // Ditto
|
|
|
|
#define FPD_HIDE_POINT 0x0080 // Can ignore if we do visibility checking for point
|
|
|
|
#define FPD_NO_TEAMSKIN 0x0100 // Disable skin force
|
|
|
|
#define FPD_NO_TEAMCOLOR 0x0200 // Disable color force
|
|
|
|
#define FPD_HIDE_ITEM 0x0400 // No idea what this does
|
|
|
|
#define FPD_LIMIT_PITCH 0x4000 // Limit pitchspeed
|
|
|
|
#define FPD_LIMIT_YAW 0x8000 // Limit yawspeed
|
2004-07-11 01:41:01 +00:00
|
|
|
|
2012-06-26 00:05:02 +00:00
|
|
|
#define FPD_DEFAULT (FPD_HIDE_PERCENTE | FPD_NO_TEAMSKIN)
|
2004-07-11 01:41:01 +00:00
|
|
|
|
2012-05-21 23:23:22 +00:00
|
|
|
// These limits prevent a usable RJ script, requiring > 0.1 sec of turning time.
|
2004-07-11 01:41:01 +00:00
|
|
|
#define FPD_MAXPITCH 1000
|
2012-06-26 00:05:02 +00:00
|
|
|
#define FPD_MAXYAW 2000
|
2004-07-11 01:41:01 +00:00
|
|
|
|
|
|
|
// Default fbskins value. This should really be different for different gamedirs, but eh
|
|
|
|
#define FBSKINS_DEFAULT 0.0
|
|
|
|
|
2001-05-18 18:33:37 +00:00
|
|
|
/*
|
|
|
|
the client_state_t structure is wiped completely at every server signon
|
|
|
|
*/
|
2013-02-02 09:01:37 +00:00
|
|
|
typedef struct client_state_s {
|
2012-06-26 00:05:02 +00:00
|
|
|
int movemessages; // Since connecting to this server throw out
|
2012-05-30 23:14:05 +00:00
|
|
|
// the first couple, so the player doesn't
|
|
|
|
// accidentally do something the first frame
|
|
|
|
// sentcmds[cl.netchan.outgoing_sequence & UPDATE_MASK] = cmd
|
2012-06-26 00:05:02 +00:00
|
|
|
frame_t frames[UPDATE_BACKUP];
|
2012-07-05 10:06:35 +00:00
|
|
|
int link_sequence;
|
|
|
|
int prev_sequence;
|
2001-02-19 21:15:25 +00:00
|
|
|
|
|
|
|
// information for local display
|
2013-02-02 09:01:37 +00:00
|
|
|
int stats[MAX_CL_STATS]; // Health, etc
|
2012-06-26 00:05:02 +00:00
|
|
|
float item_gettime[32]; // cl.time of aquiring item, for blinking
|
|
|
|
float faceanimtime; // Use anim frame if cl.time < this
|
2001-02-19 21:15:25 +00:00
|
|
|
|
|
|
|
// the client simulates or interpolates movement to get these values
|
2012-06-26 00:05:02 +00:00
|
|
|
double time; // this is the time value that the client
|
2001-02-23 05:44:57 +00:00
|
|
|
// is rendering at. always <= realtime
|
2021-03-19 16:48:26 +00:00
|
|
|
// the client maintains its own idea of view angles, which are sent to the
|
|
|
|
// server each frame. And reset only at level change and teleport times
|
2021-03-19 11:18:45 +00:00
|
|
|
viewstate_t viewstate;
|
2022-02-22 06:23:09 +00:00
|
|
|
movestate_t movestate;
|
|
|
|
chasestate_t chasestate;
|
2012-06-26 00:05:02 +00:00
|
|
|
|
|
|
|
qboolean paused; // Sent over by server
|
2013-02-02 09:01:37 +00:00
|
|
|
float crouch; // Local amount for smoothing stepups
|
|
|
|
qboolean inwater;
|
2001-02-19 21:15:25 +00:00
|
|
|
|
2013-02-02 09:01:37 +00:00
|
|
|
int intermission; // Don't change view angle, full screen, etc
|
|
|
|
int completed_time; // Latched from time at intermission start
|
2012-06-26 00:05:02 +00:00
|
|
|
|
|
|
|
int servercount; // server identification for prespawns
|
|
|
|
struct info_s *serverinfo;
|
|
|
|
int parsecount; // server message counter
|
|
|
|
int validsequence; // this is the sequence number of the last good
|
2012-05-30 23:14:05 +00:00
|
|
|
// packetentity_t we got. If this is 0, we
|
|
|
|
// can't render a frame yet
|
2001-02-19 21:15:25 +00:00
|
|
|
|
2012-06-26 00:05:02 +00:00
|
|
|
double last_ping_request; // while showing scoreboard
|
2012-05-21 23:23:22 +00:00
|
|
|
|
2001-05-18 18:33:37 +00:00
|
|
|
/* information that is static for the entire time connected to a server */
|
|
|
|
|
2012-06-26 00:05:02 +00:00
|
|
|
char model_name[MAX_MODELS][MAX_QPATH];
|
|
|
|
char sound_name[MAX_SOUNDS][MAX_QPATH];
|
2001-02-19 21:15:25 +00:00
|
|
|
|
2012-06-26 00:05:02 +00:00
|
|
|
struct sfx_s *sound_precache[MAX_SOUNDS];
|
2012-01-09 07:22:39 +00:00
|
|
|
int nummodels;
|
|
|
|
int numsounds;
|
2001-02-19 21:15:25 +00:00
|
|
|
|
2012-06-26 00:05:02 +00:00
|
|
|
char levelname[40]; // for display on solo scoreboard
|
|
|
|
int spectator;
|
|
|
|
int playernum;
|
2013-02-02 09:01:37 +00:00
|
|
|
int viewentity; // cl_entitites[cl.viewentity] = player
|
2013-01-31 08:19:05 +00:00
|
|
|
unsigned protocol;
|
2012-06-26 00:05:02 +00:00
|
|
|
float stdver;
|
2013-01-31 08:19:05 +00:00
|
|
|
int gametype;
|
2012-05-31 23:19:22 +00:00
|
|
|
int maxclients;
|
2012-06-26 00:05:02 +00:00
|
|
|
// serverinfo mirrors
|
|
|
|
int sv_cshifts;
|
|
|
|
int no_pogo_stick;
|
|
|
|
int teamplay;
|
|
|
|
int fpd;
|
|
|
|
int fbskins;
|
2001-10-01 01:51:36 +00:00
|
|
|
|
2001-02-19 21:15:25 +00:00
|
|
|
// refresh related state
|
2013-02-02 09:01:37 +00:00
|
|
|
int num_entities; // held in cl_entities array
|
2001-02-19 21:15:25 +00:00
|
|
|
|
2012-06-26 00:05:02 +00:00
|
|
|
int cdtrack; // cd audio
|
2001-02-19 21:15:25 +00:00
|
|
|
|
|
|
|
// all player information
|
2013-02-02 08:32:46 +00:00
|
|
|
player_info_t *players;
|
2012-02-14 10:47:02 +00:00
|
|
|
|
2012-06-26 00:05:02 +00:00
|
|
|
lightstyle_t lightstyle[MAX_LIGHTSTYLES];
|
2001-02-19 21:15:25 +00:00
|
|
|
} client_state_t;
|
|
|
|
|
|
|
|
|
2001-05-18 18:33:37 +00:00
|
|
|
/*
|
|
|
|
cvars
|
|
|
|
*/
|
[cvar] Make cvars properly typed
This is an extremely extensive patch as it hits every cvar, and every
usage of the cvars. Cvars no longer store the value they control,
instead, they use a cexpr value object to reference the value and
specify the value's type (currently, a null type is used for strings).
Non-string cvars are passed through cexpr, allowing expressions in the
cvars' settings. Also, cvars have returned to an enhanced version of the
original (id quake) registration scheme.
As a minor benefit, relevant code having direct access to the
cvar-controlled variables is probably a slight optimization as it
removed a pointer dereference, and the variables can be located for data
locality.
The static cvar descriptors are made private as an additional safety
layer, though there's nothing stopping external modification via
Cvar_FindVar (which is needed for adding listeners).
While not used yet (partly due to working out the design), cvars can
have a validation function.
Registering a cvar allows a primary listener (and its data) to be
specified: it will always be called first when the cvar is modified. The
combination of proper listeners and direct access to the controlled
variable greatly simplifies the more complex cvar interactions as much
less null checking is required, and there's no need for one cvar's
callback to call another's.
nq-x11 is known to work at least well enough for the demos. More testing
will come.
2022-04-23 03:22:45 +00:00
|
|
|
extern int cl_netgraph;
|
|
|
|
extern int cl_netgraph_height;
|
|
|
|
extern float cl_netgraph_alpha;
|
|
|
|
extern int cl_netgraph_box;
|
2021-07-11 01:59:27 +00:00
|
|
|
|
[cvar] Make cvars properly typed
This is an extremely extensive patch as it hits every cvar, and every
usage of the cvars. Cvars no longer store the value they control,
instead, they use a cexpr value object to reference the value and
specify the value's type (currently, a null type is used for strings).
Non-string cvars are passed through cexpr, allowing expressions in the
cvars' settings. Also, cvars have returned to an enhanced version of the
original (id quake) registration scheme.
As a minor benefit, relevant code having direct access to the
cvar-controlled variables is probably a slight optimization as it
removed a pointer dereference, and the variables can be located for data
locality.
The static cvar descriptors are made private as an additional safety
layer, though there's nothing stopping external modification via
Cvar_FindVar (which is needed for adding listeners).
While not used yet (partly due to working out the design), cvars can
have a validation function.
Registering a cvar allows a primary listener (and its data) to be
specified: it will always be called first when the cvar is modified. The
combination of proper listeners and direct access to the controlled
variable greatly simplifies the more complex cvar interactions as much
less null checking is required, and there's no need for one cvar's
callback to call another's.
nq-x11 is known to work at least well enough for the demos. More testing
will come.
2022-04-23 03:22:45 +00:00
|
|
|
extern int cl_draw_locs;
|
|
|
|
extern int cl_shownet;
|
2001-02-19 21:15:25 +00:00
|
|
|
|
[cvar] Make cvars properly typed
This is an extremely extensive patch as it hits every cvar, and every
usage of the cvars. Cvars no longer store the value they control,
instead, they use a cexpr value object to reference the value and
specify the value's type (currently, a null type is used for strings).
Non-string cvars are passed through cexpr, allowing expressions in the
cvars' settings. Also, cvars have returned to an enhanced version of the
original (id quake) registration scheme.
As a minor benefit, relevant code having direct access to the
cvar-controlled variables is probably a slight optimization as it
removed a pointer dereference, and the variables can be located for data
locality.
The static cvar descriptors are made private as an additional safety
layer, though there's nothing stopping external modification via
Cvar_FindVar (which is needed for adding listeners).
While not used yet (partly due to working out the design), cvars can
have a validation function.
Registering a cvar allows a primary listener (and its data) to be
specified: it will always be called first when the cvar is modified. The
combination of proper listeners and direct access to the controlled
variable greatly simplifies the more complex cvar interactions as much
less null checking is required, and there's no need for one cvar's
callback to call another's.
nq-x11 is known to work at least well enough for the demos. More testing
will come.
2022-04-23 03:22:45 +00:00
|
|
|
extern char *cl_name;
|
2001-02-19 21:15:25 +00:00
|
|
|
|
[cvar] Make cvars properly typed
This is an extremely extensive patch as it hits every cvar, and every
usage of the cvars. Cvars no longer store the value they control,
instead, they use a cexpr value object to reference the value and
specify the value's type (currently, a null type is used for strings).
Non-string cvars are passed through cexpr, allowing expressions in the
cvars' settings. Also, cvars have returned to an enhanced version of the
original (id quake) registration scheme.
As a minor benefit, relevant code having direct access to the
cvar-controlled variables is probably a slight optimization as it
removed a pointer dereference, and the variables can be located for data
locality.
The static cvar descriptors are made private as an additional safety
layer, though there's nothing stopping external modification via
Cvar_FindVar (which is needed for adding listeners).
While not used yet (partly due to working out the design), cvars can
have a validation function.
Registering a cvar allows a primary listener (and its data) to be
specified: it will always be called first when the cvar is modified. The
combination of proper listeners and direct access to the controlled
variable greatly simplifies the more complex cvar interactions as much
less null checking is required, and there's no need for one cvar's
callback to call another's.
nq-x11 is known to work at least well enough for the demos. More testing
will come.
2022-04-23 03:22:45 +00:00
|
|
|
extern int cl_model_crcs;
|
2001-06-02 23:29:41 +00:00
|
|
|
|
[cvar] Make cvars properly typed
This is an extremely extensive patch as it hits every cvar, and every
usage of the cvars. Cvars no longer store the value they control,
instead, they use a cexpr value object to reference the value and
specify the value's type (currently, a null type is used for strings).
Non-string cvars are passed through cexpr, allowing expressions in the
cvars' settings. Also, cvars have returned to an enhanced version of the
original (id quake) registration scheme.
As a minor benefit, relevant code having direct access to the
cvar-controlled variables is probably a slight optimization as it
removed a pointer dereference, and the variables can be located for data
locality.
The static cvar descriptors are made private as an additional safety
layer, though there's nothing stopping external modification via
Cvar_FindVar (which is needed for adding listeners).
While not used yet (partly due to working out the design), cvars can
have a validation function.
Registering a cvar allows a primary listener (and its data) to be
specified: it will always be called first when the cvar is modified. The
combination of proper listeners and direct access to the controlled
variable greatly simplifies the more complex cvar interactions as much
less null checking is required, and there's no need for one cvar's
callback to call another's.
nq-x11 is known to work at least well enough for the demos. More testing
will come.
2022-04-23 03:22:45 +00:00
|
|
|
extern float rate;
|
2002-04-25 16:50:56 +00:00
|
|
|
|
[cvar] Make cvars properly typed
This is an extremely extensive patch as it hits every cvar, and every
usage of the cvars. Cvars no longer store the value they control,
instead, they use a cexpr value object to reference the value and
specify the value's type (currently, a null type is used for strings).
Non-string cvars are passed through cexpr, allowing expressions in the
cvars' settings. Also, cvars have returned to an enhanced version of the
original (id quake) registration scheme.
As a minor benefit, relevant code having direct access to the
cvar-controlled variables is probably a slight optimization as it
removed a pointer dereference, and the variables can be located for data
locality.
The static cvar descriptors are made private as an additional safety
layer, though there's nothing stopping external modification via
Cvar_FindVar (which is needed for adding listeners).
While not used yet (partly due to working out the design), cvars can
have a validation function.
Registering a cvar allows a primary listener (and its data) to be
specified: it will always be called first when the cvar is modified. The
combination of proper listeners and direct access to the controlled
variable greatly simplifies the more complex cvar interactions as much
less null checking is required, and there's no need for one cvar's
callback to call another's.
nq-x11 is known to work at least well enough for the demos. More testing
will come.
2022-04-23 03:22:45 +00:00
|
|
|
extern char *skin;
|
2001-10-28 04:23:37 +00:00
|
|
|
|
[cvar] Make cvars properly typed
This is an extremely extensive patch as it hits every cvar, and every
usage of the cvars. Cvars no longer store the value they control,
instead, they use a cexpr value object to reference the value and
specify the value's type (currently, a null type is used for strings).
Non-string cvars are passed through cexpr, allowing expressions in the
cvars' settings. Also, cvars have returned to an enhanced version of the
original (id quake) registration scheme.
As a minor benefit, relevant code having direct access to the
cvar-controlled variables is probably a slight optimization as it
removed a pointer dereference, and the variables can be located for data
locality.
The static cvar descriptors are made private as an additional safety
layer, though there's nothing stopping external modification via
Cvar_FindVar (which is needed for adding listeners).
While not used yet (partly due to working out the design), cvars can
have a validation function.
Registering a cvar allows a primary listener (and its data) to be
specified: it will always be called first when the cvar is modified. The
combination of proper listeners and direct access to the controlled
variable greatly simplifies the more complex cvar interactions as much
less null checking is required, and there's no need for one cvar's
callback to call another's.
nq-x11 is known to work at least well enough for the demos. More testing
will come.
2022-04-23 03:22:45 +00:00
|
|
|
extern float cl_fb_players;
|
2001-02-19 21:15:25 +00:00
|
|
|
|
[cvar] Make cvars properly typed
This is an extremely extensive patch as it hits every cvar, and every
usage of the cvars. Cvars no longer store the value they control,
instead, they use a cexpr value object to reference the value and
specify the value's type (currently, a null type is used for strings).
Non-string cvars are passed through cexpr, allowing expressions in the
cvars' settings. Also, cvars have returned to an enhanced version of the
original (id quake) registration scheme.
As a minor benefit, relevant code having direct access to the
cvar-controlled variables is probably a slight optimization as it
removed a pointer dereference, and the variables can be located for data
locality.
The static cvar descriptors are made private as an additional safety
layer, though there's nothing stopping external modification via
Cvar_FindVar (which is needed for adding listeners).
While not used yet (partly due to working out the design), cvars can
have a validation function.
Registering a cvar allows a primary listener (and its data) to be
specified: it will always be called first when the cvar is modified. The
combination of proper listeners and direct access to the controlled
variable greatly simplifies the more complex cvar interactions as much
less null checking is required, and there's no need for one cvar's
callback to call another's.
nq-x11 is known to work at least well enough for the demos. More testing
will come.
2022-04-23 03:22:45 +00:00
|
|
|
extern int hud_scoreboard_uid;
|
2022-04-08 11:07:45 +00:00
|
|
|
|
2001-02-19 21:15:25 +00:00
|
|
|
extern client_state_t cl;
|
|
|
|
|
[scene] Make entity_t just an entity id for ECS
This puts the hierarchy (transform) reference, animation, visibility,
renderer, active, and old_origin data in separate components. There are
a few bugs (crashes on grenade explosions in gl/glsl/vulkan, immediately
in sw, reasons known, missing brush models in vulkan).
While quake doesn't really need an ECS, the direction I want to take QF
does, and it does seem to have improved memory bandwidth a little
(uncertain). However, there's a lot more work to go (especially fixing
the above bugs), but this seems to be a good start.
2022-10-23 01:32:09 +00:00
|
|
|
extern entity_t cl_entities[512];
|
|
|
|
extern byte cl_entity_valid[2][512];
|
2001-02-19 21:15:25 +00:00
|
|
|
|
|
|
|
extern qboolean nomaster;
|
|
|
|
extern char *server_version; // version of server we connected to
|
|
|
|
|
2001-04-10 06:55:28 +00:00
|
|
|
extern double realtime;
|
2003-05-08 05:49:57 +00:00
|
|
|
extern int fps_count;
|
2001-04-10 06:55:28 +00:00
|
|
|
|
2002-07-31 05:19:03 +00:00
|
|
|
extern struct cbuf_s *cl_cbuf;
|
2002-12-01 07:22:42 +00:00
|
|
|
extern struct cbuf_s *cl_stbuf;
|
2001-02-19 21:15:25 +00:00
|
|
|
|
[cvar] Make cvars properly typed
This is an extremely extensive patch as it hits every cvar, and every
usage of the cvars. Cvars no longer store the value they control,
instead, they use a cexpr value object to reference the value and
specify the value's type (currently, a null type is used for strings).
Non-string cvars are passed through cexpr, allowing expressions in the
cvars' settings. Also, cvars have returned to an enhanced version of the
original (id quake) registration scheme.
As a minor benefit, relevant code having direct access to the
cvar-controlled variables is probably a slight optimization as it
removed a pointer dereference, and the variables can be located for data
locality.
The static cvar descriptors are made private as an additional safety
layer, though there's nothing stopping external modification via
Cvar_FindVar (which is needed for adding listeners).
While not used yet (partly due to working out the design), cvars can
have a validation function.
Registering a cvar allows a primary listener (and its data) to be
specified: it will always be called first when the cvar is modified. The
combination of proper listeners and direct access to the controlled
variable greatly simplifies the more complex cvar interactions as much
less null checking is required, and there's no need for one cvar's
callback to call another's.
nq-x11 is known to work at least well enough for the demos. More testing
will come.
2022-04-23 03:22:45 +00:00
|
|
|
struct cvar_s;
|
|
|
|
void Cvar_Info (void *data, const struct cvar_s *cvar);
|
2001-02-19 21:15:25 +00:00
|
|
|
|
2022-11-02 01:33:06 +00:00
|
|
|
void CL_NetGraph_Init (void);
|
2021-07-11 01:59:27 +00:00
|
|
|
void CL_NetGraph_Init_Cvars (void);
|
2022-11-10 06:14:29 +00:00
|
|
|
void CL_NetUpdate (void);
|
2021-07-11 01:59:27 +00:00
|
|
|
|
2001-08-19 03:51:52 +00:00
|
|
|
void CL_SetState (cactive_t state);
|
|
|
|
|
2002-07-31 05:19:03 +00:00
|
|
|
void CL_Cmd_ForwardToServer (void);
|
|
|
|
void CL_Cmd_Init (void);
|
|
|
|
|
2002-11-05 19:12:51 +00:00
|
|
|
void CL_RSShot_f (void);
|
|
|
|
|
2001-05-23 06:33:23 +00:00
|
|
|
#define RSSHOT_WIDTH 320
|
|
|
|
#define RSSHOT_HEIGHT 200
|
2001-05-22 06:00:38 +00:00
|
|
|
|
2001-02-19 21:15:25 +00:00
|
|
|
#endif // _CLIENT_H
|