Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3599 in orxonox.OLD


Ignore:
Timestamp:
Mar 18, 2005, 12:44:13 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: LightManager: preventing seg-fault

Location:
orxonox/trunk/src
Files:
2 edited

Legend:

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

    r3598 r3599  
    372372void LightManager::setPosition(GLfloat x, GLfloat y, GLfloat z)
    373373{
     374  if (!this->currentLight)
     375    {
     376      PRINTF(2)("no Light defined yet. Please define at least one light first befor editing.\n");
     377      return;
     378    }
    374379  this->currentLight->setPosition(x, y, z);
    375380}
     
    383388void LightManager::setDiffuseColor(GLfloat r, GLfloat g, GLfloat b)
    384389{
     390  if (!this->currentLight)
     391    {
     392      PRINTF(2)("no Light defined yet. Please define at least one light first befor editing.\n");
     393      return;
     394    }
    385395  this->currentLight->setDiffuseColor(r,g,b);
    386396}
     
    394404void LightManager::setSpecularColor(GLfloat r, GLfloat g, GLfloat b)
    395405{
     406  if (!this->currentLight)
     407    {
     408      PRINTF(2)("no Light defined yet. Please define at least one light first befor editing.\n");
     409      return;
     410    }
    396411  this->currentLight->setSpecularColor(r, g, b);
    397412}
     
    405420void LightManager::setAttenuation(float constantAttenuation, float linearAttenuation, float quadraticAttenuation)
    406421{
     422  if (!this->currentLight)
     423    {
     424      PRINTF(2)("no Light defined yet. Please define at least one light first befor editing.\n");
     425      return;
     426    }
    407427  this->currentLight->setAttenuation(constantAttenuation, linearAttenuation, quadraticAttenuation);
    408428}
     
    415435void LightManager::setSpotDirection(Vector direction)
    416436{
     437  if (!this->currentLight)
     438    {
     439      PRINTF(2)("no Light defined yet. Please define at least one light first befor editing.\n");
     440      return;
     441    }
    417442  this->currentLight->setSpotDirection(direction);
    418443}
     
    424449void LightManager::setSpotCutoff(GLfloat cutoff)
    425450{
     451  if (!this->currentLight)
     452    {
     453      PRINTF(2)("no Light defined yet. Please define at least one light first befor editing.\n");
     454      return;
     455    }
    426456  this->currentLight->setSpotCutoff(cutoff);
    427457}
     
    435465  if (!this->currentLight)
    436466    {
    437       PRINTF(1)("no Light defined yet\n");
     467      PRINTF(2)("no Light defined yet\n");
    438468      return Vector(.0, .0, .0);
    439469    }
     
    449479{
    450480  if (!this->lights[lightNumber])
    451     return Vector(.0,.0,.0);
     481    {
     482      PRINTF(2)("no Light defined yet\n");
     483      return Vector(.0,.0,.0);
     484    }
    452485  else
    453486    return this->lights[lightNumber]->getPosition();
  • orxonox/trunk/src/track_manager.cc

    r3596 r3599  
    302302
    303303
    304 /////////////////////////////////////
    305 ///// TRACKMANAGER //////////////////
    306 /////////////////////////////////////
     304////////////////////////
     305///// TRACKMANAGER /////
     306////////////////////////
    307307/**
    308308   \brief standard constructor
Note: See TracChangeset for help on using the changeset viewer.