]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - client.h
timedemo now also prints min/avg/max fps
[xonotic/darkplaces.git] / client.h
index 38402f6de4da02c3530c89da1e03a52c0256929c..b8d6c2790c20ea26ed08aa93a0de09fdac1ccb8a 100644 (file)
--- a/client.h
+++ b/client.h
@@ -75,15 +75,25 @@ typedef struct
        // location
        vec3_t  origin;
        // stop lighting after this time
-       float   die;
+       vec_t   die;
        // color of light
        vec3_t  color;
        // brightness (not really radius anymore)
-       float   radius;
+       vec_t   radius;
        // drop this each second
-       float   decay;
+       vec_t   decay;
        // the entity that owns this light (can be NULL)
        struct entity_render_s *ent;
+       // orientation/scaling/location
+       matrix4x4_t matrix;
+       // cubemap number to use on this light
+       int cubemapnum;
+       // light style which controls intensity of this light
+       int style;
+       // cast shadows
+       int shadow;
+       // corona intensity
+       vec_t corona;
 }
 dlight_t;
 
@@ -94,8 +104,8 @@ 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
@@ -124,14 +134,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)
@@ -157,13 +167,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;
@@ -179,21 +188,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;
 
@@ -233,7 +227,6 @@ typedef struct
 typedef struct
 {
        char    name[MAX_SCOREBOARDNAME];
-       float   entertime;
        int             frags;
        int             colors; // two 4 bit fields
 } scoreboard_t;
@@ -248,7 +241,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
 
@@ -298,15 +292,24 @@ typedef struct
        int td_startframe;
        // realtime at second frame of timedemo (LordHavoc: changed to double)
        double td_starttime;
+       // LordHavoc: for measuring maxfps
+       double td_minframetime;
+       // LordHavoc: for measuring minfps
+       double td_maxframetime;
        // 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;
 }
@@ -320,6 +323,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;
@@ -337,6 +343,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;
 
@@ -434,8 +442,12 @@ typedef struct
        // for interpolation
        float viewzoomold, viewzoomnew;
 
+       // protocol version of the server we're connected to
+       int protocol;
+
        // entity database stuff
        entity_database_t entitydatabase;
+       entity_database4_t *entitydatabase4;
 }
 client_state_t;
 
@@ -446,6 +458,7 @@ extern mempool_t *cl_scores_mempool;
 //
 extern cvar_t cl_name;
 extern cvar_t cl_color;
+extern cvar_t cl_rate;
 extern cvar_t cl_pmodel;
 
 extern cvar_t cl_upspeed;
@@ -501,7 +514,7 @@ extern lightstyle_t *cl_lightstyle;
 
 extern client_state_t cl;
 
-extern void CL_AllocDlight (entity_render_t *ent, vec3_t org, float radius, float red, float green, float blue, float decay, float lifetime);
+extern void CL_AllocDlight (entity_render_t *ent, matrix4x4_t *matrix, float radius, float red, float green, float blue, float decay, float lifetime, int cubemapnum, int style, int shadowenable, vec_t corona);
 extern void CL_DecayLights (void);
 
 //=============================================================================
@@ -512,13 +525,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
 //
@@ -534,7 +551,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);
@@ -555,19 +572,20 @@ void CL_BaseMove (usercmd_t *cmd);
 
 
 float CL_KeyState (kbutton_t *key);
-char *Key_KeynumToString (int keynum);
+const 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
@@ -634,9 +652,8 @@ 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];
@@ -657,7 +674,5 @@ extern mempool_t *cl_refdef_mempool;
 
 #include "cgamevm.h"
 
-void Host_PerformSpawnServerAndLoadGame(void);
-
 #endif