Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Aug 5, 2008, 9:50:26 PM (16 years ago)
Author:
rgrieder
Message:
  • getInstance is probably more suitable than getSingleton (as x3n has already done so in most of his classes) I changed it in Orxonox and GraphicsEngine. Maybe more to come.
  • Removed derivation from BaseObject in InputState (templates work well too, don't need a factory at all)
Location:
code/branches/gui/src/orxonox/tools
Files:
4 edited

Legend:

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

    r1638 r1653  
    5050        std::ostringstream name;
    5151        name << (BillboardSet::billboardSetCounter_s++);
    52         this->billboardSet_ = GraphicsEngine::getSingleton().getLevelSceneManager()->createBillboardSet("Billboard" + name.str(), count);
     52        this->billboardSet_ = GraphicsEngine::getInstance().getLevelSceneManager()->createBillboardSet("Billboard" + name.str(), count);
    5353        this->billboardSet_->createBillboard(Vector3::ZERO);
    5454        this->billboardSet_->setMaterialName(file);
     
    5959        std::ostringstream name;
    6060        name << (BillboardSet::billboardSetCounter_s++);
    61         this->billboardSet_ = GraphicsEngine::getSingleton().getLevelSceneManager()->createBillboardSet("Billboard" + name.str(), count);
     61        this->billboardSet_ = GraphicsEngine::getInstance().getLevelSceneManager()->createBillboardSet("Billboard" + name.str(), count);
    6262        this->billboardSet_->createBillboard(Vector3::ZERO, colour);
    6363        this->billboardSet_->setMaterialName(file);
     
    6868        std::ostringstream name;
    6969        name << (BillboardSet::billboardSetCounter_s++);
    70         this->billboardSet_ = GraphicsEngine::getSingleton().getLevelSceneManager()->createBillboardSet("Billboard" + name.str(), count);
     70        this->billboardSet_ = GraphicsEngine::getInstance().getLevelSceneManager()->createBillboardSet("Billboard" + name.str(), count);
    7171        this->billboardSet_->createBillboard(position);
    7272        this->billboardSet_->setMaterialName(file);
     
    7777        std::ostringstream name;
    7878        name << (BillboardSet::billboardSetCounter_s++);
    79         this->billboardSet_ = GraphicsEngine::getSingleton().getLevelSceneManager()->createBillboardSet("Billboard" + name.str(), count);
     79        this->billboardSet_ = GraphicsEngine::getInstance().getLevelSceneManager()->createBillboardSet("Billboard" + name.str(), count);
    8080        this->billboardSet_->createBillboard(position, colour);
    8181        this->billboardSet_->setMaterialName(file);
     
    8585    {
    8686        if (this->billboardSet_)
    87             GraphicsEngine::getSingleton().getLevelSceneManager()->destroyBillboardSet(this->billboardSet_);
     87            GraphicsEngine::getInstance().getLevelSceneManager()->destroyBillboardSet(this->billboardSet_);
    8888    }
    8989}
  • code/branches/gui/src/orxonox/tools/Light.cc

    r1638 r1653  
    4949        std::ostringstream name;
    5050        name << (Light::lightCounter_s++);
    51         this->light_ = GraphicsEngine::getSingleton().getLevelSceneManager()->createLight("Light" + name.str());
     51        this->light_ = GraphicsEngine::getInstance().getLevelSceneManager()->createLight("Light" + name.str());
    5252        this->light_->setType(type);
    5353        this->light_->setDiffuseColour(diffuse);
     
    5858    {
    5959        if (this->light_)
    60             GraphicsEngine::getSingleton().getLevelSceneManager()->destroyLight(this->light_);
     60            GraphicsEngine::getInstance().getLevelSceneManager()->destroyLight(this->light_);
    6161    }
    6262}
  • code/branches/gui/src/orxonox/tools/Mesh.cc

    r1638 r1653  
    4949        std::ostringstream name;
    5050        name << (Mesh::meshCounter_s++);
    51         this->entity_ = GraphicsEngine::getSingleton().getLevelSceneManager()->createEntity("Mesh" + name.str(), file);
     51        this->entity_ = GraphicsEngine::getInstance().getLevelSceneManager()->createEntity("Mesh" + name.str(), file);
    5252    }
    5353
     
    5555    {
    5656        if (this->entity_)
    57             GraphicsEngine::getSingleton().getLevelSceneManager()->destroyEntity(this->entity_);
     57            GraphicsEngine::getInstance().getLevelSceneManager()->destroyEntity(this->entity_);
    5858    }
    5959}
  • code/branches/gui/src/orxonox/tools/ParticleInterface.cc

    r1638 r1653  
    5555    this->bEnabled_ = true;
    5656    this->detaillevel_ = (unsigned int)detaillevel;
    57     this->particleSystem_ = GraphicsEngine::getSingleton().getLevelSceneManager()->createParticleSystem("particles" + getConvertedValue<unsigned int, std::string>(ParticleInterface::counter_s++), templateName);
     57    this->particleSystem_ = GraphicsEngine::getInstance().getLevelSceneManager()->createParticleSystem("particles" + getConvertedValue<unsigned int, std::string>(ParticleInterface::counter_s++), templateName);
    5858    this->particleSystem_->setSpeedFactor(Orxonox::getSingleton().getTimeFactor());
    5959
    60     if (GraphicsEngine::getSingleton().getDetailLevelParticle() < (unsigned int)this->detaillevel_)
     60    if (GraphicsEngine::getInstance().getDetailLevelParticle() < (unsigned int)this->detaillevel_)
    6161    {
    6262      this->bVisible_ = false;
     
    7272  {
    7373    this->particleSystem_->removeAllEmitters();
    74     GraphicsEngine::getSingleton().getLevelSceneManager()->destroyParticleSystem(particleSystem_);
     74    GraphicsEngine::getInstance().getLevelSceneManager()->destroyParticleSystem(particleSystem_);
    7575  }
    7676
Note: See TracChangeset for help on using the changeset viewer.