Changeset 1654 for code/branches/gui
- Timestamp:
- Aug 5, 2008, 9:55:00 PM (16 years ago)
- Location:
- code/branches/gui/src/orxonox
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/gui/src/orxonox/Orxonox.cc
r1653 r1654 192 192 * @return singleton reference 193 193 */ 194 Orxonox& Orxonox::get Singleton()194 Orxonox& Orxonox::getInstance() 195 195 { 196 196 assert(singletonRef_s); … … 203 203 void Orxonox::setTimeFactor(float factor) 204 204 { 205 float change = factor / Orxonox::get Singleton().getTimeFactor();206 Orxonox::get Singleton().timefactor_ = factor;205 float change = factor / Orxonox::getInstance().getTimeFactor(); 206 Orxonox::getInstance().timefactor_ = factor; 207 207 for (Iterator<ParticleInterface> it = ObjectList<ParticleInterface>::begin(); it; ++it) 208 208 it->setSpeedFactor(it->getSpeedFactor() * change); 209 209 210 210 for (Iterator<Backlight> it = ObjectList<Backlight>::begin(); it; ++it) 211 it->setTimeFactor(Orxonox::get Singleton().getTimeFactor());211 it->setTimeFactor(Orxonox::getInstance().getTimeFactor()); 212 212 } 213 213 … … 335 335 return; 336 336 337 get Singleton().modeRequest_ = mode;337 getInstance().modeRequest_ = mode; 338 338 } 339 339 -
code/branches/gui/src/orxonox/Orxonox.h
r1653 r1654 62 62 void abortRequest(); 63 63 64 static Orxonox& get Singleton();64 static Orxonox& getInstance(); 65 65 66 66 static void slomo(float factor) { Orxonox::setTimeFactor(factor); } 67 static float getTimeFactor() { return Orxonox::get Singleton().timefactor_; }67 static float getTimeFactor() { return Orxonox::getInstance().timefactor_; } 68 68 static void loadGame(const std::string& name); 69 static void exit() { Orxonox::get Singleton().abortRequest(); }69 static void exit() { Orxonox::getInstance().abortRequest(); } 70 70 static void setTimeFactor(float factor = 1.0); 71 71 -
code/branches/gui/src/orxonox/objects/Backlight.cc
r1653 r1654 68 68 this->ribbonTrail_->setMaterialName("Trail/backlighttrail"); 69 69 70 this->setTimeFactor(Orxonox::get Singleton().getTimeFactor());70 this->setTimeFactor(Orxonox::getInstance().getTimeFactor()); 71 71 } 72 72 -
code/branches/gui/src/orxonox/tools/ParticleInterface.cc
r1653 r1654 56 56 this->detaillevel_ = (unsigned int)detaillevel; 57 57 this->particleSystem_ = GraphicsEngine::getInstance().getLevelSceneManager()->createParticleSystem("particles" + getConvertedValue<unsigned int, std::string>(ParticleInterface::counter_s++), templateName); 58 this->particleSystem_->setSpeedFactor(Orxonox::get Singleton().getTimeFactor());58 this->particleSystem_->setSpeedFactor(Orxonox::getInstance().getTimeFactor()); 59 59 60 60 if (GraphicsEngine::getInstance().getDetailLevelParticle() < (unsigned int)this->detaillevel_) … … 171 171 void ParticleInterface::setSpeedFactor(float factor) 172 172 { 173 this->particleSystem_->setSpeedFactor(Orxonox::get Singleton().getTimeFactor() * factor);173 this->particleSystem_->setSpeedFactor(Orxonox::getInstance().getTimeFactor() * factor); 174 174 } 175 175 float ParticleInterface::getSpeedFactor() const 176 176 { 177 return (this->particleSystem_->getSpeedFactor() / Orxonox::get Singleton().getTimeFactor());177 return (this->particleSystem_->getSpeedFactor() / Orxonox::getInstance().getTimeFactor()); 178 178 } 179 179
Note: See TracChangeset
for help on using the changeset viewer.