Changeset 8761 in orxonox.OLD for trunk/src/lib/graphics/importer
- Timestamp:
- Jun 24, 2006, 2:16:12 AM (18 years ago)
- Location:
- trunk/src/lib/graphics/importer
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/graphics/importer/material.cc
r8619 r8761 317 317 } 318 318 319 /** 320 * @brief Sets the Diffuse map of this Texture by a Texture-pointer. 321 * @param textureDataPointer The Texture-Data-Pointer to load. 322 * @param textureNumber The Texture-Number from 0 to GL_MAX_TEXTURE_UNITS 323 */ 324 void Material::setDiffuseMap(const TextureDataPointer& textureDataPointer, unsigned int textureNumber) 325 { 326 assert(textureNumber < Material::getMaxTextureUnits()); 327 328 if (this->textures.size() <= textureNumber) 329 this->textures.resize(textureNumber+1, Texture()); 330 331 this->textures[textureNumber] = textureDataPointer; 332 } 333 319 334 320 335 /** … … 436 451 } 437 452 453 454 455 void Material::debug() const 456 { 457 PRINT(0)("Debug Material: %s\n", this->getName()); 458 PRINT(0)("illumModel: %d ; ShiniNess %f\n", this->illumModel, shininess); 459 PRINT(0)("diffuseColor: "); diffuse.debug(); 460 PRINT(0)("ambientColor: "); ambient.debug(); 461 PRINT(0)("diffuseColor: "); specular.debug(); 462 PRINT(0)("Blending Properties: Source: %s, Destination: %s\n", blendFuncToString(sFactor).c_str(), blendFuncToString(tFactor).c_str()); 463 464 PRINT(0)("Textures: %d loaded", textures.size()); 465 if (!this->textures.empty()) 466 { 467 PRINT(0)(" - ID's: "); 468 for (unsigned int i = 0; i < textures.size(); ++i) 469 { 470 PRINT(0)("%d ", textures[i].getTexture()); 471 } 472 } 473 PRINT(0)("\n"); 474 } 475 476 438 477 const GLenum Material::glTextureArbs[] = 439 478 { -
trunk/src/lib/graphics/importer/material.h
r8619 r8761 53 53 // MAPPING // 54 54 void setDiffuseMap(const Texture& texture, unsigned int textureNumber = 0); 55 void setDiffuseMap(const TextureDataPointer& texturePointer, unsigned int textureNumber = 0); 55 56 void setDiffuseMap(const std::string& dMap, GLenum target = GL_TEXTURE_2D, unsigned int textureNumber = 0); 56 57 void setSDLDiffuseMap(SDL_Surface *surface, GLenum target = GL_TEXTURE_2D, unsigned int textureNumber = 0); … … 67 68 static void addTexturePath(const std::string& pathName); 68 69 69 const std::string& blendFuncToString(GLenum blendFunc);70 GLenum stringToBlendFunc(const std::string& blendFuncString);70 static const std::string& blendFuncToString(GLenum blendFunc); 71 static GLenum stringToBlendFunc(const std::string& blendFuncString); 71 72 73 void debug() const; 72 74 73 75 public: -
trunk/src/lib/graphics/importer/texture.cc
r8376 r8761 151 151 this->setClassID(CL_TEXTURE, "Texture"); 152 152 153 this->data = CountPointer<TextureData>(new TextureData());153 this->data = TextureDataPointer(new TextureData()); 154 154 155 155 this->priority = 0.5; … … 173 173 this->data = texture.data; 174 174 175 return *this; 176 } 177 178 Texture& Texture::operator=(const TextureDataPointer& textureDataPointer) 179 { 180 this->data = textureDataPointer; 175 181 return *this; 176 182 } -
trunk/src/lib/graphics/importer/texture.h
r8376 r8761 28 28 29 29 Texture& operator=(const Texture& texture); 30 Texture& operator=(const TextureDataPointer& textureDataPointer); 30 31 31 32 virtual ~Texture(); … … 61 62 62 63 private: 63 CountPointer<TextureData>data; //!< The TextureData64 TextureDataPointer data; //!< The TextureData 64 65 GLclampf priority; //!< the priority of the current texture (used for garphics cards with limited mem) 65 66 -
trunk/src/lib/graphics/importer/texture_data.h
r8751 r8761 43 43 }; 44 44 45 typedef CountPointer<TextureData> TextureDataPointer; 46 45 47 #endif /* _TEXTURE_DATA_H */
Note: See TracChangeset
for help on using the changeset viewer.