- Timestamp:
- Dec 10, 2008, 10:08:37 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/objecthierarchy2/src/orxonox/gamestates/GSLevel.cc
r2396 r2400 41 41 #include "core/CoreIncludes.h" 42 42 #include "core/Core.h" 43 //#include "objects/Backlight.h"44 43 #include "objects/Tickable.h" 45 44 #include "objects/Radar.h" 46 //#include "tools/ParticleInterface.h"47 45 #include "CameraManager.h" 48 46 #include "LevelManager.h" … … 56 54 GSLevel::GSLevel() 57 55 // : GameState<GSGraphics>(name) 58 : timeFactor_(1.0f) 59 , keyBinder_(0) 56 : keyBinder_(0) 60 57 , inputState_(0) 61 58 , radar_(0) … … 68 65 this->ccKeybind_ = 0; 69 66 this->ccTkeybind_ = 0; 70 this->ccSetTimeFactor_ = 0;71 67 72 68 setConfigValues(); … … 107 103 // create the global LevelManager 108 104 this->levelManager_ = new LevelManager(); 109 110 // reset game speed to normal111 timeFactor_ = 1.0f;112 105 113 106 this->loadLevel(); … … 134 127 InputManager::getInstance().requestEnterState("game"); 135 128 } 136 137 if (Core::isMaster())138 {139 // time factor console command140 FunctorMember<GSLevel>* functor = createFunctor(&GSLevel::setTimeFactor);141 functor->setObject(this);142 ccSetTimeFactor_ = createConsoleCommand(functor, "setTimeFactor");143 CommandExecutor::addConsoleCommandShortcut(ccSetTimeFactor_).accessLevel(AccessLevel::Offline).defaultValue(0, 1.0);;144 }145 129 } 146 130 … … 152 136 delete this->ccKeybind_; 153 137 this->ccKeybind_ = 0; 154 }155 if (this->ccSetTimeFactor_)156 {157 delete this->ccSetTimeFactor_;158 this->ccSetTimeFactor_ = 0;159 138 } 160 139 if (this->ccTkeybind_) … … 218 197 //for (ObjectList<Tickable>::iterator it = ObjectList<Tickable>::begin(); it; ++it) 219 198 // it->tick(time.getDeltaTime() * this->timeFactor_); 220 }221 222 /**223 @brief224 Changes the speed of Orxonox225 */226 void GSLevel::setTimeFactor(float factor)227 {228 /*229 float change = factor / this->timeFactor_;230 */231 this->timeFactor_ = factor;232 /*233 for (ObjectList<ParticleInterface>::iterator it = ObjectList<ParticleInterface>::begin(); it; ++it)234 it->setSpeedFactor(it->getSpeedFactor() * change);235 236 for (ObjectList<Backlight>::iterator it = ObjectList<Backlight>::begin(); it; ++it)237 it->setTimeFactor(timeFactor_);238 */239 199 } 240 200
Note: See TracChangeset
for help on using the changeset viewer.