More client.h cleanup.

This commit is contained in:
Bill Currie 2012-06-26 15:03:04 +09:00
parent 56f68cf119
commit 6e5bc62f78
3 changed files with 34 additions and 42 deletions

View file

@ -304,7 +304,7 @@
// in an update message // in an update message
typedef struct entity_state_s { typedef struct entity_state_s {
int number; // edict index int number; // edict index
unsigned int flags; // nolerp, etc unsigned flags; // nolerp, etc
vec3_t origin; vec3_t origin;
vec3_t angles; vec3_t angles;

View file

@ -42,8 +42,7 @@
#include "protocol.h" #include "protocol.h"
typedef struct usercmd_s typedef struct usercmd_s {
{
vec3_t viewangles; vec3_t viewangles;
// intended velocities // intended velocities
@ -52,8 +51,7 @@ typedef struct usercmd_s
float upmove; float upmove;
} usercmd_t; } usercmd_t;
typedef struct typedef struct {
{
struct info_s *info; struct info_s *info;
struct info_key_s *name; struct info_key_s *name;
float entertime; float entertime;
@ -73,16 +71,14 @@ typedef enum {
so_active, so_active,
} signon_t; } signon_t;
#define MAX_DEMOS 8 #define MAX_DEMOS 8
#define MAX_DEMONAME 16 #define MAX_DEMONAME 16
#define MAX_MAPSTRING 2048
typedef enum { typedef enum {
ca_dedicated, // a dedicated server with no ability to start a client ca_dedicated, // a dedicated server with no ability to start a client
ca_disconnected, // full screen console with no connection ca_disconnected, // full screen console with no connection
ca_connected, // valid netcon, talking to a server ca_connected, // talking to a server
ca_active, // fully connected ca_active, // everything is in, so frames can be rendered
} cactive_t; } cactive_t;
typedef enum { typedef enum {

View file

@ -45,73 +45,69 @@
to do move prediction and to generate a drawable entity to do move prediction and to generate a drawable entity
*/ */
typedef struct player_state_s { typedef struct player_state_s {
int messagenum; // all player's won't be updated each frame int messagenum; // all player's won't be updated each frame
double state_time; // not the same as the packet time, double state_time; // not the same as the packet time,
// because player commands come asyncronously // because player commands come asyncronously
vec3_t viewangles; // only for demos, not from server vec3_t viewangles; // only for demos, not from server
plent_state_t pls; plent_state_t pls;
float waterjumptime; float waterjumptime;
int onground; // -1 = in air, else pmove entity number int onground; // -1 = in air, else pmove entity number
int oldbuttons; int oldbuttons;
int oldonground; int oldonground;
} player_state_t; } player_state_t;
typedef struct player_info_s typedef struct player_info_s {
{ int userid;
int userid; struct info_s *userinfo;
struct info_s *userinfo;
// scoreboard information // scoreboard information
struct info_key_s *name; struct info_key_s *name;
struct info_key_s *team; struct info_key_s *team;
float entertime; float entertime;
int frags; int frags;
int ping; int ping;
byte pl; byte pl;
// skin information // skin information
int topcolor; int topcolor;
int bottomcolor; int bottomcolor;
struct info_key_s *skinname; struct info_key_s *skinname;
struct skin_s *skin; struct skin_s *skin;
int spectator; int spectator;
int stats[MAX_CL_STATS]; // health, etc int stats[MAX_CL_STATS]; // health, etc
int prevcount; int prevcount;
} player_info_t; } player_info_t;
typedef struct typedef struct {
{
// generated on client side // generated on client side
usercmd_t cmd; // cmd that generated the frame usercmd_t cmd; // cmd that generated the frame
double senttime; // time cmd was sent off double senttime; // time cmd was sent off
int delta_sequence; // sequence number to delta from, -1 = full update int delta_sequence; // sequence number to delta from, -1 = full update
// received from server // received from server
double receivedtime; // time message was received, or -1 double receivedtime; // time message was received, or -1
player_state_t playerstate[MAX_CLIENTS]; // message received that player_state_t playerstate[MAX_CLIENTS]; // message received that
// reflects performing the // reflects performing the
// usercmd // usercmd
packet_entities_t packet_entities; packet_entities_t packet_entities;
qboolean invalid; // true if the packet_entities delta was invalid qboolean invalid; // true if the packet_entities delta was invalid
} frame_t; } frame_t;
#define MAX_DEMOS 8 #define MAX_DEMOS 8
#define MAX_DEMONAME 16 #define MAX_DEMONAME 16
typedef enum { typedef enum {
ca_disconnected, // full screen console with no connection ca_disconnected, // full screen console with no connection
ca_demostart, // starting up a demo ca_demostart, // starting up a demo
ca_connected, // netchan_t established, waiting for svc_serverdata ca_connected, // talking to a server
ca_onserver, // processing data lists, donwloading, etc ca_onserver, // processing data lists, donwloading, etc
ca_active // everything is in, so frames can be rendered ca_active, // everything is in, so frames can be rendered
} cactive_t; } cactive_t;
typedef enum { typedef enum {