Added a if(!TMId.empty()) before attempting to bind a texture id from an empty vector...

This commit is contained in:
Paolo Cignoni 2013-12-06 10:16:59 +00:00
parent 6f83d41dbe
commit ecf5bfeeb2
1 changed files with 550 additions and 549 deletions

View File

@ -341,7 +341,6 @@ void DrawFill()
typename MESH_TYPE::FaceIterator fi; typename MESH_TYPE::FaceIterator fi;
typename std::vector<typename MESH_TYPE::FaceType*>::iterator fip; typename std::vector<typename MESH_TYPE::FaceType*>::iterator fip;
short curtexname=-1;
if(cm == CMPerMesh) if(cm == CMPerMesh)
glColor(m->C()); glColor(m->C());
@ -437,6 +436,7 @@ void DrawFill()
} }
else else
{ {
short curtexname=-1;
if(partial) if(partial)
fp = face_pointers.begin(); fp = face_pointers.begin();
else else
@ -482,6 +482,7 @@ void DrawFill()
if (curtexname >= 0) if (curtexname >= 0)
{ {
glEnable(GL_TEXTURE_2D); glEnable(GL_TEXTURE_2D);
if(!TMId.empty())
glBindTexture(GL_TEXTURE_2D,TMId[curtexname]); glBindTexture(GL_TEXTURE_2D,TMId[curtexname]);
} }
else else