]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - client.h
first part of fog changes: no longer use a complex glsl equation; modify the table...
[xonotic/darkplaces.git] / client.h
index 3008887dafb7ee5e488381562257ba9508971876..8c3522363fd24dd53056037a07abc29924bc5bae 100644 (file)
--- a/client.h
+++ b/client.h
@@ -226,6 +226,12 @@ frameblend_t;
 
 // LordHavoc: this struct is intended for the renderer but some fields are
 // used by the client.
+//
+// The renderer should not rely on any changes to this struct to be persistent
+// across multiple frames because temp entities are wiped every frame, but it
+// is acceptable to cache things in this struct that are not critical.
+//
+// For example the r_cullentities_trace code does such caching.
 typedef struct entity_render_s
 {
        // location
@@ -245,9 +251,7 @@ typedef struct entity_render_s
        model_t *model;
        // number of the entity represents, or 0 for non-network entities
        int entitynumber;
-       // entity shirt and pants colors (-1 if not colormapped)
-       int colormap;
-       // literal colors for renderer
+       // literal colormap colors for renderer, if both are 0 0 0 it is not colormapped
        vec3_t colormap_pantscolor;
        vec3_t colormap_shirtcolor;
        // light, particles, etc
@@ -282,11 +286,12 @@ typedef struct entity_render_s
        // 4 frame numbers (-1 if not used) and their blending scalers (0-1), if interpolation is not desired, use frame instead
        frameblend_t frameblend[4];
 
-       // current lighting from map
+       // current lighting from map (updated ONLY by client code, not renderer)
        vec3_t modellight_ambient;
        vec3_t modellight_diffuse; // q3bsp
        vec3_t modellight_lightdir; // q3bsp
 
+       // FIELDS UPDATED BY RENDERER:
        // last time visible during trace culling
        double last_trace_visibility;
 }
@@ -507,12 +512,9 @@ typedef struct client_static_s
        // -1 = use normal cd track
        int forcetrack;
        qfile_t *demofile;
-       // to meter out one message a frame
-       int td_lastframe;
-       // host_framecount at start
-       int td_startframe;
        // realtime at second frame of timedemo (LordHavoc: changed to double)
        double td_starttime;
+       int td_frames; // total frames parsed
        double td_onesecondnexttime;
        double td_onesecondframes;
        double td_onesecondminframes;
@@ -1136,6 +1138,7 @@ void CL_Disconnect (void);
 void CL_Disconnect_f (void);
 
 void CL_UpdateRenderEntity(entity_render_t *ent);
+void CL_SetEntityColormapColors(entity_render_t *ent, int colormap);
 void CL_UpdateViewEntities(void);
 
 //
@@ -1231,7 +1234,6 @@ extern cvar_t cl_particles_blood;
 extern cvar_t cl_particles_blood_alpha;
 extern cvar_t cl_particles_blood_bloodhack;
 extern cvar_t cl_particles_bulletimpacts;
-extern cvar_t cl_particles_explosions_smoke;
 extern cvar_t cl_particles_explosions_sparks;
 extern cvar_t cl_particles_explosions_shell;
 extern cvar_t cl_particles_rain;
@@ -1314,11 +1316,9 @@ void Debug_PolygonEnd(void);
 
 extern qboolean sb_showscores;
 
-#define NUMCROSSHAIRS 32
-extern cachepic_t *r_crosshairs[NUMCROSSHAIRS+1];
-
 float FogPoint_World(const vec3_t p);
 float FogPoint_Model(const vec3_t p);
+float FogForDistance(vec_t dist);
 
 typedef struct r_refdef_stats_s
 {
@@ -1329,6 +1329,8 @@ typedef struct r_refdef_stats_s
        int world_portals;
        int world_surfaces;
        int world_triangles;
+       int lightmapupdates;
+       int lightmapupdatepixels;
        int particles;
        int decals;
        int meshes;
@@ -1385,9 +1387,11 @@ typedef struct r_refdef_s
        rtlight_t lights[MAX_DLIGHTS];
        int numlights;
 
+       // intensities for light styles right now, controls rtlights
+       float rtlightstylevalue[256];   // float fraction of base light value
        // 8.8bit fixed point intensities for light styles
-       // controls intensity of dynamic lights and lightmap layers
-       unsigned short  lightstylevalue[256];   // 8.8 fraction of base light value
+       // controls intensity lightmap layers
+       unsigned short lightstylevalue[256];    // 8.8 fraction of base light value
 
        vec3_t fogcolor;
        vec_t fogrange;
@@ -1399,6 +1403,7 @@ typedef struct r_refdef_s
        float fog_red;
        float fog_green;
        float fog_blue;
+       float fog_start, fog_alpha;
        qboolean fogenabled;
        qboolean oldgl_fogenable;