Changeset 2406 for code/branches/objecthierarchy2/src/orxonox/gamestates
- Timestamp:
- Dec 11, 2008, 3:06:33 AM (16 years ago)
- Location:
- code/branches/objecthierarchy2/src/orxonox/gamestates
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/objecthierarchy2/src/orxonox/gamestates/GSRoot.cc
r2400 r2406 44 44 #include "tools/Timer.h" 45 45 #include "objects/Tickable.h" 46 #include "objects/worldentities/Backlight.h"47 #include "tools/ParticleInterface.h"48 46 #include "Settings.h" 49 47 50 #if ORXONOX_PLATFORM == ORXONOX_PLATFORM_WIN32 48 #if ORXONOX_PLATFORM == ORXONOX_PLATFORM_WIN32 51 49 # ifndef WIN32_LEAN_AND_MEAN 52 50 # define WIN32_LEAN_AND_MEAN … … 231 229 if (Core::isMaster()) 232 230 { 233 float change = factor / this->timeFactor_; 231 TimeFactorListener::timefactor_s = factor; 232 233 for (ObjectList<TimeFactorListener>::iterator it = ObjectList<TimeFactorListener>::begin(); it != ObjectList<TimeFactorListener>::end(); ++it) 234 it->changedTimeFactor(factor, this->timeFactor_); 234 235 235 236 this->timeFactor_ = factor; 236 /*237 for (ObjectList<ParticleInterface>::iterator it = ObjectList<ParticleInterface>::begin(); it != ObjectList<ParticleInterface>::end(); ++it)238 it->setSpeedFactor(it->getSpeedFactor() * change);239 240 for (ObjectList<Backlight>::iterator it = ObjectList<Backlight>::begin(); it != ObjectList<Backlight>::end(); ++it)241 it->setTimeFactor(timeFactor_);242 */243 237 } 244 238 } 239 240 //////////////////////// 241 // TimeFactorListener // 242 //////////////////////// 243 float TimeFactorListener::timefactor_s = 1.0f; 244 245 TimeFactorListener::TimeFactorListener() 246 { 247 RegisterRootObject(TimeFactorListener); 248 } 245 249 } -
code/branches/objecthierarchy2/src/orxonox/gamestates/GSRoot.h
r2400 r2406 72 72 ConsoleCommand* ccSetTimeFactor_; 73 73 }; 74 75 class _OrxonoxExport TimeFactorListener : virtual public OrxonoxClass 76 { 77 friend class GSRoot; 78 79 public: 80 TimeFactorListener(); 81 virtual ~TimeFactorListener() {} 82 83 protected: 84 virtual void changedTimeFactor(float factor_new, float factor_old) {} 85 inline float getTimeFactor() const 86 { return TimeFactorListener::timefactor_s; } 87 88 private: 89 static float timefactor_s; 90 }; 74 91 } 75 92
Note: See TracChangeset
for help on using the changeset viewer.