Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8742 in orxonox.OLD for trunk/src/lib/graphics


Ignore:
Timestamp:
Jun 23, 2006, 2:55:59 PM (19 years ago)
Author:
bensch
Message:

gui: better switch with keys

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/graphics/light.cc

    r7193 r8742  
    2727#include "debug.h"
    2828
    29 using namespace std;
    30 
    3129CREATE_FACTORY(Light, CL_LIGHT);
    3230
    3331//! Definition of the Lights and their Names
    3432int lightsV[] =
    35 {
    36                   GL_LIGHT0,
    37                   GL_LIGHT1,
    38                   GL_LIGHT2,
    39                   GL_LIGHT3,
    40                   GL_LIGHT4,
    41                   GL_LIGHT5,
    42                   GL_LIGHT6,
    43                   GL_LIGHT7
    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  };
    4543
    4644/**
     
    4947  @todo what to do, if no Light-Slots are open anymore ???
    5048 */
    51  Light::Light(const TiXmlElement* root)
     49Light::Light(const TiXmlElement* root)
    5250{
    5351  PRINTF(4)("initializing Light number %d.\n", this->lightNumber);
     
    8987
    9088  LoadParam(root, "diffuse-color", this, Light, setDiffuseColor)
    91       .describe("sets the diffuse color of the Light (red [0-1], green [0-1], blue [0-1])");
     89  .describe("sets the diffuse color of the Light (red [0-1], green [0-1], blue [0-1])");
    9290
    9391  LoadParam(root, "specular-color", this, Light, setSpecularColor)
    94       .describe("sets the specular color of the Light (red [0-1], green [0-1], blue [0-1])");
     92  .describe("sets the specular color of the Light (red [0-1], green [0-1], blue [0-1])");
    9593
    9694  LoadParam(root, "attenuation", this, Light, setAttenuation)
    97       .describe("sets the Attenuation of the LightSource (constant Factor, linear Factor, quadratic Factor).");
     95  .describe("sets the Attenuation of the LightSource (constant Factor, linear Factor, quadratic Factor).");
    9896
    9997  LoadParam(root, "spot-direction", this, Light, setSpotDirection)
    100       .describe("sets the Direction of the Spot");
     98  .describe("sets the Direction of the Spot");
    10199
    102100  LoadParam(root, "spot-cutoff", this, Light, setSpotCutoff)
    103       .describe("the cuttoff of the Spotlight");
     101  .describe("the cuttoff of the Spotlight");
    104102}
    105103
     
    263261{
    264262  LoadParamXML(root, "Lights", this, LightManager, loadLights)
    265       .describe("an XML-Element to load lights from.");
     263  .describe("an XML-Element to load lights from.");
    266264
    267265  LoadParam(root, "ambient-color", this, LightManager, setAmbientColor)
    268       .describe("sets the ambient Color of the Environmental Light");
     266  .describe("sets the ambient Color of the Environmental Light");
    269267}
    270268
     
    310308  for (int i = 0; i < NUMBEROFLIGHTS; i++)
    311309    if (!this->lights[i])
    312   {
    313     this->lights[i]=light;
    314     return i;
    315   }
     310    {
     311      this->lights[i]=light;
     312      return i;
     313    }
    316314  PRINTF(1)("no more light slots availiable. All %d already taken\n", NUMBEROFLIGHTS);
    317315  return -1;
     
    351349void LightManager::draw() const
    352350{
    353  PRINTF(4)("Drawing the Lights\n");
     351  PRINTF(4)("Drawing the Lights\n");
    354352  for (int i = 0; i < NUMBEROFLIGHTS; i++)
    355353    if (this->lights[i] != NULL)
     
    372370  for (int i = 0; i < NUMBEROFLIGHTS; i++)
    373371    if (this->lights[i])
    374       {
    375         this->lights[i]->debug();
    376       }
     372    {
     373      this->lights[i]->debug();
     374    }
    377375  PRINT(0)("-----------------------------LM-\n");
    378376}
Note: See TracChangeset for help on using the changeset viewer.