Changeset 9869 in orxonox.OLD for trunk/src/lib/graphics/importer/material.cc
- Timestamp:
- Oct 3, 2006, 12:19:30 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/graphics/importer/material.cc
r9406 r9869 25 25 #include "loading/load_param.h" 26 26 27 #include "util/loading/resource_manager.h" 27 #include "resource_texture.h" 28 29 ObjectListDefinition(Material); 28 30 29 31 /** … … 33 35 Material::Material (const std::string& mtlName) 34 36 { 35 this-> setClassID(CL_MATERIAL, "Material");37 this->registerObject(this, Material::_objectList); 36 38 37 39 this->setIllum(3); … … 90 92 PRINTF(5)("delete Material %s.\n", this->getCName()); 91 93 92 if (this->ambientTexture != NULL)93 ResourceManager::getInstance()->unload(this->ambientTexture);94 if (this->specularTexture != NULL)95 ResourceManager::getInstance()->unload(this->specularTexture);96 97 94 if (this == Material::selectedMaterial) 98 95 Material::selectedMaterial = NULL; … … 101 98 102 99 const Material* Material::selectedMaterial = NULL; 103 104 105 /// TODO FIX THIS106 // Material& Material::operator=(const Material& m)107 // {108 // this->setIllum(m.illumModel);109 // this->setDiffuse(m.diffuse[0],m.diffuse[1],m.diffuse[2]);110 // this->setAmbient(m.ambient[0],m.ambient[1],m.ambient[2]);111 // this->setSpecular(m.specular[0],m.specular[1],m.specular[2]);112 // this->setShininess(m.shininess);113 // this->setTransparency(m.transparency);114 //115 // if (this->diffuseTexture != NULL)116 // ResourceManager::getInstance()->unload(this->diffuseTexture);117 // if (m.diffuseTexture != NULL)118 // this->diffuseTexture = (Texture*)ResourceManager::getInstance()->copy(m.diffuseTexture);119 // this->ambientTexture = NULL; /// FIXME120 // this->specularTexture = NULL; /// FIXME121 //122 // this->setName(m.getName());123 // }124 125 126 100 127 101 /** … … 288 262 289 263 290 291 /**292 * @brief Adds a Texture Path to the List of already existing Paths293 * @param pathName The Path to add.294 */295 void Material::addTexturePath(const std::string& pathName)296 {297 ResourceManager::getInstance()->addImageDir(pathName);298 }299 300 // MAPPING //301 302 303 264 /** 304 265 * @brief Sets the Diffuse map of this Texture. … … 322 283 * @param textureNumber The Texture-Number from 0 to GL_MAX_TEXTURE_UNITS 323 284 */ 324 void Material::setDiffuseMap(const TextureData Pointer& textureDataPointer, unsigned int textureNumber)285 void Material::setDiffuseMap(const TextureData::Pointer& textureDataPointer, unsigned int textureNumber) 325 286 { 326 287 assert(textureNumber < Material::getMaxTextureUnits()); … … 349 310 if (!dMap.empty()) 350 311 { 351 Texture* tex = dynamic_cast<Texture*>(ResourceManager::getInstance()->load(dMap, IMAGE, RP_GAME, (int)target)); 352 if (tex != NULL) 353 this->textures[textureNumber] = *tex; 312 this->textures[textureNumber] = ResourceTexture(dMap); 313 //dynamic_cast<Texture*>(ResourceManager::getInstance()->load(dMap, IMAGE, RP_GAME, (int)target)); 314 /* if (tex != NULL) 315 this->textures[textureNumber] = tex; 354 316 else 355 this->textures[textureNumber] = Texture(); 317 this->textures[textureNumber] = Texture();*/ 356 318 } 357 319 else
Note: See TracChangeset
for help on using the changeset viewer.