Changeset 3548 in orxonox.OLD for orxonox/trunk/src/lib/graphics/importer/material.cc
- Timestamp:
- Mar 14, 2005, 8:57:25 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/graphics/importer/material.cc
r3536 r3548 18 18 19 19 #include "texture.h" 20 #include "debug.h" 20 21 #include <stdlib.h> 21 22 #include <string.h> … … 51 52 Material::~Material() 52 53 { 53 PRINTF( 2)("delete Material %s.\n", this->name);54 PRINTF(4)("delete Material %s.\n", this->name); 54 55 if (this->name) 55 56 delete []this->name; … … 83 84 void Material::init(void) 84 85 { 85 PRINTF( 2)("initializing new Material.\n");86 PRINTF(4)("initializing new Material.\n"); 86 87 this->nextMat = NULL; 87 88 this->name =""; … … 112 113 Material* Material::search(char* mtlName) 113 114 { 114 PRINTF( 2)("Searching for material %s", mtlName);115 PRINTF(5)("Searching for material %s", mtlName); 115 116 Material* searcher = this; 116 117 while (searcher != NULL) 117 118 { 118 PRINT( 2)(".");119 PRINT(5)("."); 119 120 if (!strcmp (searcher->getName(), mtlName)) 120 121 { 121 PRINT( 2)("found.\n");122 PRINT(5)("found.\n"); 122 123 return searcher; 123 124 } 124 125 searcher = searcher->nextMat; 125 126 } 126 PRINT(2)(" not found\n");127 PRINT(2)("material %s not found\n", mtlName); 127 128 return NULL; 128 129 } … … 171 172 void Material::setName (char* mtlName) 172 173 { 173 PRINTF( 3)("setting Material Name to %s.\n", this->name);174 PRINTF(4)("setting Material Name to %s.\n", this->name); 174 175 this->name = new char [strlen(mtlName)+1]; 175 176 strcpy(this->name, mtlName); … … 190 191 void Material::setIllum (int illum) 191 192 { 192 PRINTF( 3)("setting illumModel of Material %s to %i\n", this->name, illum);193 PRINTF(4)("setting illumModel of Material %s to %i\n", this->name, illum); 193 194 this->illumModel = illum; 194 // PRINTF(3)("setting illumModel to: %i\n", illumModel);195 195 } 196 196 /** … … 210 210 void Material::setDiffuse (float r, float g, float b) 211 211 { 212 PRINTF( 3)("setting Diffuse Color of Material %s to r=%f g=%f b=%f.\n", this->name, r, g, b);212 PRINTF(4)("setting Diffuse Color of Material %s to r=%f g=%f b=%f.\n", this->name, r, g, b); 213 213 this->diffuse[0] = r; 214 214 this->diffuse[1] = g; … … 236 236 void Material::setAmbient (float r, float g, float b) 237 237 { 238 PRINTF( 3)("setting Ambient Color of Material %s to r=%f g=%f b=%f.\n", this->name, r, g, b);238 PRINTF(4)("setting Ambient Color of Material %s to r=%f g=%f b=%f.\n", this->name, r, g, b); 239 239 this->ambient[0] = r; 240 240 this->ambient[1] = g; … … 261 261 void Material::setSpecular (float r, float g, float b) 262 262 { 263 PRINTF( 3)("setting Specular Color of Material %s to r=%f g=%f b=%f.\n", this->name, r, g, b);263 PRINTF(4)("setting Specular Color of Material %s to r=%f g=%f b=%f.\n", this->name, r, g, b); 264 264 this->specular[0] = r; 265 265 this->specular[1] = g; … … 301 301 void Material::setTransparency (float trans) 302 302 { 303 PRINTF( 3)("setting Transparency of Material %s to %f.\n", this->name, trans);303 PRINTF(4)("setting Transparency of Material %s to %f.\n", this->name, trans); 304 304 this->transparency = trans; 305 305 } … … 330 330 void Material::setDiffuseMap(char* dMap) 331 331 { 332 PRINTF( 3)("setting Diffuse Map %s\n", dMap);332 PRINTF(4)("setting Diffuse Map %s\n", dMap); 333 333 diffuseTexture = new Texture(); 334 334 this->diffuseTextureSet = diffuseTexture->loadImage(dMap);
Note: See TracChangeset
for help on using the changeset viewer.