- Timestamp:
- Dec 4, 2008, 8:28:14 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/objecthierarchy2/src/orxonox/gamestates/GSLevel.cc
r2173 r2344 47 47 #include "CameraManager.h" 48 48 #include "LevelManager.h" 49 #include "PlayerManager.h" 49 50 #include "Settings.h" 50 51 … … 99 100 // create the global LevelManager 100 101 this->levelManager_ = new LevelManager(); 102 this->playerManager_ = new PlayerManager(); 101 103 102 104 // reset game speed to normal … … 114 116 FunctorMember<GSLevel>* functor1 = createFunctor(&GSLevel::keybind); 115 117 functor1->setObject(this); 116 CommandExecutor::addConsoleCommandShortcut(createConsoleCommand(functor1, "keybind")); 118 ccKeybind_ = createConsoleCommand(functor1, "keybind"); 119 CommandExecutor::addConsoleCommandShortcut(ccKeybind_); 117 120 FunctorMember<GSLevel>* functor2 = createFunctor(&GSLevel::tkeybind); 118 121 functor2->setObject(this); 119 CommandExecutor::addConsoleCommandShortcut(createConsoleCommand(functor2, "tkeybind")); 122 ccTkeybind_ = createConsoleCommand(functor2, "tkeybind"); 123 CommandExecutor::addConsoleCommandShortcut(ccTkeybind_); 120 124 // set our console command as callback for the key detector 121 125 InputManager::getInstance().setKeyDetectorCallback(std::string("keybind ") + keyDetectorCallbackCode_); … … 130 134 FunctorMember<GSLevel>* functor = createFunctor(&GSLevel::setTimeFactor); 131 135 functor->setObject(this); 132 CommandExecutor::addConsoleCommandShortcut(createConsoleCommand(functor, "setTimeFactor")).accessLevel(AccessLevel::Offline).defaultValue(0, 1.0);; 136 ccSetTimeFactor_ = createConsoleCommand(functor, "setTimeFactor"); 137 CommandExecutor::addConsoleCommandShortcut(ccSetTimeFactor_).accessLevel(AccessLevel::Offline).defaultValue(0, 1.0);; 133 138 } 134 139 } … … 136 141 void GSLevel::leave() 137 142 { 143 // destroy console commands 144 delete this->ccKeybind_; 145 delete this->ccSetTimeFactor_; 146 delete this->ccTkeybind_; 147 138 148 // this call will delete every BaseObject! 139 149 // But currently this will call methods of objects that exist no more … … 156 166 if (this->levelManager_) 157 167 delete this->levelManager_; 168 169 if (this->playerManager_) 170 delete this->playerManager_; 158 171 159 172 if (Core::showsGraphics())
Note: See TracChangeset
for help on using the changeset viewer.