]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
hide the R_Mesh_Draw message unless developer is 100 or a vertex/face count is even...
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 5 Jan 2009 03:12:03 +0000 (03:12 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 5 Jan 2009 03:12:03 +0000 (03:12 +0000)
instead, complain about empty surfaces when loading a Q3BSP map
as this seems to happen on some maps written by q3map2

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@8624 d7cf8633-e32d-0410-b094-e92efae38249

gl_backend.c
model_brush.c

index fa0aba57999ad42dfa2d22200b134a8cb3826a27..d953b47b92f46ee19a1671f07183ee457b9fec83 100644 (file)
@@ -1090,7 +1090,8 @@ void R_Mesh_Draw(int firstvertex, int numvertices, int firsttriangle, int numtri
        unsigned int numelements = numtriangles * 3;
        if (numvertices < 3 || numtriangles < 1)
        {
-               Con_Printf("R_Mesh_Draw(%d, %d, %d, %d, %8p, %8p, %i, %i);\n", firstvertex, numvertices, firsttriangle, numtriangles, element3i, element3s, bufferobject3i, bufferobject3s);
+               if (numvertices < 0 || numtriangles < 0 || developer.integer >= 100)
+                       Con_Printf("R_Mesh_Draw(%d, %d, %d, %d, %8p, %8p, %i, %i);\n", firstvertex, numvertices, firsttriangle, numtriangles, element3i, element3s, bufferobject3i, bufferobject3s);
                return;
        }
        if (!gl_mesh_prefer_short_elements.integer)
index 92c9f154ea04502cc37d6308ce63b4830601cc1a..cd22a2bb775720ee2cbc8d5d74e0859b5a04c2a4 100644 (file)
@@ -5184,6 +5184,18 @@ static void Mod_Q3BSP_LoadFaces(lump_t *l)
                //out->lightmapinfo->styles[3] = 255;
        }
 
+       i = oldi;
+       out = oldout;
+       for (;i < count;i++, out++)
+       {
+               if(out->num_vertices && out->num_triangles)
+                       continue;
+               if(out->num_vertices == 0)
+                       Con_Printf("Mod_Q3BSP_LoadFaces: surface %d has no vertices, ignoring\n", i);
+               if(out->num_triangles == 0)
+                       Con_Printf("Mod_Q3BSP_LoadFaces: surface %d has no triangles, ignoring\n", i);
+       }
+
        // for per pixel lighting
        Mod_BuildTextureVectorsFromNormals(0, loadmodel->surfmesh.num_vertices, loadmodel->surfmesh.num_triangles, loadmodel->surfmesh.data_vertex3f, loadmodel->surfmesh.data_texcoordtexture2f, loadmodel->surfmesh.data_normal3f, loadmodel->surfmesh.data_element3i, loadmodel->surfmesh.data_svector3f, loadmodel->surfmesh.data_tvector3f, true);