]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - model_shared.h
added R_Mesh_Draw_ShowTris function which draws a triangle mesh as lines
[xonotic/darkplaces.git] / model_shared.h
index bd73c39add597386f808df8c632cdbb27da7c105..cb8a15015a494bb5a87a7a3fd9cdf8d78dfc8bba 100644 (file)
@@ -159,7 +159,6 @@ typedef struct model_brush_s
        int (*BoxTouchingPVS)(struct model_s *model, const qbyte *pvs, const vec3_t mins, const vec3_t maxs);
        void (*LightPoint)(struct model_s *model, const vec3_t p, vec3_t ambientcolor, vec3_t diffusecolor, vec3_t diffusenormal);
        void (*FindNonSolidLocation)(struct model_s *model, const vec3_t in, vec3_t out, vec_t radius);
-       void (*TraceBox)(struct model_s *model, struct trace_s *trace, const vec3_t boxstartmins, const vec3_t boxstartmaxs, const vec3_t boxendmins, const vec3_t boxendmaxs, int hitsupercontentsmask);
        // these are actually only found on brushq1, but NULL is handled gracefully
        void (*AmbientSoundLevelsForPoint)(struct model_s *model, const vec3_t p, qbyte *out, int outsize);
        void (*RoundUpToHullSize)(struct model_s *cmodel, const vec3_t inmins, const vec3_t inmaxs, vec3_t outmins, vec3_t outmaxs);
@@ -202,7 +201,6 @@ typedef struct model_brushq1_s
        int                             *surfacepvsframes;
        msurface_t              *surfacepvsnext;
        surfmesh_t              *entiremesh;
-       surfmesh_t              *surfmeshes;
 
        int                             numsurfedges;
        int                             *surfedges;
@@ -269,6 +267,7 @@ model_brushq2_t;
 */
 
 #define Q3MTEXTURERENDERFLAGS_NODRAW 1
+#define Q3MTEXTURERENDERFLAGS_SKY 2
 
 typedef struct q3mtexture_s
 {
@@ -357,15 +356,18 @@ typedef struct q3mface_s
        int collisionmarkframe; // don't collide twice in one trace
        int type;
        int firstvertex;
-       int numvertices;
        int firstelement;
-       int numelements;
        int patchsize[2];
+       // used for processing
        int markframe;
+       // (world only) visframe == r_framecount means it is visible this frame
+       int visframe;
        // bounding box for culling
        float mins[3];
        float maxs[3];
 
+       int num_vertices;
+       int num_triangles;
        float *data_vertex3f;
        float *data_texcoordtexture2f;
        float *data_texcoordlightmap2f;
@@ -373,7 +375,6 @@ typedef struct q3mface_s
        float *data_tvector3f;
        float *data_normal3f;
        float *data_color4f;
-       int numtriangles;
        int *data_element3i;
        int *data_neighbor3i;
 }
@@ -511,12 +512,12 @@ typedef struct model_s
        void(*DrawSky)(struct entity_render_s *ent);
        // draw the model using lightmap/dlight shading
        void(*Draw)(struct entity_render_s *ent);
-       // draw a fake shadow for the model
-       void(*DrawFakeShadow)(struct entity_render_s *ent);
        // draw a shadow volume for the model based on light source
        void(*DrawShadowVolume)(struct entity_render_s *ent, vec3_t relativelightorigin, float lightradius);
        // draw the lighting on a model (through stencil)
        void(*DrawLight)(struct entity_render_s *ent, vec3_t relativelightorigin, vec3_t relativeeyeorigin, float lightradius, float *lightcolor, const matrix4x4_t *matrix_modeltofilter, const matrix4x4_t *matrix_modeltoattenuationxyz, const matrix4x4_t *matrix_modeltoattenuationz);
+       // trace a box against this model
+       void (*TraceBox)(struct model_s *model, int frame, struct trace_s *trace, const vec3_t boxstartmins, const vec3_t boxstartmaxs, const vec3_t boxendmins, const vec3_t boxendmaxs, int hitsupercontentsmask);
        // fields belonging to each type of model
        model_alias_t   alias;
        model_sprite_t  sprite;
@@ -528,6 +529,8 @@ typedef struct model_s
        model_brushq3_t brushq3;
        // skin files can have different tags for each skin
        overridetagnameset_t    *data_overridetagnamesforskin;
+       // flags this model for offseting sounds to the model center (used by brush models)
+       int soundfromcenter;
 }
 model_t;
 
@@ -540,6 +543,8 @@ extern rtexture_t *mod_shared_detailtextures[NUM_DETAILTEXTURES];
 // every texture must be in a pool...
 extern rtexturepool_t *mod_shared_texturepool;
 
+extern rtexture_t *mod_shared_distorttexture[64];
+
 // model loading
 extern model_t *loadmodel;
 extern qbyte *mod_base;