Changeset 3914 in orxonox.OLD for orxonox/trunk/src/lib/graphics/importer/material.cc
- Timestamp:
- Apr 21, 2005, 1:46:31 AM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/graphics/importer/material.cc
r3894 r3914 37 37 { 38 38 PRINTF(4)("initializing new Material.\n"); 39 this->nextMat = NULL;40 39 this->name = NULL; 41 40 this->setIllum(3); … … 68 67 if (this->diffuseTexture) 69 68 ResourceManager::getInstance()->unload(this->diffuseTexture); 70 if (this->nextMat)71 delete this->nextMat;72 }73 74 /**75 \brief adds a new Material to the List.76 this Function will append a new Material to the end of a Material List.77 \param mtlName The name of the Material to be added.78 */79 Material* Material::addMaterial(const char* mtlName)80 {81 PRINTF(4)("adding Material %s.\n", mtlName);82 Material* tmpMat = this;83 while (tmpMat->nextMat != NULL)84 {85 tmpMat = tmpMat->nextMat;86 }87 tmpMat->nextMat = new Material(mtlName);88 return tmpMat->nextMat;89 90 }91 92 /**93 \brief Search for a Material called mtlName94 \param mtlName the Name of the Material to search for95 \returns Material named mtlName if it is found. NULL otherwise.96 */97 Material* Material::search(const char* mtlName)98 {99 PRINTF(5)("Searching for material %s", mtlName);100 Material* searcher = this;101 while (searcher != NULL)102 {103 PRINT(5)(".");104 if (!strcmp (searcher->getName(), mtlName))105 {106 PRINT(5)("found.\n");107 return searcher;108 }109 searcher = searcher->nextMat;110 }111 PRINT(2)("material %s not found\n", mtlName);112 return NULL;113 69 } 114 70
Note: See TracChangeset
for help on using the changeset viewer.