// color and initial alpha value
float texcoord2f[3][2];
float vertex3f[3][3];
- unsigned char color4ub[3][4];
+ float color4f[3][4];
+ float plane[4]; // backface culling
// how long this decal has lived so far (the actual fade begins at cl_decals_time)
float lived;
// if >= 0 this indicates the decal should follow an animated triangle
}
beam_t;
+typedef struct rtlight_particle_s
+{
+ float origin[3];
+ float color[3];
+}
+rtlight_particle_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
/// masks of all shadowmap sides that have any potential static receivers or casters
int static_shadowmap_receivers;
int static_shadowmap_casters;
+ /// particle-tracing cache for global illumination
+ int particlecache_numparticles;
+ int particlecache_maxparticles;
+ int particlecache_updateparticle;
+ rtlight_particle_t *particlecache_particles;
+
+ /// bouncegrid light info
+ float photoncolor[3];
+ float photons;
}
rtlight_t;
}
dlight_t;
-#define MAX_FRAMEGROUPBLENDS 4
-typedef struct framegroupblend_s
-{
- // animation number and blend factor
- // (for most models this is the frame number)
- int frame;
- float lerp;
- // time frame began playing (for framegroup animations)
- double start;
-}
-framegroupblend_t;
-
// this is derived from processing of the framegroupblend array
// note: technically each framegroupblend can produce two of these, but that
// never happens in practice because no one blends between more than 2
float *animcache_svector3f;
float *animcache_tvector3f;
// interleaved arrays for rendering and dynamic vertex buffers for them
- r_vertexposition_t *animcache_vertexposition;
- r_meshbuffer_t *animcache_vertexpositionbuffer;
+ r_meshbuffer_t *animcache_vertex3fbuffer;
r_vertexmesh_t *animcache_vertexmesh;
r_meshbuffer_t *animcache_vertexmeshbuffer;
double last_trace_visibility;
// user wavefunc parameters (from csqc)
- float userwavefunc_param[Q3WAVEFUNC_USER_COUNT];
+ vec_t userwavefunc_param[Q3WAVEFUNC_USER_COUNT];
}
entity_render_t;
typedef struct entity_persistent_s
{
- vec3_t trail_origin;
-
- // particle trail
- float trail_time;
+ vec3_t trail_origin; // previous position for particle trail spawning
+ vec3_t oldorigin; // lerp
+ vec3_t oldangles; // lerp
+ vec3_t neworigin; // lerp
+ vec3_t newangles; // lerp
+ vec_t lerpstarttime; // lerp
+ vec_t lerpdeltatime; // lerp
+ float muzzleflash; // muzzleflash intensity, fades over time
+ float trail_time; // residual error accumulation for particle trail spawning (to keep spacing across frames)
qboolean trail_allowed; // set to false by teleports, true by update code, prevents bad lerps
-
- // muzzleflash fading
- float muzzleflash;
-
- // interpolated movement
-
- // start time of move
- float lerpstarttime;
- // time difference from start to end of move
- float lerpdeltatime;
- // the move itself, start and end
- float oldorigin[3];
- float oldangles[3];
- float neworigin[3];
- float newangles[3];
}
entity_persistent_t;
typedef enum capturevideoformat_e
{
CAPTUREVIDEOFORMAT_AVI_I420,
- CAPTUREVIDEOFORMAT_OGG_VORBIS_THEORA,
+ CAPTUREVIDEOFORMAT_OGG_VORBIS_THEORA
}
capturevideoformat_t;
const char *formatextension;
qfile_t *videofile;
// always use this:
- // cls.capturevideo.videofile = FS_OpenRealFile(va("%s.%s", cls.capturevideo.basename, cls.capturevideo.formatextension), "wb", false);
+ // cls.capturevideo.videofile = FS_OpenRealFile(va(vabuf, sizeof(vabuf), "%s.%s", cls.capturevideo.basename, cls.capturevideo.formatextension), "wb", false);
void (*endvideo) (void);
void (*videoframes) (int num);
void (*soundframe) (const portable_sampleframe_t *paintbuffer, size_t length);
fs_offset_t demo_lastcsprogssize;
int demo_lastcsprogscrc;
qboolean demoplayback;
+ qboolean demostarting; // set if currently starting a demo, to stop -demo from quitting when switching to another demo
qboolean timedemo;
// -1 = use normal cd track
int forcetrack;
// password spectator name team skin topcolor bottomcolor rate noaim msg *ver *ip
char userinfo[MAX_USERINFO_STRING];
+ // extra user info for the "connect" command
+ char connect_userinfo[MAX_USERINFO_STRING];
+
// video capture stuff
capturevideostate_t capturevideo;
+
+ // crypto channel
+ crypto_t crypto;
+
+ // ProQuake compatibility stuff
+ int proquake_servermod; // 0 = not proquake, 1 = proquake
+ int proquake_serverversion; // actual proquake server version * 10 (3.40 = 34, etc)
+ int proquake_serverflags; // 0 (PQF_CHEATFREE not supported)
+
+ // don't write-then-read csprogs.dat (useful for demo playback)
+ unsigned char *caughtcsprogsdata;
+ fs_offset_t caughtcsprogsdatasize;
}
client_static_t;
double lastongroundtime;
double hitgroundtime;
float bob2_smooth;
-
- float ground_hit_speed;
- float ground_hit_counter;
+ float bobfall_speed;
+ float bobfall_swing;
+ double calcrefdef_prevtime;
// don't change view angle, full screen, etc
int intermission;
float movevars_maxairspeed;
float movevars_stepheight;
float movevars_airaccel_qw;
+ float movevars_airaccel_qw_stretchfactor;
float movevars_airaccel_sideways_friction;
float movevars_airstopaccelerate;
float movevars_airstrafeaccelerate;
float movevars_airstrafeaccel_qw;
float movevars_aircontrol;
float movevars_aircontrol_power;
+ float movevars_aircontrol_penalty;
float movevars_warsowbunny_airforwardaccel;
float movevars_warsowbunny_accel;
float movevars_warsowbunny_topspeed;
// server entity number corresponding to a clientside entity
unsigned short csqc_server2csqcentitynumber[MAX_EDICTS];
qboolean csqc_loaded;
- vec3_t csqc_origin;
- vec3_t csqc_angles;
+ vec3_t csqc_vieworigin;
+ vec3_t csqc_viewangles;
+ vec3_t csqc_vieworiginfromengine;
+ vec3_t csqc_viewanglesfromengine;
+ matrix4x4_t csqc_viewmodelmatrixfromengine;
qboolean csqc_usecsqclistener;
matrix4x4_t csqc_listenermatrix;
char csqc_printtextbuf[MAX_INPUTLINE];
// freed on each level change
size_t buildlightmapmemorysize;
unsigned char *buildlightmapmemory;
+
+ // used by EntityState5_ReadUpdate
+ skeleton_t *engineskeletonobjects;
}
client_state_t;
void CL_Shutdown (void);
void CL_Init (void);
-void CL_EstablishConnection(const char *host);
+void CL_EstablishConnection(const char *host, int firstarg);
void CL_Disconnect (void);
void CL_Disconnect_f (void);
float CL_KeyState (kbutton_t *key);
-const char *Key_KeynumToString (int keynum);
+const char *Key_KeynumToString (int keynum, char *buf, size_t buflength);
int Key_StringToKeynum (const char *str);
//
void V_StopPitchDrift (void);
void V_Init (void);
-float V_CalcRoll (vec3_t angles, vec3_t velocity);
+float V_CalcRoll (const vec3_t angles, const vec3_t velocity);
void V_UpdateBlends (void);
void V_ParseDamage (void);
int particles;
int drawndecals;
int totaldecals;
- int meshes;
- int meshes_elements;
+ int draws;
+ int draws_vertices;
+ int draws_elements;
int lights;
int lights_clears;
int lights_scissored;
int lights_lighttriangles;
int lights_shadowtriangles;
int lights_dynamicshadowtriangles;
+ int bouncegrid_lights;
+ int bouncegrid_particles;
+ int bouncegrid_traces;
+ int bouncegrid_hits;
+ int bouncegrid_splats;
+ int bouncegrid_bounces;
+ int collisioncache_animated;
+ int collisioncache_cached;
+ int collisioncache_traced;
int bloom;
int bloom_copypixels;
int bloom_drawpixels;
int indexbufferuploadsize;
int vertexbufferuploadcount;
int vertexbufferuploadsize;
+ int framedatacurrent;
+ int framedatasize;
}
r_refdef_stats_t;
int width;
int height;
int depth;
- r_viewport_t viewport;
+ r_viewport_t viewport; // note: if r_viewscale is used, the viewport.width and viewport.height may be less than width and height
// which color components to allow (for anaglyph glasses)
int colormask[4];
- // global RGB color multiplier for rendering, this is required by HDR
+ // global RGB color multiplier for rendering
float colorscale;
// whether to call R_ClearScreen before rendering stuff
qboolean clear;
// if true, don't clear or do any post process effects (bloom, etc)
qboolean isoverlay;
+ // if true, this is the MAIN view (which is, after CSQC, copied into the scene for use e.g. by r_speeds 1, showtex, prydon cursor)
+ qboolean ismain;
// whether to draw r_showtris and such, this is only true for the main
- // view render, all secondary renders (HDR, mirrors, portals, cameras,
+ // view render, all secondary renders (mirrors, portals, cameras,
// distortion effects, etc) omit such debugging information
qboolean showdebug;
entity_render_t *tempentities;
int numtempentities;
int maxtempentities;
+ qboolean expandtempentities;
// renderable dynamic lights
rtlight_t *lights[MAX_DLIGHTS];
float fog_height_texcoordscale;
char fogheighttexturename[64]; // detects changes to active fog height texture
- qboolean draw2dstage;
+ int draw2dstage; // 0 = no, 1 = yes, other value = needs setting up again
// true during envmap command capture
qboolean envmap;
float shadowpolygonfactor;
float shadowpolygonoffset;
+ // how long R_RenderView took on the previous frame
+ double lastdrawscreentime;
+
// rendering stats for r_speeds display
// (these are incremented in many places)
r_refdef_stats_t stats;
extern r_refdef_t r_refdef;
+typedef enum waterlevel_e
+{
+ WATERLEVEL_NONE,
+ WATERLEVEL_WETFEET,
+ WATERLEVEL_SWIMMING,
+ WATERLEVEL_SUBMERGED
+}
+waterlevel_t;
+
+typedef struct cl_clientmovement_state_s
+{
+ // entity to be ignored for movement
+ struct prvm_edict_s *self;
+ // position
+ vec3_t origin;
+ vec3_t velocity;
+ // current bounding box (different if crouched vs standing)
+ vec3_t mins;
+ vec3_t maxs;
+ // currently on the ground
+ qboolean onground;
+ // currently crouching
+ qboolean crouched;
+ // what kind of water (SUPERCONTENTS_LAVA for instance)
+ int watertype;
+ // how deep
+ waterlevel_t waterlevel;
+ // weird hacks when jumping out of water
+ // (this is in seconds and counts down to 0)
+ float waterjumptime;
+
+ // user command
+ usercmd_t cmd;
+}
+cl_clientmovement_state_t;
+void CL_ClientMovement_PlayerMove_Frame(cl_clientmovement_state_t *s);
+
+// warpzone prediction hack (CSQC builtin)
+void CL_RotateMoves(const matrix4x4_t *m);
+
+void CL_NewFrameReceived(int num);
+void CL_ParseEntityLump(char *entitystring);
+void CL_FindNonSolidLocation(const vec3_t in, vec3_t out, vec_t radius);
+void CL_RelinkLightFlashes(void);
+void Sbar_ShowFPS(void);
+void Sbar_ShowFPS_Update(void);
+void Host_SaveConfig(void);
+void Host_LoadConfig_f(void);
+void CL_UpdateMoveVars(void);
+void SCR_CaptureVideo_SoundFrame(const portable_sampleframe_t *paintbuffer, size_t length);
+void V_DriftPitch(void);
+void V_FadeViewFlashs(void);
+void V_CalcViewBlend(void);
+void V_CalcRefdefUsing (const matrix4x4_t *entrendermatrix, const vec3_t clviewangles, qboolean teleported, qboolean clonground, qboolean clcmdjump, float clstatsviewheight, qboolean cldead, qboolean clintermission, const vec3_t clvelocity);
+void V_CalcRefdef(void);
+void CL_Locs_Reload_f(void);
+
#endif