// 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;
// 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;
// neighboring surfaces (one per poly_numverts)
//struct msurface_s **neighborsurfaces;
// currently used only for generating static shadow volumes
- int castshadow;
+ int lighttemp_castshadow;
}
msurface_t;
// used by polygon-through-portals visibility checker
int portalmarkid;
- qbyte *compressed_vis;
+ // decompressed pvs bits (potentially visible set)
+ // note: never NULL, always present, may be full of 0xFF though
+ qbyte *pvsdata;
int *firstmarksurface;
int nummarksurfaces;