- Timestamp:
- May 7, 2005, 4:49:18 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/graphics/importer/model.cc
r4107 r4108 566 566 else 567 567 tmpElem->normalNumber = -1; 568 if (unlikely(tmpElem->vertexNumber > this->vertexCount))569 PRINTF(1)("VERTEX %d IS NOT IN THE LIST -> DANGER OF SEGFAULT (max is: %d)\n", tmpElem->vertexNumber, this->vertexCount);570 if (unlikely(tmpElem->normalNumber > this->normalCount))571 PRINTF(1)("VERTEX %d IS NOT IN THE LIST -> DANGER OF SEGFAULT (max is: %d)\n", tmpElem->normalNumber, this->normalCount);572 if (unlikely(tmpElem->texCoordNumber > this->texCoordCount))573 PRINTF(1)("VERTEX %d IS NOT IN THE LIST -> DANGER OF SEGFAULT (max is: %d)\n", tmpElem->texCoordNumber, this->texCoordCount);574 568 575 569 faceString += tmpLen; … … 608 602 tmpElem->normalNumber = va_arg(itemlist, int) -1; 609 603 this->currentGroup->currentFace->vertexCount++; 610 611 if (unlikely(tmpElem->vertexNumber > this->vertexCount))612 PRINTF(1)("VERTEX %d IS NOT IN THE LIST -> DANGER OF SEGFAULT (max is: %d)\n", tmpElem->vertexNumber, this->vertexCount);613 if (unlikely(tmpElem->normalNumber > this->normalCount))614 PRINTF(1)("VERTEX %d IS NOT IN THE LIST -> DANGER OF SEGFAULT (max is: %d)\n", tmpElem->normalNumber, this->normalCount);615 if (unlikely(tmpElem->texCoordNumber > this->texCoordCount))616 PRINTF(1)("VERTEX %d IS NOT IN THE LIST -> DANGER OF SEGFAULT (max is: %d)\n", tmpElem->texCoordNumber, this->texCoordCount);617 604 } 618 605 va_end(itemlist); … … 716 703 } 717 704 718 for (int i=0; i <vertices->getCount()/3;i++)705 for (int i=0; i < vertices->getCount()/3;i++) 719 706 { 720 707 normArray[i].normalize(); 721 708 PRINTF(5)("Found Normale number %d: (%f; %f, %f).\n", i, normArray[i].x, normArray[i].y, normArray[i].z); 722 709 723 this-> normals->addEntry(normArray[i].x, normArray[i].y, normArray[i].z);710 this->addVertexNormal(normArray[i].x, normArray[i].y, normArray[i].z); 724 711 725 712 } … … 857 844 858 845 if (elem->texCoordNumber != -1) 859 glTexCoord2fv(this->vTexture->getArray() + elem->texCoordNumber * 2); 846 { 847 if (likely(elem->texCoordNumber <= this->texCoordCount)) 848 glTexCoord2fv(this->vTexture->getArray() + elem->texCoordNumber * 2); 849 else 850 PRINTF(2)("TextureCoordinate %d is not in the List (max: %d)\nThe Model might be incomplete\n", 851 elem->texCoordNumber, this->texCoordCount); 852 } 860 853 if (elem->normalNumber != -1) 861 glNormal3fv(this->normals->getArray() + elem->normalNumber * 3); 854 { 855 if (likely(elem->normalNumber <= this->normalCount)) 856 glNormal3fv(this->normals->getArray() + elem->normalNumber * 3); 857 else 858 PRINTF(2)("Normal %d is not in the List (max: %d)\nThe Model might be incomplete", 859 elem->normalNumber, this->normalCount); 860 } 862 861 if (elem->vertexNumber != -1) 863 glVertex3fv(this->vertices->getArray() + elem->vertexNumber * 3); 862 { 863 if (likely(elem->vertexNumber <= this->vertexCount)) 864 glVertex3fv(this->vertices->getArray() + elem->vertexNumber * 3); 865 else 866 PRINTF(2)("Vertex %d is not in the List (max: %d)\nThe Model might be incomplete", 867 elem->vertexNumber, this->vertexCount); 868 } 869 864 870 } 865 871
Note: See TracChangeset
for help on using the changeset viewer.