Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9869 in orxonox.OLD for trunk/src/lib/graphics/importer/material.cc


Ignore:
Timestamp:
Oct 3, 2006, 12:19:30 AM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: merged the new_class_id branche back to the trunk.
merged with command:
svn merge https://svn.orxonox.net/orxonox/branches/new_class_id trunk -r9683:HEAD
no conflicts… puh..

File:
1 edited

Legend:

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

    r9406 r9869  
    2525#include "loading/load_param.h"
    2626
    27 #include "util/loading/resource_manager.h"
     27#include "resource_texture.h"
     28
     29ObjectListDefinition(Material);
    2830
    2931/**
     
    3335Material::Material (const std::string& mtlName)
    3436{
    35   this->setClassID(CL_MATERIAL, "Material");
     37  this->registerObject(this, Material::_objectList);
    3638
    3739  this->setIllum(3);
     
    9092  PRINTF(5)("delete Material %s.\n", this->getCName());
    9193
    92   if (this->ambientTexture != NULL)
    93     ResourceManager::getInstance()->unload(this->ambientTexture);
    94   if (this->specularTexture != NULL)
    95     ResourceManager::getInstance()->unload(this->specularTexture);
    96 
    9794  if (this == Material::selectedMaterial)
    9895    Material::selectedMaterial = NULL;
     
    10198
    10299const Material* Material::selectedMaterial = NULL;
    103 
    104 
    105 /// TODO FIX THIS
    106 // 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; /// FIXME
    120 //   this->specularTexture = NULL; /// FIXME
    121 //
    122 //   this->setName(m.getName());
    123 // }
    124 
    125 
    126100
    127101/**
     
    288262
    289263
    290 
    291 /**
    292  * @brief Adds a Texture Path to the List of already existing Paths
    293  * @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 
    303264/**
    304265 * @brief Sets the Diffuse map of this Texture.
     
    322283 * @param textureNumber The Texture-Number from 0 to GL_MAX_TEXTURE_UNITS
    323284 */
    324 void Material::setDiffuseMap(const TextureDataPointer& textureDataPointer, unsigned int textureNumber)
     285void Material::setDiffuseMap(const TextureData::Pointer& textureDataPointer, unsigned int textureNumber)
    325286{
    326287  assert(textureNumber < Material::getMaxTextureUnits());
     
    349310  if (!dMap.empty())
    350311  {
    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;
    354316    else
    355       this->textures[textureNumber] = Texture();
     317      this->textures[textureNumber] = Texture();*/
    356318  }
    357319  else
Note: See TracChangeset for help on using the changeset viewer.