]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - model_brush.h
improved pr_fields command to list how many entities are using each entity field...
[xonotic/darkplaces.git] / model_brush.h
index 554a5980aff16cb4a7619f03058f117f1b2a2506..fdc69165e7ec50614a0c04f36a331799318ad88f 100644 (file)
@@ -57,17 +57,30 @@ mplane_t;
 
 typedef struct texture_s
 {
-       char                            name[16];
-       unsigned                        width, height;
-       int                                     flags;                          // LordHavoc: SURF_ flags
-
-       rtexture_t                      *texture;
-       rtexture_t                      *glowtexture;
-       rtexture_t                      *fogtexture;            // alpha-only version of main texture
-
-       int                                     anim_total;                     // total frames in sequence (< 2 = not animated)
-       struct texture_s        *anim_frames[10];       // LordHavoc: direct pointers to each of the frames in the sequence
-       struct texture_s        *alternate_anims;       // bmodels in frame 1 use these
+       // name
+       char name[16];
+       // size
+       unsigned int width, height;
+       // SURF_ flags
+       unsigned int flags;
+
+       // base texture without fullbrights, never NULL
+       rtexture_t *texture;
+       // fullbrights texture, NULL if no fullbrights used
+       rtexture_t *glowtexture;
+       // alpha texture (used for fogging), NULL if opaque
+       rtexture_t *fogtexture;
+       // detail texture (usually not used if transparent)
+       rtexture_t *detailtexture;
+
+       // total frames in sequence and alternate sequence
+       int anim_total[2];
+       // direct pointers to each of the frames in the sequences
+       // (indexed as [alternate][frame])
+       struct texture_s *anim_frames[2][10];
+       // set if animated or there is an alternate frame set
+       // (this is an optimization in the renderer)
+       int animated;
 }
 texture_t;
 
@@ -105,6 +118,8 @@ typedef struct surfvertex_s
        float st[2];
        // lightmap coordinates
        float uv[2];
+       // detail texture coordinates
+       float ab[2];
 }
 surfvertex_t;
 
@@ -161,6 +176,8 @@ typedef struct msurface_s
        // no texcoord info (that can be generated from these)
        int                     poly_numverts;
        float           *poly_verts;
+       // the center is useful for sorting
+       float           poly_center[3];
 
        // these are regenerated every frame
        // lighting info
@@ -189,10 +206,11 @@ msurface_t;
 #define SHADERSTAGE_NORMAL 1
 #define SHADERSTAGE_COUNT 2
 
+struct entity_render_s;
 // change this stuff when real shaders are added
 typedef struct Cshader_s
 {
-       void (*shaderfunc[SHADERSTAGE_COUNT])(msurface_t *firstsurf);
+       void (*shaderfunc[SHADERSTAGE_COUNT])(const struct entity_render_s *ent, const msurface_t *firstsurf);
        // list of surfaces using this shader (used during surface rendering)
        msurface_t *chain;
 }