]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - client.h
optimized SHOWLMP code (only used by Nehahra) to not eat any CPU time
[xonotic/darkplaces.git] / client.h
index 329d192c4977c5dfbbfb2a2eafe2febb7a2775f3..559d0e94c3a38a4584d41f72ed4b0faf5bac357c 100644 (file)
--- a/client.h
+++ b/client.h
@@ -243,8 +243,6 @@ typedef struct entity_render_s
 
        // NULL = no model
        model_t *model;
-       // current uninterpolated animation frame (for things which do not use interpolation)
-       int frame;
        // number of the entity represents, or 0 for non-network entities
        int entitynumber;
        // entity shirt and pants colors (-1 if not colormapped)
@@ -443,6 +441,13 @@ typedef struct capturevideostate_s
        fs_offset_t videofile_totalframes_offset1;
        fs_offset_t videofile_totalframes_offset2;
        fs_offset_t videofile_totalsampleframes_offset;
+       int videofile_ix_master_audio_inuse;
+       fs_offset_t videofile_ix_master_audio_inuse_offset;
+       fs_offset_t videofile_ix_master_audio_start_offset;
+       int videofile_ix_master_video_inuse;
+       fs_offset_t videofile_ix_master_video_inuse_offset;
+       fs_offset_t videofile_ix_master_video_start_offset;
+       fs_offset_t videofile_ix_movistart;
        qfile_t *videofile;
        qboolean active;
        qboolean realtime;
@@ -674,6 +679,16 @@ typedef struct cl_locnode_s
 }
 cl_locnode_t;
 
+typedef struct showlmp_s
+{
+       qboolean        isactive;
+       float           x;
+       float           y;
+       char            label[32];
+       char            pic[128];
+}
+showlmp_t;
+
 //
 // the client_state_t structure is wiped completely at every
 // server signon
@@ -898,6 +913,7 @@ typedef struct client_state_s
        int max_lightstyle;
        int max_brushmodel_entities;
        int max_particles;
+       int max_showlmps;
 
        entity_t *entities;
        unsigned char *entities_active;
@@ -909,6 +925,7 @@ typedef struct client_state_s
        lightstyle_t *lightstyle;
        int *brushmodel_entities;
        particle_t *particles;
+       showlmp_t *showlmps;
 
        int num_entities;
        int num_static_entities;
@@ -918,6 +935,7 @@ typedef struct client_state_s
        int num_beams;
        int num_dlights;
        int num_particles;
+       int num_showlmps;
 
        int free_particle;
 
@@ -1399,13 +1417,17 @@ typedef struct r_view_s
        // (as long as R_View_Update is called)
 
        // eye position information
-       matrix4x4_t matrix;
+       matrix4x4_t matrix, inverse_matrix;
        vec3_t origin;
        vec3_t forward;
        vec3_t left;
        vec3_t right;
        vec3_t up;
-       mplane_t frustum[5];
+       int numfrustumplanes;
+       mplane_t frustum[6];
+       qboolean useclipplane;
+       qboolean usecustompvs; // uses r_viewcache.pvsbits as-is rather than computing it
+       mplane_t clipplane;
        float frustum_x, frustum_y;
        vec3_t frustumcorner[4];
        // if turned off it renders an ortho view
@@ -1425,6 +1447,18 @@ typedef struct r_view_s
 
        // global RGB color multiplier for rendering, this is required by HDR
        float colorscale;
+
+       // whether to call R_ClearScreen before rendering stuff
+       qboolean clear;
+
+       // whether to draw r_showtris and such, this is only true for the main
+       // view render, all secondary renders (HDR, mirrors, portals, cameras,
+       // distortion effects, etc) omit such debugging information
+       qboolean showdebug;
+
+       // these define which values to use in GL_CullFace calls to request frontface or backface culling
+       int cullface_front;
+       int cullface_back;
 }
 r_view_t;
 
@@ -1438,11 +1472,11 @@ typedef struct r_viewcache_s
        // flag arrays used for visibility checking on world model
        // (all other entities have no per-surface/per-leaf visibility checks)
        // TODO: dynamic resize according to r_refdef.worldmodel->brush.num_clusters
-       unsigned char world_pvsbits[(32768+7)>>3];
+       unsigned char world_pvsbits[(32768+7)>>3]; // FIXME: buffer overflow on huge maps
        // TODO: dynamic resize according to r_refdef.worldmodel->brush.num_leafs
-       unsigned char world_leafvisible[32768];
+       unsigned char world_leafvisible[32768]; // FIXME: buffer overflow on huge maps
        // TODO: dynamic resize according to r_refdef.worldmodel->num_surfaces
-       unsigned char world_surfacevisible[262144];
+       unsigned char world_surfacevisible[262144]; // FIXME: buffer overflow on huge maps
        // if true, the view is currently in a leaf without pvs data
        qboolean world_novis;
 }