missing check for the presence of optional stuff

This commit is contained in:
Paolo Cignoni 2008-01-28 14:45:07 +00:00
parent b6cea42c5e
commit be51ebfc80
1 changed files with 5 additions and 4 deletions

View File

@ -183,12 +183,13 @@ namespace io {
assert(indvt + offset < m.vert.size()); assert(indvt + offset < m.vert.size());
m.face[ff].V(tt) = &(m.vert[indvt + offset]); m.face[ff].V(tt) = &(m.vert[indvt + offset]);
if(tri::HasPerWedgeNormal(m))
WedgeNormalAttribute(m,face,wa.wn,wa.wnsrc,ff,jj + wa.offnm,tt); WedgeNormalAttribute(m,face,wa.wn,wa.wnsrc,ff,jj + wa.offnm,tt);
if (ind_txt != -1) if(tri::HasPerWedgeTexCoord(m) && ind_txt != -1)
{ {
WedgeTextureAttribute(m,face,ind_txt,wa.wt,wa.wtsrc,ff,jj + wa.offtx,tt,wa.stride); WedgeTextureAttribute(m,face,ind_txt,wa.wt,wa.wtsrc,ff,jj + wa.offtx,tt,wa.stride);
} }
if(tri::HasPerWedgeColor(m))
WedgeColorAttribute(m,face,wa.wc,wa.wcsrc,ff,jj + wa.offcl,tt); WedgeColorAttribute(m,face,wa.wc,wa.wcsrc,ff,jj + wa.offcl,tt);
jj += nfcatt; jj += nfcatt;