]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - model_brush.h
huge (16%) speed gain on surface rendering by eliminating the surfmesh chain in q1bsp...
[xonotic/darkplaces.git] / model_brush.h
index 17e693531f933ea8f48452ac78b134411edf9011..609793c4201eca2c9ed732e835af19e11f11fdda 100644 (file)
@@ -145,20 +145,18 @@ mtexinfo_t;
 // LordHavoc: replaces glpoly, triangle mesh
 typedef struct surfmesh_s
 {
 // LordHavoc: replaces glpoly, triangle mesh
 typedef struct surfmesh_s
 {
-       // can be multiple meshs per surface
-       struct surfmesh_s *chain;
-       int numverts; // number of vertices in the mesh
-       int numtriangles; // number of triangles in the mesh
-       float *vertex3f; // float[verts*3] vertex locations
-       float *svector3f; // float[verts*3] direction of 'S' (right) texture axis for each vertex
-       float *tvector3f; // float[verts*3] direction of 'T' (down) texture axis for each vertex
-       float *normal3f; // float[verts*3] direction of 'R' (out) texture axis for each vertex
-       int *lightmapoffsets; // index into surface's lightmap samples for vertex lighting
-       float *texcoordtexture2f; // float[verts*2] texcoords for surface texture
-       float *texcoordlightmap2f; // float[verts*2] texcoords for lightmap texture
-       float *texcoorddetail2f; // float[verts*2] texcoords for detail texture
-       int *element3i; // int[tris*3] triangles of the mesh, 3 indices into vertex arrays for each
-       int *neighbor3i; // int[tris*3] neighboring triangle on each edge (-1 if none)
+       int num_vertices; // number of vertices in the mesh
+       int num_triangles; // number of triangles in the mesh
+       float *data_vertex3f; // float[verts*3] vertex locations
+       float *data_svector3f; // float[verts*3] direction of 'S' (right) texture axis for each vertex
+       float *data_tvector3f; // float[verts*3] direction of 'T' (down) texture axis for each vertex
+       float *data_normal3f; // float[verts*3] direction of 'R' (out) texture axis for each vertex
+       int *data_lightmapoffsets; // index into surface's lightmap samples for vertex lighting
+       float *data_texcoordtexture2f; // float[verts*2] texcoords for surface texture
+       float *data_texcoordlightmap2f; // float[verts*2] texcoords for lightmap texture
+       float *data_texcoorddetail2f; // float[verts*2] texcoords for detail texture
+       int *data_element3i; // int[tris*3] triangles of the mesh, 3 indices into vertex arrays for each
+       int *data_neighbor3i; // int[tris*3] neighboring triangle on each edge (-1 if none)
 }
 surfmesh_t;
 
 }
 surfmesh_t;
 
@@ -178,7 +176,7 @@ typedef struct msurface_s
        // the lightmap texture fragment to use on the rendering mesh
        rtexture_t *lightmaptexture;
        // mesh for rendering
        // the lightmap texture fragment to use on the rendering mesh
        rtexture_t *lightmaptexture;
        // mesh for rendering
-       surfmesh_t *mesh;
+       surfmesh_t mesh;
        // if lightmap settings changed, this forces update
        int cached_dlight;
 
        // if lightmap settings changed, this forces update
        int cached_dlight;