discard empty meshes from md3s

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@2602 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
Lee Salzman
2008-09-15 00:32:43 +00:00
parent e9ac09e5b7
commit c64c04eb71
+9 -3
View File
@@ -93,13 +93,19 @@ struct md3 : vertmodel
int mesh_offset = header.ofs_meshes;
loopi(header.nummeshes)
{
mesh &m = *meshes.add(new mesh);
m.owner = this;
md3meshheader mheader;
fseek(f, mesh_offset, SEEK_SET);
fread(&mheader, sizeof(md3meshheader), 1, f);
endianswap(&mheader.flags, sizeof(int), 10);
endianswap(&mheader.flags, sizeof(int), 10);
if(mheader.numtriangles <= 0)
{
mesh_offset += mheader.meshsize;
continue;
}
mesh &m = *meshes.add(new mesh);
m.owner = this;
m.name = newstring(mheader.name);
m.numtris = mheader.numtriangles;