]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - client.h
-safe now does something approximately close to correct. Not a full fix
[xonotic/darkplaces.git] / client.h
index c5cbffdea657911aa0f62eb949d1ecf08b67e40f..4b469bb30dd6d7dc568c5883affacef36bf72845 100644 (file)
--- a/client.h
+++ b/client.h
@@ -40,8 +40,7 @@ typedef struct
        char    name[MAX_SCOREBOARDNAME];
        float   entertime;
        int             frags;
-       int             colors;                 // two 4 bit fields
-       byte    translations[VID_GRADES*256];
+       int             colors; // two 4 bit fields
 } scoreboard_t;
 
 typedef struct
@@ -65,20 +64,7 @@ typedef struct
 
 #define        SIGNONS         4                       // signon messages to receive before connected
 
-// LordHavoc: 256 dynamic lights
-#define        MAX_DLIGHTS             256
-typedef struct
-{
-       vec3_t  origin;
-       float   radius;
-       float   die;                            // stop lighting after this time
-       float   decay;                          // drop this each second
-       float   minlight;                       // don't add when contributing less
-       int             key;
-       vec3_t  color;                          // LordHavoc: colored lighting
-       qboolean        dark;                   // subtracts light instead of adding
-} dlight_t;
-
+#include "r_light.h"
 
 #define        MAX_BEAMS       24
 typedef struct
@@ -87,20 +73,20 @@ typedef struct
        struct model_s  *model;
        float   endtime;
        vec3_t  start, end;
-} beam_t;
-
-// LordHavoc: increased MAX_EFRAGS from 640 to 2048
-#define        MAX_EFRAGS              2048
+}
+beam_t;
 
 #define        MAX_MAPSTRING   2048
 #define        MAX_DEMOS               8
 #define        MAX_DEMONAME    16
 
-typedef enum {
-ca_dedicated,          // a dedicated server with no ability to start a client
-ca_disconnected,       // full screen console with no connection
-ca_connected           // valid netcon, talking to a server
-} cactive_t;
+typedef enum
+{
+       ca_dedicated,           // a dedicated server with no ability to start a client
+       ca_disconnected,        // full screen console with no connection
+       ca_connected            // valid netcon, talking to a server
+}
+cactive_t;
 
 //
 // the client_static_t structure is persistant through an arbitrary number
@@ -124,7 +110,7 @@ typedef struct
        qboolean        demoplayback;
        qboolean        timedemo;
        int                     forcetrack;                     // -1 = use normal cd track
-       FILE            *demofile;
+       QFile           *demofile;
        int                     td_lastframe;           // to meter out one message a frame
        int                     td_startframe;          // host_framecount at start
        double          td_starttime;           // realtime at second frame of timedemo (LordHavoc: changed to double)
@@ -135,8 +121,8 @@ typedef struct
        int                     signon;                 // 0 to SIGNONS
        struct qsocket_s        *netcon;
        sizebuf_t       message;                // writing buffer to send to server
-       
-client_static_t;
+}
+client_static_t;
 
 extern client_static_t cls;
 
@@ -155,7 +141,7 @@ typedef struct
 // information for local display
        int                     stats[MAX_CL_STATS];    // health, etc
        int                     items;                  // inventory bit flags
-       float   item_gettime[32];       // cl.time of aquiring item, for blinking
+       float           item_gettime[32];       // cl.time of acquiring item, for blinking
        float           faceanimtime;   // use anim frame if cl.time < this
 
        cshift_t        cshifts[NUM_CSHIFTS];   // color shifts for damage, powerups
@@ -174,7 +160,8 @@ typedef struct
        vec3_t          velocity;               // lerped between mvelocity[0] and [1]
 
        vec3_t          punchangle;             // temporary offset
-       
+       vec3_t          punchvector;    // LordHavoc: origin view kick
+
 // pitch drifting vars
        float           idealpitch;
        float           pitchvel;
@@ -188,17 +175,19 @@ typedef struct
        qboolean        paused;                 // send over by server
        qboolean        onground;
        qboolean        inwater;
-       
+
        int                     intermission;   // don't change view angle, full screen, etc
        int                     completed_time; // latched at intermission start
-       
+
        double          mtime[2];               // the timestamp of last two messages   
        double          time;                   // clients view of time, should be between
                                                                // servertime and oldservertime to generate
                                                                // a lerp point for other data
        double          oldtime;                // previous cl.time, time-oldtime is used
                                                                // to decay light values and smooth step ups
-       
+
+       double          frametime;
+
 
        float           last_received_message;  // (realtime) for net trouble icon
 
@@ -215,8 +204,7 @@ typedef struct
 
 // refresh related state
        struct model_s  *worldmodel;    // cl_entitites[0].model
-       struct efrag_s  *free_efrags;
-       int                     num_entities;   // held in cl_entities array
+//     int                     num_entities;   // held in cl_entities array
        int                     num_statics;    // held in cl_staticentities array
        entity_t        viewent;                        // the gun model
 
@@ -224,80 +212,84 @@ typedef struct
 
 // frag scoreboard
        scoreboard_t    *scores;                // [cl.maxclients]
-} client_state_t;
+}
+client_state_t;
 
 
 //
 // cvars
 //
-extern cvar_t  cl_name;
-extern cvar_t  cl_color;
+extern cvar_t cl_name;
+extern cvar_t cl_color;
+extern cvar_t cl_pmodel;
 
-extern cvar_t  cl_upspeed;
-extern cvar_t  cl_forwardspeed;
-extern cvar_t  cl_backspeed;
-extern cvar_t  cl_sidespeed;
+extern cvar_t cl_upspeed;
+extern cvar_t cl_forwardspeed;
+extern cvar_t cl_backspeed;
+extern cvar_t cl_sidespeed;
 
-extern cvar_t  cl_movespeedkey;
+extern cvar_t cl_movespeedkey;
 
-extern cvar_t  cl_yawspeed;
-extern cvar_t  cl_pitchspeed;
+extern cvar_t cl_yawspeed;
+extern cvar_t cl_pitchspeed;
 
-extern cvar_t  cl_anglespeedkey;
+extern cvar_t cl_anglespeedkey;
 
-extern cvar_t  cl_autofire;
+extern cvar_t cl_autofire;
 
-extern cvar_t  cl_shownet;
-extern cvar_t  cl_nolerp;
+extern cvar_t cl_shownet;
+extern cvar_t cl_nolerp;
 
-extern cvar_t  cl_pitchdriftspeed;
-extern cvar_t  lookspring;
-extern cvar_t  lookstrafe;
-extern cvar_t  sensitivity;
+extern cvar_t cl_pitchdriftspeed;
+extern cvar_t lookspring;
+extern cvar_t lookstrafe;
+extern cvar_t sensitivity;
 
-extern cvar_t  m_pitch;
-extern cvar_t  m_yaw;
-extern cvar_t  m_forward;
-extern cvar_t  m_side;
+extern cvar_t freelook;
 
+extern cvar_t m_pitch;
+extern cvar_t m_yaw;
+extern cvar_t m_forward;
+extern cvar_t m_side;
 
-#define        MAX_TEMP_ENTITIES       64                      // lightning bolts, etc
-#define        MAX_STATIC_ENTITIES     128                     // torches, etc
 
-extern client_state_t  cl;
+// LordHavoc: raised these from 64 and 128 to 512 and 256
+#define        MAX_TEMP_ENTITIES       512                     // lightning bolts, effects, etc
+#define        MAX_STATIC_ENTITIES     256                     // torches, etc
+
+extern client_state_t cl;
 
 // FIXME, allocate dynamically
-extern efrag_t                 cl_efrags[MAX_EFRAGS];
 extern entity_t                cl_entities[MAX_EDICTS];
 extern entity_t                cl_static_entities[MAX_STATIC_ENTITIES];
 extern lightstyle_t    cl_lightstyle[MAX_LIGHTSTYLES];
-extern dlight_t                cl_dlights[MAX_DLIGHTS];
 extern entity_t                cl_temp_entities[MAX_TEMP_ENTITIES];
 extern beam_t                  cl_beams[MAX_BEAMS];
 
 //=============================================================================
 
+#include "cl_light.h"
+
 //
 // cl_main
 //
-dlight_t *CL_AllocDlight (int key);
-void   CL_DecayLights (void);
 
-void CL_Init (void);
+extern void CL_Init (void);
 
-void CL_EstablishConnection (char *host);
-void CL_Signon1 (void);
-void CL_Signon2 (void);
-void CL_Signon3 (void);
-void CL_Signon4 (void);
+extern void CL_EstablishConnection (char *host);
+extern void CL_Signon1 (void);
+extern void CL_Signon2 (void);
+extern void CL_Signon3 (void);
+extern void CL_Signon4 (void);
 
-void CL_Disconnect (void);
-void CL_Disconnect_f (void);
-void CL_NextDemo (void);
+extern void CL_Disconnect (void);
+extern void CL_Disconnect_f (void);
+extern void CL_NextDemo (void);
 
-#define                        MAX_VISEDICTS   256
-extern int                             cl_numvisedicts;
-extern entity_t                *cl_visedicts[MAX_VISEDICTS];
+// LordHavoc: raised this from 256 to the maximum possible number of entities visible
+#define MAX_VISEDICTS (MAX_EDICTS + MAX_STATIC_ENTITIES + MAX_TEMP_ENTITIES)
+extern int                     cl_numvisedicts;
+extern entity_t        *cl_visedicts[MAX_VISEDICTS];
 
 //
 // cl_input
@@ -306,62 +298,69 @@ typedef struct
 {
        int             down[2];                // key nums holding it down
        int             state;                  // low bit is down state
-} kbutton_t;
+}
+kbutton_t;
 
 extern kbutton_t       in_mlook, in_klook;
 extern         kbutton_t       in_strafe;
 extern         kbutton_t       in_speed;
 
-void CL_InitInput (void);
-void CL_SendCmd (void);
-void CL_SendMove (usercmd_t *cmd);
+extern void CL_InitInput (void);
+extern void CL_SendCmd (void);
+extern void CL_SendMove (usercmd_t *cmd);
+
+extern void CL_ParseTEnt (void);
+extern void CL_UpdateTEnts (void);
+extern void CL_DoEffects (void);
+
+extern entity_t *CL_NewTempEntity (void);
 
-void CL_ParseTEnt (void);
-void CL_UpdateTEnts (void);
+extern void CL_Effect(vec3_t org, int modelindex, int startframe, int framecount, float framerate);
 
-void CL_ClearState (void);
+extern void CL_ClearState (void);
 
 
-int  CL_ReadFromServer (void);
-void CL_WriteToServer (usercmd_t *cmd);
-void CL_BaseMove (usercmd_t *cmd);
+extern int  CL_ReadFromServer (void);
+extern void CL_WriteToServer (usercmd_t *cmd);
+extern void CL_BaseMove (usercmd_t *cmd);
 
 
-float CL_KeyState (kbutton_t *key);
-char *Key_KeynumToString (int keynum);
+extern float CL_KeyState (kbutton_t *key);
+extern char *Key_KeynumToString (int keynum);
 
 //
 // cl_demo.c
 //
-void CL_StopPlayback (void);
-int CL_GetMessage (void);
+extern void CL_StopPlayback (void);
+extern int CL_GetMessage (void);
 
-void CL_Stop_f (void);
-void CL_Record_f (void);
-void CL_PlayDemo_f (void);
-void CL_TimeDemo_f (void);
+extern void CL_Stop_f (void);
+extern void CL_Record_f (void);
+extern void CL_PlayDemo_f (void);
+extern void CL_TimeDemo_f (void);
 
 //
 // cl_parse.c
 //
-void CL_ParseServerMessage (void);
-void CL_NewTranslation (int slot);
+extern void CL_Parse_Init(void);
+extern void CL_ParseServerMessage(void);
+extern void CL_BitProfile_f(void);
 
 //
 // view
 //
-void V_StartPitchDrift (void);
-void V_StopPitchDrift (void);
+extern void V_StartPitchDrift (void);
+extern void V_StopPitchDrift (void);
 
-void V_RenderView (void);
-void V_UpdatePalette (void);
-void V_Register (void);
-void V_ParseDamage (void);
-void V_SetContentsColor (int contents);
+extern void V_RenderView (void);
+extern void V_UpdateBlends (void);
+extern void V_Register (void);
+extern void V_ParseDamage (void);
+extern void V_SetContentsColor (int contents);
 
 
 //
 // cl_tent
 //
-void CL_InitTEnts (void);
-void CL_SignonReply (void);
+extern void CL_InitTEnts (void);
+extern void CL_SignonReply (void);