removed small bug that caused the duplicate loading of the last vertex of a asc file

This commit is contained in:
Paolo Cignoni 2009-08-18 00:01:47 +00:00
parent b9ad0d4aa2
commit 4c778ca971
1 changed files with 2 additions and 1 deletions

View File

@ -119,7 +119,8 @@ static int Open( MESH_TYPE &m, const char * filename, CallBackPos *cb=0, bool tr
{
if(cb && (++cnt)%1000) cb( (ftell(fp)*100)/fileLen, "ASC Mesh Loading");
if(feof(fp)) break;
fgets(buf,1024,fp);
bool fgetOut=fgets(buf,1024,fp);
if( fgetOut == 0 ) continue;
ret=sscanf(buf, "%f, %f, %f, %f\n", &pp.X(), &pp.Y(), &pp.Z(),&q);
if(ret==1) // lets try also non comma separated values
ret=sscanf(buf, "%f %f %f %f\n", &pp.X(), &pp.Y(), &pp.Z(),&q);