Changeset 3801 in orxonox.OLD for orxonox/trunk/src/lib
- Timestamp:
- Apr 13, 2005, 6:54:35 PM (20 years ago)
- Location:
- orxonox/trunk/src/lib/graphics/importer
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/graphics/importer/model.cc
r3750 r3801 236 236 face->firstElem = NULL; 237 237 238 face->material String= NULL;238 face->material = NULL; 239 239 240 240 face->next = NULL; … … 288 288 PRINTF(5)("Cleaning up Face\n"); 289 289 290 if (face->materialString != NULL)291 delete []face->materialString;292 290 if (face->firstElem != NULL) 293 291 { … … 549 547 } 550 548 */ 551 if (this->currentGroup->faceCount > 0)549 if (this->currentGroup->faceCount > 0) 552 550 this->currentGroup->currentFace = this->currentGroup->currentFace->next = new Face; 553 551 this->initFace (this->currentGroup->currentFace); 554 552 555 this->currentGroup->currentFace->materialString = new char[strlen(matString)+1]; 556 strcpy (this->currentGroup->currentFace->materialString, matString); 557 553 this->currentGroup->currentFace->material = material->search(matString); 554 558 555 if (this->currentGroup->faceCount == 0) 559 556 this->currentGroup->faceCount ++; 560 557 } 558 559 /** 560 \brief Function that selects a material, if changed in the obj file. 561 \param mtl the Material that will be set. 562 */ 563 bool Model::addUseMtl (Material* mtl) 564 { 565 if (this->currentGroup->faceCount > 0) 566 this->currentGroup->currentFace = this->currentGroup->currentFace->next = new Face; 567 this->initFace (this->currentGroup->currentFace); 568 569 this->currentGroup->currentFace->material = mtl; 570 571 if (this->currentGroup->faceCount == 0) 572 this->currentGroup->faceCount ++; 561 573 } 562 574 … … 591 603 while (tmpFace != NULL) 592 604 { 593 if (tmpFace->vertexCount == 0 && tmpFace->material String!= NULL)605 if (tmpFace->vertexCount == 0 && tmpFace->material != NULL) 594 606 { 595 607 if (this->currentGroup->faceMode != -1) … … 597 609 this->currentGroup->faceMode = 0; 598 610 Material* tmpMat; 599 if ( (tmpMat = material->search(tmpFace->materialString))!= NULL)611 if (tmpFace->material != NULL) 600 612 { 601 tmp Mat->select();602 PRINTF(5)("using material %s for coming Faces.\n", tmpFace->material String);613 tmpFace->material->select(); 614 PRINTF(5)("using material %s for coming Faces.\n", tmpFace->material->getName()); 603 615 } 604 else605 PRINTF(2)("material %s not found.\n", tmpFace->materialString);606 607 608 616 } 609 617 -
orxonox/trunk/src/lib/graphics/importer/model.h
r3657 r3801 54 54 FaceElement* firstElem; //!< Points to the first Vertex (FaceElement) of this Face. 55 55 56 char* materialString; //!< The Name of the Material to which to Change.56 Material* material; //!< The Material to use. 57 57 58 58 Face* next; //!< Pointer to the next Face. … … 106 106 bool addVertexTexture(const float u, const float v); 107 107 bool addUseMtl(char* mtlString); 108 bool addUseMtl(Material* mtl); 108 109 void finalize(void); 109 110
Note: See TracChangeset
for help on using the changeset viewer.