X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=client.h;h=69fd11952aa0fca52e1293186ea0467c92c0d353;hb=b6958185ecd637a78cccd19d9a02e8bbcb1630bd;hp=c7e61e491e0b90dc411d02e2ab8563bebf7fb817;hpb=7d184704e499b001046ef76851ed70d53f93d38a;p=xonotic%2Fdarkplaces.git diff --git a/client.h b/client.h index c7e61e49..69fd1195 100644 --- a/client.h +++ b/client.h @@ -22,6 +22,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #ifndef CLIENT_H #define CLIENT_H +#include "matrixlib.h" + // LordHavoc: 256 dynamic lights #define MAX_DLIGHTS 256 // LordHavoc: this affects the lighting scale of the whole game @@ -54,9 +56,17 @@ cl_effect_t; typedef struct { int entity; + // draw this as lightning polygons, or a model? + int lightning; struct model_s *model; float endtime; vec3_t start, end; + // if this beam is owned by an entity, this is the beam start relative to + // that entity's matrix for per frame start updates + vec3_t relativestart; + vec3_t relativeend; + // indicates whether relativestart is valid + int relativestartvalid; } beam_t; @@ -72,8 +82,8 @@ typedef struct float radius; // drop this each second float decay; - // the entity that spawned this light (can be NULL if it will never be replaced) - //entity_render_t *ent; + // the entity that owns this light (can be NULL) + struct entity_render_s *ent; } dlight_t; @@ -84,14 +94,18 @@ typedef struct frameblend_s } frameblend_t; -// LordHavoc: disregard the following warning, entlights stuff is semi-persistent... -// LordHavoc: nothing in this structure is persistent, it may be overwritten by the client every frame, for persistent data use entity_lerp_t. +// LordHavoc: this struct is intended for the renderer but some fields are +// used by the client. typedef struct entity_render_s { // location vec3_t origin; // orientation vec3_t angles; + // transform matrix for model to world + matrix4x4_t matrix; + // transform matrix for world to model + matrix4x4_t inversematrix; // opacity (alpha) of the model float alpha; // size the model is shown @@ -110,14 +124,14 @@ typedef struct entity_render_s // render flags int flags; - // these are copied from the persistent data + // interpolated animation // frame that the model is interpolating from int frame1; // frame that the model is interpolating to int frame2; // interpolation factor, usually computed from frame2time - double framelerp; + float framelerp; // time frame1 began playing (for framegroup animations) double frame1time; // time frame2 began playing (for framegroup animations) @@ -135,6 +149,7 @@ typedef struct entity_render_s // caching results of static light traces (this is semi-persistent) double entlightstime; vec3_t entlightsorigin; + int entlightsframe; int numentlights; unsigned short entlights[MAXENTLIGHTS]; } @@ -142,13 +157,12 @@ entity_render_t; typedef struct entity_persistent_s { - // particles + int linkframe; - // trail rendering vec3_t trail_origin; - float trail_time; - // effects + // particle trail + float trail_time; // muzzleflash fading float muzzleflash; @@ -164,21 +178,6 @@ typedef struct entity_persistent_s float oldangles[3]; float neworigin[3]; float newangles[3]; - - // interpolated animation - - // lerp resets when model changes - int modelindex; - // frame that the model is interpolating from - int frame1; - // frame that the model is interpolating to - int frame2; - // interpolation factor, usually computed from frame2time - double framelerp; - // time frame1 began playing (for framegroup animations) - double frame1time; - // time frame2 began playing (for framegroup animations) - double frame2time; } entity_persistent_t; @@ -218,7 +217,6 @@ typedef struct typedef struct { char name[MAX_SCOREBOARDNAME]; - float entertime; int frags; int colors; // two 4 bit fields } scoreboard_t; @@ -233,7 +231,8 @@ typedef struct #define CSHIFT_DAMAGE 1 #define CSHIFT_BONUS 2 #define CSHIFT_POWERUP 3 -#define NUM_CSHIFTS 4 +#define CSHIFT_VCSHIFT 4 +#define NUM_CSHIFTS 5 #define NAME_LENGTH 64 @@ -244,7 +243,6 @@ typedef struct #define SIGNONS 4 // signon messages to receive before connected -#define MAX_MAPSTRING 2048 #define MAX_DEMOS 8 #define MAX_DEMONAME 16 @@ -264,11 +262,6 @@ typedef struct { cactive_t state; -// personalization data sent to server - char mapstring[MAX_QPATH]; - // to restart a level - //char spawnparms[MAX_MAPSTRING]; - // demo loop control // -1 = don't play demos int demonum; @@ -282,7 +275,7 @@ typedef struct qboolean timedemo; // -1 = use normal cd track int forcetrack; - QFile *demofile; + qfile_t *demofile; // to meter out one message a frame int td_lastframe; // host_framecount at start @@ -292,12 +285,17 @@ typedef struct // LordHavoc: pausedemo qboolean demopaused; + qboolean connect_trying; + int connect_remainingtries; + double connect_nextsendtime; + lhnetsocket_t *connect_mysocket; + lhnetaddress_t connect_address; // connection information // 0 to SIGNONS int signon; - // network socket - struct qsocket_s *netcon; + // network connection + netconn_t *netcon; // writing buffer to send to server sizebuf_t message; } @@ -311,6 +309,9 @@ extern client_static_t cls; // typedef struct { + // true if playing in a local game and no one else is connected + int islocalgame; + // when connecting to the server throw out the first couple move messages // so the player doesn't accidentally do something the first frame int movemessages; @@ -328,6 +329,8 @@ typedef struct int items; // cl.time of acquiring item, for blinking float item_gettime[32]; + // cl.time of changing STAT_ACTIVEWEAPON + float weapontime; // use pain anim frame if cl.time < this float faceanimtime; @@ -420,16 +423,17 @@ typedef struct // [cl.maxclients] scoreboard_t *scores; - // used by view code for setting up eye position - vec3_t viewentorigin; // LordHavoc: sniping zoom, QC controlled float viewzoom; // for interpolation float viewzoomold, viewzoomnew; + // protocol version of the server we're connected to + int protocol; + // entity database stuff - vec3_t viewentoriginold, viewentoriginnew; entity_database_t entitydatabase; + entity_database4_t *entitydatabase4; } client_state_t; @@ -476,7 +480,7 @@ extern cvar_t r_draweffects; extern cvar_t cl_explosions; extern cvar_t cl_stainmaps; -// these are updated by +// these are updated by CL_ClearState extern int cl_num_entities; extern int cl_num_static_entities; extern int cl_num_temp_entities; @@ -506,11 +510,17 @@ extern void CL_DecayLights (void); void CL_Init (void); -void CL_EstablishConnection (char *host); +void CL_EstablishConnection(const char *host); void CL_Disconnect (void); void CL_Disconnect_f (void); +void CL_BoundingBoxForEntity(entity_render_t *ent); + +extern cvar_t cl_beams_polygons; +extern cvar_t cl_beams_relative; +extern cvar_t cl_beams_lightatend; + // // cl_input // @@ -526,7 +536,7 @@ extern kbutton_t in_strafe; extern kbutton_t in_speed; void CL_InitInput (void); -void CL_SendCmd (void); +void CL_SendCmd (usercmd_t *cmd); void CL_SendMove (usercmd_t *cmd); void CL_LerpUpdate(entity_t *e); @@ -552,21 +562,22 @@ char *Key_KeynumToString (int keynum); // // cl_demo.c // -void CL_StopPlayback (void); -int CL_GetMessage (void); +void CL_StopPlayback(void); +void CL_ReadDemoMessage(void); +void CL_WriteDemoMessage(void); -void CL_NextDemo (void); -void CL_Stop_f (void); -void CL_Record_f (void); -void CL_PlayDemo_f (void); -void CL_TimeDemo_f (void); +void CL_NextDemo(void); +void CL_Stop_f(void); +void CL_Record_f(void); +void CL_PlayDemo_f(void); +void CL_TimeDemo_f(void); // // cl_parse.c // void CL_Parse_Init(void); void CL_ParseServerMessage(void); -void CL_BitProfile_f(void); +void CL_Parse_DumpPacket(void); // // view @@ -589,11 +600,6 @@ void CL_InitTEnts (void); // cl_part // -#define PARTICLE_INVALID 0 -#define PARTICLE_BILLBOARD 1 -#define PARTICLE_UPRIGHT_FACING 2 -#define PARTICLE_ORIENTED_DOUBLESIDED 3 - void CL_Particles_Clear(void); void CL_Particles_Init(void); @@ -612,10 +618,13 @@ void CL_ParticleCube (vec3_t mins, vec3_t maxs, vec3_t dir, int count, int color void CL_ParticleRain (vec3_t mins, vec3_t maxs, vec3_t dir, int count, int colorbase, int type); void CL_EntityParticles (entity_t *ent); void CL_BlobExplosion (vec3_t org); -void CL_ParticleExplosion (vec3_t org, int smoke); +void CL_ParticleExplosion (vec3_t org); void CL_ParticleExplosion2 (vec3_t org, int colorStart, int colorLength); void CL_LavaSplash (vec3_t org); void CL_TeleportSplash (vec3_t org); +void CL_BeamParticle (const vec3_t start, const vec3_t end, vec_t radius, float red, float green, float blue, float alpha, float lifetime); +void CL_Tei_Smoke(const vec3_t pos, const vec3_t dir, int count); +void CL_Tei_PlasmaHit(const vec3_t pos, const vec3_t dir, int count); void CL_MoveParticles(void); void R_MoveExplosions(void); void R_NewExplosion(vec3_t org); @@ -628,16 +637,12 @@ typedef struct int x, y, width, height; float fov_x, fov_y; - // view point - vec3_t vieworg; - vec3_t viewangles; + // view transform + matrix4x4_t viewentitymatrix; // fullscreen color blend float viewblend[4]; - // weapon model - entity_render_t viewent; - entity_render_t **entities; int numentities; int maxentities;