Corrected a small bug in the management of negative indexes of obj on non triangular faces

This commit is contained in:
Paolo Cignoni 2008-06-14 07:29:31 +00:00
parent e5857b7925
commit bd784fabaa
1 changed files with 5 additions and 5 deletions

View File

@ -442,20 +442,20 @@ static int Open( OpenMeshType &m, const char * filename, Info &oi)
while (iVertex < vertexesPerFace) // add other triangles
{
ObjIndexedFace ffNew=ff;
int v4_index;
int v4_index;
int vt4_index;
int vn4_index;
SplitToken(tokens[++iVertex], v4_index, vn4_index, vt4_index, oi.mask);
SplitToken(tokens[++iVertex], v4_index, vn4_index, vt4_index, oi.mask);
if(!GoodObjIndex(v4_index, numVertices))
return E_BAD_VERT_INDEX;
// assigning wedge texture coordinates
// -----------------------------------
if( oi.mask & vcg::tri::io::Mask::IOM_WEDGTEXCOORD )
{
// verifying validity of texture coords index
// ------------------------------------------
if(!GoodObjIndex(v4_index, numVertices))
return E_BAD_VERT_INDEX;
if(!GoodObjIndex(vt4_index,oi.numTexCoords))
return E_BAD_VERT_TEX_INDEX;