Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 1654


Ignore:
Timestamp:
Aug 5, 2008, 9:55:00 PM (16 years ago)
Author:
rgrieder
Message:

forgot getSingleton in Orxonox.cc
There are now only three classes uses getSingleton: ConfigFileManager, Server and Client

Location:
code/branches/gui/src/orxonox
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • code/branches/gui/src/orxonox/Orxonox.cc

    r1653 r1654  
    192192   * @return singleton reference
    193193   */
    194   Orxonox& Orxonox::getSingleton()
     194  Orxonox& Orxonox::getInstance()
    195195  {
    196196    assert(singletonRef_s);
     
    203203  void Orxonox::setTimeFactor(float factor)
    204204  {
    205     float change = factor / Orxonox::getSingleton().getTimeFactor();
    206     Orxonox::getSingleton().timefactor_ = factor;
     205    float change = factor / Orxonox::getInstance().getTimeFactor();
     206    Orxonox::getInstance().timefactor_ = factor;
    207207    for (Iterator<ParticleInterface> it = ObjectList<ParticleInterface>::begin(); it; ++it)
    208208        it->setSpeedFactor(it->getSpeedFactor() * change);
    209209
    210210    for (Iterator<Backlight> it = ObjectList<Backlight>::begin(); it; ++it)
    211         it->setTimeFactor(Orxonox::getSingleton().getTimeFactor());
     211        it->setTimeFactor(Orxonox::getInstance().getTimeFactor());
    212212  }
    213213
     
    335335            return;
    336336
    337         getSingleton().modeRequest_ = mode;
     337        getInstance().modeRequest_ = mode;
    338338    }
    339339
  • code/branches/gui/src/orxonox/Orxonox.h

    r1653 r1654  
    6262      void abortRequest();
    6363
    64       static Orxonox& getSingleton();
     64      static Orxonox& getInstance();
    6565
    6666      static void slomo(float factor) { Orxonox::setTimeFactor(factor); }
    67       static float getTimeFactor()    { return Orxonox::getSingleton().timefactor_; }
     67      static float getTimeFactor()    { return Orxonox::getInstance().timefactor_; }
    6868      static void loadGame(const std::string& name);
    69       static void exit()              { Orxonox::getSingleton().abortRequest(); }
     69      static void exit()              { Orxonox::getInstance().abortRequest(); }
    7070      static void setTimeFactor(float factor = 1.0);
    7171
  • code/branches/gui/src/orxonox/objects/Backlight.cc

    r1653 r1654  
    6868        this->ribbonTrail_->setMaterialName("Trail/backlighttrail");
    6969
    70         this->setTimeFactor(Orxonox::getSingleton().getTimeFactor());
     70        this->setTimeFactor(Orxonox::getInstance().getTimeFactor());
    7171    }
    7272
  • code/branches/gui/src/orxonox/tools/ParticleInterface.cc

    r1653 r1654  
    5656    this->detaillevel_ = (unsigned int)detaillevel;
    5757    this->particleSystem_ = GraphicsEngine::getInstance().getLevelSceneManager()->createParticleSystem("particles" + getConvertedValue<unsigned int, std::string>(ParticleInterface::counter_s++), templateName);
    58     this->particleSystem_->setSpeedFactor(Orxonox::getSingleton().getTimeFactor());
     58    this->particleSystem_->setSpeedFactor(Orxonox::getInstance().getTimeFactor());
    5959
    6060    if (GraphicsEngine::getInstance().getDetailLevelParticle() < (unsigned int)this->detaillevel_)
     
    171171  void ParticleInterface::setSpeedFactor(float factor)
    172172  {
    173     this->particleSystem_->setSpeedFactor(Orxonox::getSingleton().getTimeFactor() * factor);
     173    this->particleSystem_->setSpeedFactor(Orxonox::getInstance().getTimeFactor() * factor);
    174174  }
    175175  float ParticleInterface::getSpeedFactor() const
    176176  {
    177     return (this->particleSystem_->getSpeedFactor() / Orxonox::getSingleton().getTimeFactor());
     177    return (this->particleSystem_->getSpeedFactor() / Orxonox::getInstance().getTimeFactor());
    178178  }
    179179
Note: See TracChangeset for help on using the changeset viewer.