]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - client.h
changed rtlight compiled cluster list/pvs to leaf list/pvs to enable slightly more...
[xonotic/darkplaces.git] / client.h
index b3272d1f1089aa633e852d9620118a371b320599..5164516749d16f0053213476d4515ebf8d35eab5 100644 (file)
--- a/client.h
+++ b/client.h
@@ -76,7 +76,7 @@ beam_t;
 
 typedef struct rtlight_s
 {
-       // shadow volumes are done entirely in model space, so there are no matrices for dealing with them...  they just use the origin 
+       // shadow volumes are done entirely in model space, so there are no matrices for dealing with them...  they just use the origin
 
        // note that the world to light matrices are inversely scaled (divided) by lightradius
 
@@ -110,7 +110,7 @@ typedef struct rtlight_s
        vec_t specularscale;
        // LIGHTFLAG_* flags
        int flags;
-       
+
        // generated properties
        // used only for shadow volumes
        vec3_t shadoworigin;
@@ -141,10 +141,13 @@ typedef struct rtlight_s
        shadowmesh_t *static_meshchain_shadow;
        shadowmesh_t *static_meshchain_light;
        // used for visibility testing (more exact than bbox)
-       int static_numclusters;
-       int static_numclusterpvsbytes;
-       int *static_clusterlist;
-       qbyte *static_clusterpvs;
+       int static_numleafs;
+       int static_numleafpvsbytes;
+       int *static_leaflist;
+       qbyte *static_leafpvs;
+       // surfaces seen by light
+       int static_numsurfaces;
+       int *static_surfacelist;
 }
 rtlight_t;
 
@@ -213,7 +216,7 @@ typedef struct dlight_s
        // (worldlight only)
        struct dlight_s *next;
        // embedded rtlight struct for renderer
-       // (renderer only)      
+       // (renderer only)
        rtlight_t rtlight;
 }
 dlight_t;
@@ -446,6 +449,7 @@ typedef struct
        netconn_t *netcon;
        // writing buffer to send to server
        sizebuf_t message;
+       qbyte message_buf[1024];
 }
 client_static_t;
 
@@ -494,20 +498,17 @@ typedef struct
 // the view is temporarily offset, and an angle reset commands at the start
 // of each level and after teleporting.
 
-       // during demo playback viewangles is lerped between these
-       vec3_t mviewangles[2];
-       // either client controlled, or lerped from demo mviewangles
-       vec3_t viewangles;
-
+       // mviewangles is read from demo
+       // viewangles is either client controlled or lerped from mviewangles
+       vec3_t mviewangles[2], viewangles;
+       // update by server, used by qc to do weapon recoil
+       vec3_t mpunchangle[2], punchangle;
+       // update by server, can be used by mods to kick view around
+       vec3_t mpunchvector[2], punchvector;
        // update by server, used for lean+bob (0 is newest)
-       vec3_t mvelocity[2];
-       // lerped between mvelocity[0] and [1]
-       vec3_t velocity;
-
-       // temporary offset
-       vec3_t punchangle;
-       // LordHavoc: origin view kick
-       vec3_t punchvector;
+       vec3_t mvelocity[2], velocity;
+       // update by server, can be used by mods for zooming
+       vec_t mviewzoom[2], viewzoom;
 
 // pitch drifting vars
        float idealpitch;
@@ -572,11 +573,6 @@ typedef struct
        // [cl.maxclients]
        scoreboard_t *scores;
 
-       // LordHavoc: sniping zoom, QC controlled
-       float viewzoom;
-       // for interpolation
-       float viewzoomold, viewzoomnew;
-
        // protocol version of the server we're connected to
        int protocol;
 
@@ -589,8 +585,6 @@ typedef struct
 }
 client_state_t;
 
-extern mempool_t *cl_scores_mempool;
-
 //
 // cvars
 //
@@ -598,6 +592,8 @@ extern cvar_t cl_name;
 extern cvar_t cl_color;
 extern cvar_t cl_rate;
 extern cvar_t cl_pmodel;
+extern cvar_t cl_playermodel;
+extern cvar_t cl_playerskin;
 
 extern cvar_t cl_upspeed;
 extern cvar_t cl_forwardspeed;
@@ -636,7 +632,7 @@ extern cvar_t cl_explosions_size_start;
 extern cvar_t cl_explosions_size_end;
 extern cvar_t cl_explosions_lifetime;
 extern cvar_t cl_stainmaps;
-extern cvar_t cl_stainmapsclearonload;
+extern cvar_t cl_stainmaps_clearonload;
 
 extern cvar_t cl_prydoncursor;
 
@@ -646,12 +642,12 @@ extern int cl_num_static_entities;
 extern int cl_num_temp_entities;
 extern int cl_num_brushmodel_entities;
 
-extern mempool_t *cl_entities_mempool;
+extern mempool_t *cl_mempool;
 extern entity_t *cl_entities;
 extern qbyte *cl_entities_active;
 extern entity_t *cl_static_entities;
 extern entity_t *cl_temp_entities;
-extern entity_render_t **cl_brushmodel_entities;
+extern int *cl_brushmodel_entities;
 extern cl_effect_t *cl_effects;
 extern beam_t *cl_beams;
 extern dlight_t *cl_dlights;
@@ -669,6 +665,7 @@ extern void CL_DecayLights (void);
 // cl_main
 //
 
+void CL_Shutdown (void);
 void CL_Init (void);
 
 void CL_EstablishConnection(const char *host);
@@ -712,6 +709,7 @@ entity_t *CL_NewTempEntity (void);
 void CL_Effect(vec3_t org, int modelindex, int startframe, int framecount, float framerate);
 
 void CL_ClearState (void);
+void CL_ExpandEntities(int num);
 
 
 int  CL_ReadFromServer (void);
@@ -721,6 +719,7 @@ void CL_BaseMove (void);
 
 float CL_KeyState (kbutton_t *key);
 const char *Key_KeynumToString (int keynum);
+int Key_StringToKeynum (const char *str);
 
 //
 // cl_demo.c
@@ -739,6 +738,7 @@ void CL_TimeDemo_f(void);
 // cl_parse.c
 //
 void CL_Parse_Init(void);
+void CL_Parse_Shutdown(void);
 void CL_ParseServerMessage(void);
 void CL_Parse_DumpPacket(void);
 
@@ -786,6 +786,7 @@ extern cvar_t cl_decals_fadetime;
 
 void CL_Particles_Clear(void);
 void CL_Particles_Init(void);
+void CL_Particles_Shutdown(void);
 
 void CL_ParseParticleEffect (void);
 void CL_RunParticleEffect (vec3_t org, vec3_t dir, int color, int count);
@@ -835,10 +836,25 @@ typedef struct
        // fullscreen color blend
        float viewblend[4];
 
+       // whether to call S_ExtraUpdate during render to reduce sound chop
+       qboolean extraupdate;
+
+       // client gameworld time for rendering time based effects
+       double time;
+
+       // the world
+       entity_render_t *worldentity;
+
+       // same as worldentity->model
+       model_t *worldmodel;
+
+       // renderable entities (excluding world)
        entity_render_t **entities;
        int numentities;
        int maxentities;
 
+       // 2D art drawing queue
+       // TODO: get rid of this
        qbyte *drawqueue;
        int drawqueuesize;
        int maxdrawqueuesize;
@@ -847,8 +863,6 @@ refdef_t;
 
 refdef_t r_refdef;
 
-extern mempool_t *cl_refdef_mempool;
-
 #include "cgamevm.h"
 
 #endif