Changeset 8316 in orxonox.OLD for trunk/src/lib/graphics/importer/static_model.cc
- Timestamp:
- Jun 11, 2006, 1:57:27 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/graphics/importer/static_model.cc
r7732 r8316 386 386 } 387 387 ++this->groupCount; 388 return true; 388 389 } 389 390 … … 558 559 this->currentGroup->faceCount += this->currentGroup->currentFace->vertexCount -2; 559 560 this->faceCount += this->currentGroup->currentFace->vertexCount -2; 561 return true; 560 562 } 561 563 … … 591 593 this->currentGroup->faceCount += this->currentGroup->currentFace->vertexCount - 2; 592 594 this->faceCount += this->currentGroup->currentFace->vertexCount -2; 595 return true; 593 596 } 594 597 … … 606 609 if (this->currentGroup->faceCount == 0) 607 610 this->currentGroup->faceCount++; 611 return true; 608 612 } 609 613 … … 621 625 if (this->currentGroup->faceCount == 0) 622 626 this->currentGroup->faceCount++; 627 return true; 623 628 } 624 629 … … 637 642 638 643 Vector* normArray = new Vector [vertices.size()/3]; 639 for ( int i=0; i<vertices.size()/3;i++)644 for (unsigned int i=0; i<vertices.size()/3;i++) 640 645 normArray[i] = Vector(.0,.0,.0); 641 646 642 int firstTouch;643 int secondTouch;644 647 Vector prevV; 645 648 Vector nextV; … … 668 671 669 672 curElem = firstElem; 670 for ( int j=0; j<tmpFace->vertexCount; j++)673 for (unsigned int j = 0; j < tmpFace->vertexCount; j++) 671 674 { 672 675 if (!(nextElem = curElem->next)) … … 696 699 } 697 700 698 for ( int i=0; i < this->vertices.size()/3;i++)701 for (unsigned int i=0; i < this->vertices.size()/3;i++) 699 702 { 700 703 normArray[i].normalize(); … … 705 708 } 706 709 delete[] normArray; 710 return true; 707 711 } 708 712 … … 741 745 glEnd(); 742 746 this->currentGroup->faceMode = 0; 743 Material* tmpMat;744 747 if (tmpFace->material != NULL) 745 748 { … … 797 800 this->currentGroup = this->currentGroup->next; 798 801 } 802 return true; 799 803 } 800 804 … … 933 937 PRINTF(5)("importing grafical Element to openGL.\n"); 934 938 935 if (elem->texCoordNumber !=-1)936 { 937 if (likely( elem->texCoordNumber < this->pModelInfo.numTexCoor))939 if (elem->texCoordNumber > -1) 940 { 941 if (likely((unsigned int)elem->texCoordNumber < this->pModelInfo.numTexCoor)) 938 942 glTexCoord2fv(&this->vTexture[0] + elem->texCoordNumber * 2); 939 943 else … … 941 945 elem->texCoordNumber, this->pModelInfo.numTexCoor); 942 946 } 943 if (elem->normalNumber !=-1)944 { 945 if (likely( elem->normalNumber < this->pModelInfo.numNormals))947 if (elem->normalNumber > -1) 948 { 949 if (likely((unsigned int)elem->normalNumber < this->pModelInfo.numNormals)) 946 950 glNormal3fv(&this->normals[0] + elem->normalNumber * 3); 947 951 else … … 949 953 elem->normalNumber, this->pModelInfo.numNormals); 950 954 } 951 if (elem->vertexNumber !=-1)952 { 953 if (likely( elem->vertexNumber < this->pModelInfo.numVertices))955 if (elem->vertexNumber > -1) 956 { 957 if (likely((unsigned int)elem->vertexNumber < this->pModelInfo.numVertices)) 954 958 glVertex3fv(&this->vertices[0]+ elem->vertexNumber * 3); 955 959 else … … 958 962 } 959 963 964 return true; 960 965 } 961 966
Note: See TracChangeset
for help on using the changeset viewer.