From 6d5f52174b368b45c284b7d88533360cbeaa5352 Mon Sep 17 00:00:00 2001 From: cignoni Date: Tue, 12 Dec 2006 02:47:12 +0000 Subject: [PATCH] Removed use of tellg that is broken in current version of mingw --- wrap/io_trimesh/import_obj.h | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/wrap/io_trimesh/import_obj.h b/wrap/io_trimesh/import_obj.h index 0493c4d7..2d01658d 100644 --- a/wrap/io_trimesh/import_obj.h +++ b/wrap/io_trimesh/import_obj.h @@ -25,6 +25,9 @@ History $Log: not supported by cvs2svn $ +Revision 1.10 2006/11/21 10:56:41 cignoni +ReWrote loadMask. Now shorter and faster. + Revision 1.9 2006/10/09 19:58:08 cignoni Added casts to remove warnings @@ -484,7 +487,7 @@ static int Open( OpenMeshType &m, const char * filename, Info &oi) // callback invocation, abort loading process if the call returns false if ((cb !=NULL)&& (((numTriangles + numVertices)%100)==0) ) { - if (!(*cb)( (100*(numTriangles +numVertices))/ numVerticesPlusFaces, "Face Loading")) + if (!(*cb)( (100*(numTriangles +numVertices))/ numVerticesPlusFaces, "Face Loading")) return E_ABORTED; } } @@ -527,8 +530,9 @@ static int Open( OpenMeshType &m, const char * filename, Info &oi) // we simply ignore other situations } // end for each line... } // end while stream not eof - - FaceIterator fi = Allocator::AddFaces(m,numTriangles); + assert((numTriangles +numVertices) == numVerticesPlusFaces); + + FaceIterator fi = Allocator::AddFaces(m,numTriangles); //------------------------------------------------------------------------------- // Now the final pass to convert indexes into pointers for face to vert/norm/tex references for(int i=0;i2) + totRead+=line.size(); + if(oi.cb && (lineCount%1000)==0) + (*oi.cb)( (int)(100.0*(float(totRead))/float(length)), "Loading mask..."); + if(line.size()>2) { if(line[0]=='v') { @@ -756,6 +762,8 @@ static bool LoadMask(const char * filename, Info &oi) } oi.mask = 0; if (oi.numTexCoords) oi.mask |= vcg::tri::io::Mask::IOM_WEDGTEXCOORD; + + return true; }