Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8761 in orxonox.OLD for trunk/src/lib/graphics/importer


Ignore:
Timestamp:
Jun 24, 2006, 2:16:12 AM (18 years ago)
Author:
bensch
Message:

merged the new Font-Implementation back here
merged with svn merge https://svn.orxonox.net/orxonox/branches/fontdata . -r8752:HEAD
no conflicts, naturally

Location:
trunk/src/lib/graphics/importer
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/graphics/importer/material.cc

    r8619 r8761  
    317317}
    318318
     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 */
     324void 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
    319334
    320335/**
     
    436451}
    437452
     453
     454
     455void 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
    438477const GLenum Material::glTextureArbs[] =
    439478{
  • trunk/src/lib/graphics/importer/material.h

    r8619 r8761  
    5353  // MAPPING //
    5454  void setDiffuseMap(const Texture& texture, unsigned int textureNumber = 0);
     55  void setDiffuseMap(const TextureDataPointer& texturePointer, unsigned int textureNumber = 0);
    5556  void setDiffuseMap(const std::string& dMap, GLenum target = GL_TEXTURE_2D, unsigned int textureNumber = 0);
    5657  void setSDLDiffuseMap(SDL_Surface *surface, GLenum target = GL_TEXTURE_2D, unsigned int textureNumber = 0);
     
    6768  static void addTexturePath(const std::string& pathName);
    6869
    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);
    7172
     73  void debug() const;
    7274
    7375public:
  • trunk/src/lib/graphics/importer/texture.cc

    r8376 r8761  
    151151  this->setClassID(CL_TEXTURE, "Texture");
    152152
    153   this->data = CountPointer<TextureData>(new TextureData());
     153  this->data = TextureDataPointer(new TextureData());
    154154
    155155  this->priority = 0.5;
     
    173173  this->data = texture.data;
    174174
     175  return *this;
     176}
     177
     178Texture& Texture::operator=(const TextureDataPointer& textureDataPointer)
     179{
     180  this->data = textureDataPointer;
    175181  return *this;
    176182}
  • trunk/src/lib/graphics/importer/texture.h

    r8376 r8761  
    2828
    2929  Texture& operator=(const Texture& texture);
     30  Texture& operator=(const TextureDataPointer& textureDataPointer);
    3031
    3132  virtual ~Texture();
     
    6162
    6263private:
    63   CountPointer<TextureData>     data;               //!< The TextureData
     64  TextureDataPointer            data;               //!< The TextureData
    6465  GLclampf                      priority;           //!< the priority of the current texture (used for garphics cards with limited mem)
    6566
  • trunk/src/lib/graphics/importer/texture_data.h

    r8751 r8761  
    4343};
    4444
     45typedef CountPointer<TextureData> TextureDataPointer;
     46
    4547#endif /* _TEXTURE_DATA_H */
Note: See TracChangeset for help on using the changeset viewer.