Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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


Ignore:
Timestamp:
Oct 8, 2005, 12:32:52 AM (20 years ago)
Author:
bensch
Message:

orxonox/trunk: Fixed a reversive BUG in the ResourceManager:
Since resources, that depend on each other are loaded left tgo right they must be unlinked right to left… this cost me 3 hours.
What a luck i found this :)

File:
1 edited

Legend:

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

    r5306 r5308  
    5757Material::~Material()
    5858{
    59   PRINTF(4)("delete Material %s.\n", this->getName());
     59  PRINTF(5)("delete Material %s.\n", this->getName());
    6060
    6161  if (this->diffuseTexture != NULL)
     62  {
    6263    ResourceManager::getInstance()->unload(this->diffuseTexture);
     64  }
    6365  if (this->ambientTexture != NULL)
    6466    ResourceManager::getInstance()->unload(this->ambientTexture);
     
    6971/**
    7072 *  sets the material with which the following Faces will be painted
    71 */
    72 bool Material::select ()
     73 */
     74bool Material::select () const
    7375{
    7476  // setting diffuse color
     
    127129 *  Sets the Material Illumination Model.
    128130 *  illu illumination Model in int form
    129 */
     131 */
    130132void Material::setIllum (int illum)
    131133{
     
    133135  this->illumModel = illum;
    134136}
     137
    135138/**
    136139 *  Sets the Material Illumination Model.
    137140 *  illu illumination Model in char* form
    138 */void Material::setIllum (char* illum)
     141 */
     142void Material::setIllum (char* illum)
    139143{
    140144  this->setIllum (atoi(illum));
     
    146150 * @param g Green Color Channel.
    147151 * @param b Blue Color Channel.
    148 */
     152 */
    149153void Material::setDiffuse (float r, float g, float b)
    150154{
     
    156160
    157161}
     162
    158163/**
    159164 *  Sets the Material Diffuse Color.
    160165 * @param rgb The red, green, blue channel in char format (with spaces between them)
    161 */
     166 */
    162167void Material::setDiffuse (char* rgb)
    163168{
     
    181186  this->ambient[3] = 1.0;
    182187}
     188
    183189/**
    184190 *  Sets the Material Ambient Color.
    185191 * @param rgb The red, green, blue channel in char format (with spaces between them)
    186 */
     192 */
    187193void Material::setAmbient (char* rgb)
    188194{
     
    197203 * @param g Green Color Channel.
    198204 * @param b Blue Color Channel.
    199 */
     205 */
    200206void Material::setSpecular (float r, float g, float b)
    201207{
     
    206212  this->specular[3] = 1.0;
    207213 }
     214
    208215/**
    209216 *  Sets the Material Specular Color.
     
    269276void Material::setDiffuseMap(const char* dMap)
    270277{
    271   PRINTF(4)("setting Diffuse Map %s\n", dMap);
     278  PRINTF(5)("setting Diffuse Map %s\n", dMap);
    272279  if (this->diffuseTexture != NULL)
    273280    ResourceManager::getInstance()->unload(this->diffuseTexture);
Note: See TracChangeset for help on using the changeset viewer.