Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4597 in orxonox.OLD for orxonox/trunk/src/lib/graphics/light.cc


Ignore:
Timestamp:
Jun 11, 2005, 12:55:48 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: setClassID implemented in all files

File:
1 edited

Legend:

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

    r4519 r4597  
    11
    22
    3 /* 
     3/*
    44   orxonox - the future of 3D-vertical-scrollers
    55
     
    3636{
    3737  this->setClassID(CL_LIGHT, "Light");
    38   char tmpName[7];
    39   sprintf(tmpName, "Light%d", lightNumber);
     38  char tmpName[10];
     39  sprintf(tmpName, "Light[%d]", lightNumber);
    4040  this->setName(tmpName);
    4141
     
    4343  // enable The light
    4444  glEnable(lightsV[lightNumber]); // postSpawn
    45  
     45
    4646  // set values (defaults)
    4747  this->lightNumber = lightNumber;
     
    179179/**
    180180   \brief draws this Light. Being a World-entity the possibility to do this lies at hand.
    181 */ 
     181*/
    182182void Light::draw()
    183183{
     
    195195  PRINT(0)(":: %d ::  -- reference %p\n", this->lightNumber, this);
    196196  PRINT(0)(" GL-state: ");
    197   GLboolean param; 
     197  GLboolean param;
    198198  glGetBooleanv(lightsV[this->lightNumber], &param);
    199199  if (param)
     
    201201  else
    202202    PRINT(0)("OFF\n");
    203  
     203
    204204  PRINT(0)(" Position:      %f/%f/%f\n", this->lightPosition[0], this->lightPosition[1], this->lightPosition[2]);
    205205  PRINT(0)(" DiffuseColor:  %f/%f/%f\n", this->diffuseColor[0], this->diffuseColor[1], this->diffuseColor[2]);
     
    215215   \brief standard constructor for a Light
    216216*/
    217 LightManager::LightManager () 
     217LightManager::LightManager ()
    218218{
    219219  this->setClassID(CL_LIGHT_MANAGER, "LightManager");
     
    229229/**
    230230   \brief standard deconstructor
    231    
     231
    232232   first disables Lighting
    233233
     
    235235   and in the end sets the singleton Reference to zero.
    236236*/
    237 LightManager::~LightManager () 
     237LightManager::~LightManager ()
    238238{
    239239  glDisable(GL_LIGHTING);
    240  
     240
    241241  // this will be done either by worldEntity, or by pNode as each light is one of them
    242242  //  for (int i = 0; i < NUMBEROFLIGHTS; i++)
     
    270270  for (int i = 0; i < NUMBEROFLIGHTS; i++)
    271271    if (!this->lights[i])
    272       return addLight(i); 
     272      return addLight(i);
    273273  PRINTF(1)("no more light slots availiable. All %d already taken\n", NUMBEROFLIGHTS);
    274274  return -1;
     
    302302{
    303303  if (!this->currentLight)
    304     { 
     304    {
    305305      PRINTF(2)("no Light defined yet. Please define at least one light first befor editing.\n");
    306306      return;
     
    316316{
    317317  if (!this->currentLight)
    318     { 
     318    {
    319319      PRINTF(1)("no Light defined yet. So you cannot delete any Light right now.\n");
    320320      return;
     
    392392{
    393393  if (!this->currentLight)
    394     { 
     394    {
    395395      PRINTF(2)("no Light defined yet. Please define at least one light first befor editing.\n");
    396396      return;
     
    409409{
    410410  if (!this->currentLight)
    411     { 
     411    {
    412412      PRINTF(2)("no Light defined yet. Please define at least one light first befor editing.\n");
    413413      return;
     
    426426{
    427427  if (!this->currentLight)
    428     { 
     428    {
    429429      PRINTF(2)("no Light defined yet. Please define at least one light first befor editing.\n");
    430430      return;
     
    443443{
    444444  if (!this->currentLight)
    445     { 
     445    {
    446446      PRINTF(2)("no Light defined yet. Please define at least one light first befor editing.\n");
    447447      return;
     
    458458{
    459459  if (!this->currentLight)
    460     { 
     460    {
    461461      PRINTF(2)("no Light defined yet. Please define at least one light first befor editing.\n");
    462462      return;
     
    473473{
    474474  if (!this->currentLight)
    475     { 
     475    {
    476476      PRINTF(2)("no Light defined yet. Please define at least one light first befor editing.\n");
    477477      return;
     
    488488{
    489489  if (!this->currentLight)
    490     { 
     490    {
    491491      PRINTF(2)("no Light defined yet\n");
    492492      return Vector(.0, .0, .0);
     
    498498
    499499/**
    500    \returns the Position of Light 
     500   \returns the Position of Light
    501501   \param lightNumber lightnumber
    502502*/
     
    539539    if (this->lights[i])
    540540      {
    541         this->lights[i]->debug();
     541        this->lights[i]->debug();
    542542      }
    543543  PRINT(0)("--------------------------------\n");
Note: See TracChangeset for help on using the changeset viewer.