]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - model_brush.h
eliminated surf->poly_* fields and cleaned up Mod_LoadFaces a great deal
[xonotic/darkplaces.git] / model_brush.h
index 535676822fdd0a341154b360c99b852311fc2095..e77d40881854236e35bbde1dcfcfd7ceb9ff7ed0 100644 (file)
@@ -29,6 +29,8 @@ BRUSH MODELS
 ==============================================================================
 */
 
+#define Q3PATHLENGTH 64
+
 
 //
 // in memory representation
@@ -79,8 +81,9 @@ struct msurface_s;
 
 typedef struct texture_s
 {
+       // q1bsp
        // name
-       char name[16];
+       //char name[16];
        // size
        unsigned int width, height;
        // SURF_ flags
@@ -104,6 +107,16 @@ typedef struct texture_s
        struct texture_s *currentframe;
        // current alpha of the texture
        float currentalpha;
+
+       // q3bsp
+       char name[Q3PATHLENGTH];
+       char firstpasstexturename[Q3PATHLENGTH]; // used only during loading
+       int surfaceflags;
+       int supercontents;
+       int surfaceparms;
+       int textureflags;
+
+       //skinframe_t skin;
 }
 texture_t;
 
@@ -124,8 +137,8 @@ mtexinfo_t;
 typedef struct msurface_s
 {
        // bounding box for onscreen checks
-       vec3_t poly_mins;
-       vec3_t poly_maxs;
+       vec3_t mins;
+       vec3_t maxs;
 
        // the node plane this is on, backwards if SURF_PLANEBACK flag set
        mplane_t *plane;
@@ -144,9 +157,6 @@ typedef struct msurface_s
        // surface number, to avoid having to do a divide to find the number of a surface from it's address
        int number;
 
-       // center for sorting transparent meshes
-       vec3_t poly_center;
-
        // index into d_lightstylevalue array, 255 means not used (black)
        qbyte styles[MAXLIGHTMAPS];
        // RGB lighting data [numstyles][height][width][3]
@@ -169,16 +179,9 @@ typedef struct msurface_s
        // avoid multiple collision traces with a surface polygon
        int colframe;
 
-       // these are just 3D points defining the outline of the polygon,
-       // no texcoord info (that can be generated from these)
-       int poly_numverts;
-       float *poly_verts;
-
        // index into model->brush.shadowmesh
        int num_firstshadowmeshtriangle;
 
-       // neighboring surfaces (one per poly_numverts)
-       //struct msurface_s **neighborsurfaces;
        // currently used only for generating static shadow volumes
        int lighttemp_castshadow;
 
@@ -514,8 +517,6 @@ typedef struct
 #define        Q3LUMP_PVS                      16 // potentially visible set; bit[clusters][clusters] (used by rendering)
 #define        Q3HEADER_LUMPS          17
 
-#define Q3PATHLENGTH 64
-
 typedef struct
 {
        int                     ident;
@@ -772,18 +773,6 @@ q3dpvs_t;
 #define Q3TEXTUREFLAG_ALPHATEST 64
 
 struct q3msurface_s;
-typedef struct q3mtexture_s
-{
-       char name[Q3PATHLENGTH];
-       char firstpasstexturename[Q3PATHLENGTH];
-       int surfaceflags;
-       int supercontents;
-       int surfaceparms;
-       int textureflags;
-
-       skinframe_t skin;
-}
-q3mtexture_t;
 
 typedef struct q3mmodel_s
 {
@@ -801,14 +790,14 @@ typedef struct q3mbrush_s
        struct colbrushf_s *colbrushf;
        int numbrushsides;
        struct q3mbrushside_s *firstbrushside;
-       struct q3mtexture_s *texture;
+       struct texture_s *texture;
 }
 q3mbrush_t;
 
 typedef struct q3mbrushside_s
 {
        struct mplane_s *plane;
-       struct q3mtexture_s *texture;
+       struct texture_s *texture;
 }
 q3mbrushside_t;
 
@@ -822,16 +811,17 @@ q3meffect_t;
 
 typedef struct q3msurface_s
 {
+       // bounding box for culling
+       vec3_t mins;
+       vec3_t maxs;
+
        // FIXME: collisionmarkframe should be kept in a separate array
        // FIXME: shadowmark should be kept in a separate array
 
-       struct q3mtexture_s *texture;
+       struct texture_s *texture;
        struct q3meffect_s *effect;
        rtexture_t *lightmaptexture;
        int collisionmarkframe; // don't collide twice in one trace
-       // bounding box for culling
-       float mins[3];
-       float maxs[3];
 
        surfmesh_t mesh;