Changeset 8742 in orxonox.OLD for trunk/src/lib/graphics
- Timestamp:
- Jun 23, 2006, 2:55:59 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/graphics/light.cc
r7193 r8742 27 27 #include "debug.h" 28 28 29 using namespace std;30 31 29 CREATE_FACTORY(Light, CL_LIGHT); 32 30 33 31 //! Definition of the Lights and their Names 34 32 int lightsV[] = 35 {36 37 38 39 40 41 42 43 44 };33 { 34 GL_LIGHT0, 35 GL_LIGHT1, 36 GL_LIGHT2, 37 GL_LIGHT3, 38 GL_LIGHT4, 39 GL_LIGHT5, 40 GL_LIGHT6, 41 GL_LIGHT7 42 }; 45 43 46 44 /** … … 49 47 @todo what to do, if no Light-Slots are open anymore ??? 50 48 */ 51 49 Light::Light(const TiXmlElement* root) 52 50 { 53 51 PRINTF(4)("initializing Light number %d.\n", this->lightNumber); … … 89 87 90 88 LoadParam(root, "diffuse-color", this, Light, setDiffuseColor) 91 89 .describe("sets the diffuse color of the Light (red [0-1], green [0-1], blue [0-1])"); 92 90 93 91 LoadParam(root, "specular-color", this, Light, setSpecularColor) 94 92 .describe("sets the specular color of the Light (red [0-1], green [0-1], blue [0-1])"); 95 93 96 94 LoadParam(root, "attenuation", this, Light, setAttenuation) 97 95 .describe("sets the Attenuation of the LightSource (constant Factor, linear Factor, quadratic Factor)."); 98 96 99 97 LoadParam(root, "spot-direction", this, Light, setSpotDirection) 100 98 .describe("sets the Direction of the Spot"); 101 99 102 100 LoadParam(root, "spot-cutoff", this, Light, setSpotCutoff) 103 101 .describe("the cuttoff of the Spotlight"); 104 102 } 105 103 … … 263 261 { 264 262 LoadParamXML(root, "Lights", this, LightManager, loadLights) 265 263 .describe("an XML-Element to load lights from."); 266 264 267 265 LoadParam(root, "ambient-color", this, LightManager, setAmbientColor) 268 266 .describe("sets the ambient Color of the Environmental Light"); 269 267 } 270 268 … … 310 308 for (int i = 0; i < NUMBEROFLIGHTS; i++) 311 309 if (!this->lights[i]) 312 {313 this->lights[i]=light;314 return i;315 }310 { 311 this->lights[i]=light; 312 return i; 313 } 316 314 PRINTF(1)("no more light slots availiable. All %d already taken\n", NUMBEROFLIGHTS); 317 315 return -1; … … 351 349 void LightManager::draw() const 352 350 { 353 PRINTF(4)("Drawing the Lights\n");351 PRINTF(4)("Drawing the Lights\n"); 354 352 for (int i = 0; i < NUMBEROFLIGHTS; i++) 355 353 if (this->lights[i] != NULL) … … 372 370 for (int i = 0; i < NUMBEROFLIGHTS; i++) 373 371 if (this->lights[i]) 374 375 376 372 { 373 this->lights[i]->debug(); 374 } 377 375 PRINT(0)("-----------------------------LM-\n"); 378 376 }
Note: See TracChangeset
for help on using the changeset viewer.