]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - client.h
significant cleanup of CL_UpdateEntities, GL_UpdateNetworkEntity, CL_LinkNetworkEntit...
[xonotic/darkplaces.git] / client.h
index ee59f088531e84785aaac7717cb683ddf692e8b3..b83c5e9af668c87552027d8e2810d649c09ed18e 100644 (file)
--- a/client.h
+++ b/client.h
@@ -159,9 +159,16 @@ typedef struct dlight_s
        // brightness (not really radius anymore)
        // (worldlight: saved to .rtlights file)
        vec_t radius;
-       // drop radius this much each second
+       // drop intensity this much each second
        // (dlight only)
        vec_t decay;
+       // intensity value which is dropped over time
+       // (dlight only)
+       vec_t intensity;
+       // initial values for intensity to modify
+       // (dlight only)
+       vec_t initialradius;
+       vec3_t initialcolor;
        // light style which controls intensity of this light
        // (worldlight: saved to .rtlights file)
        int style;
@@ -207,9 +214,9 @@ frameblend_t;
 typedef struct entity_render_s
 {
        // location
-       vec3_t origin;
+       //vec3_t origin;
        // orientation
-       vec3_t angles;
+       //vec3_t angles;
        // transform matrix for model to world
        matrix4x4_t matrix;
        // transform matrix for world to model
@@ -267,8 +274,6 @@ entity_render_t;
 
 typedef struct entity_persistent_s
 {
-       int linkframe;
-
        vec3_t trail_origin;
 
        // particle trail
@@ -293,7 +298,6 @@ entity_persistent_t;
 
 typedef struct entity_s
 {
-       qboolean csqc;
        // baseline state (default values)
        entity_state_t state_baseline;
        // previous state (interpolating from this)
@@ -401,13 +405,47 @@ qw_downloadtype_t;
 
 typedef enum capturevideoformat_e
 {
-       CAPTUREVIDEOFORMAT_TARGA,
-       CAPTUREVIDEOFORMAT_JPEG,
-       CAPTUREVIDEOFORMAT_RAWRGB,
-       CAPTUREVIDEOFORMAT_RAWYV12
+       CAPTUREVIDEOFORMAT_AVI_I420
 }
 capturevideoformat_t;
 
+typedef struct capturevideostate_s
+{
+       double starttime;
+       double framerate;
+       // for AVI saving some values have to be written after capture ends
+       fs_offset_t videofile_totalframes_offset1;
+       fs_offset_t videofile_totalframes_offset2;
+       fs_offset_t videofile_totalsampleframes_offset;
+       qfile_t *videofile;
+       qboolean active;
+       qboolean realtime;
+       qboolean error;
+       capturevideoformat_t format;
+       int soundrate;
+       int frame;
+       int soundsampleframe; // for AVI saving
+       unsigned char *buffer;
+       sizebuf_t riffbuffer;
+       unsigned char riffbufferdata[128];
+       // note: riffindex buffer has an allocated ->data member, not static like most!
+       sizebuf_t riffindexbuffer;
+       int riffstacklevel;
+       fs_offset_t riffstackstartoffset[4];
+       short rgbtoyuvscaletable[3][3][256];
+       unsigned char yuvnormalizetable[3][256];
+       char basename[64];
+}
+capturevideostate_t;
+
+#define CL_MAX_DOWNLOADACKS 4
+
+typedef struct cl_downloadack_s
+{
+       int start, size;
+}
+cl_downloadack_t;
+
 //
 // the client_static_t structure is persistent through an arbitrary number
 // of server connections
@@ -464,6 +502,10 @@ typedef struct client_static_s
        // network connection
        netconn_t *netcon;
 
+       // download information
+       // (note: qw_download variables are also used)
+       cl_downloadack_t dp_downloadack[CL_MAX_DOWNLOADACKS];
+
        // quakeworld stuff below
 
        // value of "qport" cvar at time of connection
@@ -480,6 +522,10 @@ typedef struct client_static_s
        int qw_downloadnumber;
        int qw_downloadpercent;
        qw_downloadtype_t qw_downloadtype;
+       // transfer rate display
+       double qw_downloadspeedtime;
+       int qw_downloadspeedcount;
+       int qw_downloadspeedrate;
 
        // current file upload buffer (for uploading screenshots to server)
        unsigned char *qw_uploaddata;
@@ -492,18 +538,7 @@ typedef struct client_static_s
        char userinfo[MAX_USERINFO_STRING];
 
        // video capture stuff
-       qboolean capturevideo_active;
-       capturevideoformat_t capturevideo_format;
-       double capturevideo_starttime;
-       double capturevideo_framerate;
-       int capturevideo_soundrate;
-       int capturevideo_frame;
-       unsigned char *capturevideo_buffer;
-       qfile_t *capturevideo_videofile;
-       qfile_t *capturevideo_soundfile;
-       short capturevideo_rgbtoyuvscaletable[3][3][256];
-       unsigned char capturevideo_yuvnormalizetable[3][256];
-       char capturevideo_basename[64];
+       capturevideostate_t capturevideo;
 }
 client_static_t;
 
@@ -588,13 +623,23 @@ typedef struct particle_s
        float           airfriction; // how much air friction affects this object (objects with a low mass/size ratio tend to get more air friction)
        float           liquidfriction; // how much liquid friction affects this object (objects with a low mass/size ratio tend to get more liquid friction)
        unsigned char           color[4];
-       unsigned short owner; // decal stuck to this entity
+       unsigned int            owner; // decal stuck to this entity
        model_t         *ownermodel; // model the decal is stuck to (used to make sure the entity is still alive)
        vec3_t          relativeorigin; // decal at this location in entity's coordinate space
        vec3_t          relativedirection; // decal oriented this way relative to entity's coordinate space
 }
 particle_t;
 
+typedef enum cl_parsingtextmode_e
+{
+       CL_PARSETEXTMODE_NONE,
+       CL_PARSETEXTMODE_PING,
+       CL_PARSETEXTMODE_STATUS,
+       CL_PARSETEXTMODE_STATUS_PLAYERID,
+       CL_PARSETEXTMODE_STATUS_PLAYERIP
+}
+cl_parsingtextmode_t;
+
 //
 // the client_state_t structure is wiped completely at every
 // server signon
@@ -627,6 +672,8 @@ typedef struct client_state_s
        float weapontime;
        // use pain anim frame if cl.time < this
        float faceanimtime;
+       // for stair smoothing
+       float stairoffset;
 
        // color shifts for damage, powerups
        cshift_t cshifts[NUM_CSHIFTS];
@@ -773,6 +820,16 @@ typedef struct client_state_s
        // [cl.maxclients]
        scoreboard_t *scores;
 
+       // keep track of svc_print parsing state (analyzes ping reports and status reports)
+       cl_parsingtextmode_t parsingtextmode;
+       int parsingtextplayerindex;
+       // set by scoreboard code when sending ping command, this causes the next ping results to be hidden
+       // (which could eat the wrong ping report if the player issues one
+       //  manually, but they would still see a ping report, just a later one
+       //  caused by the scoreboard code rather than the one they intentionally
+       //  issued)
+       int parsingtextexpectingpingforscores;
+
        // entity database stuff
        // latest received entity frame numbers
 #define LATESTFRAMENUMS 3
@@ -827,6 +884,16 @@ typedef struct client_state_s
 
        int free_particle;
 
+       // cl_serverextension_download feature
+       int loadmodel_current;
+       int downloadmodel_current;
+       int loadmodel_total;
+       int loadsound_current;
+       int downloadsound_current;
+       int loadsound_total;
+       qboolean downloadcsqc;
+       qboolean loadfinished;
+
        // quakeworld stuff
 
        // local copy of the server infostring
@@ -841,8 +908,9 @@ typedef struct client_state_s
        // updated from serverinfo
        int qw_teamplay;
 
-       // indicates whether the player is spectating
-       qboolean qw_spectator;
+       // unused: indicates whether the player is spectating
+       // use cl.scores[cl.playerentity].qw_spectator instead
+       //qboolean qw_spectator;
 
        // movement parameters for client prediction
        float qw_movevars_gravity;
@@ -906,9 +974,6 @@ extern cvar_t cl_anglespeedkey;
 
 extern cvar_t cl_autofire;
 
-extern cvar_t csqc_progname;   //[515]: csqc crc check and right csprogs name according to progs.dat
-extern cvar_t csqc_progcrc;
-
 extern cvar_t cl_shownet;
 extern cvar_t cl_nolerp;
 
@@ -957,7 +1022,8 @@ void CL_EstablishConnection(const char *host);
 void CL_Disconnect (void);
 void CL_Disconnect_f (void);
 
-void CL_BoundingBoxForEntity(entity_render_t *ent);
+void CL_UpdateRenderEntity(entity_render_t *ent);
+void CL_UpdateEntities(void);
 
 //
 // cl_input
@@ -1079,7 +1145,6 @@ typedef enum effectnameindex_s
        EFFECT_TE_SUPERSPIKEQUAD,
        EFFECT_TE_WIZSPIKE,
        EFFECT_TE_KNIGHTSPIKE,
-       EFFECT_TE_VORESPIKE,
        EFFECT_TE_EXPLOSION,
        EFFECT_TE_EXPLOSIONQUAD,
        EFFECT_TE_TAREXPLOSION,
@@ -1126,6 +1191,8 @@ void R_NewExplosion(const vec3_t org);
 
 #include "cl_screen.h"
 
+extern qboolean sb_showscores;
+
 #define NUMCROSSHAIRS 32
 extern cachepic_t *r_crosshairs[NUMCROSSHAIRS+1];
 
@@ -1266,6 +1333,9 @@ typedef struct r_view_s
 
        // which color components to allow (for anaglyph glasses)
        int colormask[4];
+
+       // global RGB color multiplier for rendering, this is required by HDR
+       float colorscale;
 }
 r_view_t;