Changeset 11071 for code/trunk/src/orxonox/gamestates
- Timestamp:
- Jan 17, 2016, 10:29:21 PM (9 years ago)
- Location:
- code/trunk
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
-
code/trunk/src/orxonox/gamestates/GSClient.h
r7163 r11071 43 43 ~GSClient(); 44 44 45 v oid activate();46 v oid deactivate();47 v oid update(const Clock& time);45 virtual void activate() override; 46 virtual void deactivate() override; 47 virtual void update(const Clock& time) override; 48 48 }; 49 49 } -
code/trunk/src/orxonox/gamestates/GSGraphics.h
r6417 r11071 53 53 ~GSGraphics(); 54 54 55 v oid activate();56 v oid deactivate();57 v oid update(const Clock& time);55 virtual void activate() override; 56 virtual void deactivate() override; 57 virtual void update(const Clock& time) override; 58 58 59 59 private: -
code/trunk/src/orxonox/gamestates/GSLevel.cc
r10624 r11071 65 65 GSLevel::GSLevel(const GameStateInfo& info) 66 66 : GameState(info) 67 , gameInputState_( 0)68 , guiMouseOnlyInputState_( 0)69 , guiKeysOnlyInputState_( 0)70 , startFile_( 0)67 , gameInputState_(nullptr) 68 , guiMouseOnlyInputState_(nullptr) 69 , guiKeysOnlyInputState_(nullptr) 70 , startFile_(nullptr) 71 71 , bShowIngameGUI_(false) 72 72 { … … 143 143 #endif 144 144 145 gameInputState_->setHandler( 0);146 guiMouseOnlyInputState_->setHandler( 0);147 guiKeysOnlyInputState_->setHandler( 0);145 gameInputState_->setHandler(nullptr); 146 guiMouseOnlyInputState_->setHandler(nullptr); 147 guiKeysOnlyInputState_->setHandler(nullptr); 148 148 InputManager::getInstance().destroyState("game"); 149 149 InputManager::getInstance().destroyState("guiKeysOnly"); … … 156 156 { 157 157 ModifyConsoleCommand(__CC_changeGame_name).deactivate(); 158 ModifyConsoleCommand(__CC_reloadLevel_name).setObject( NULL).deactivate();158 ModifyConsoleCommand(__CC_reloadLevel_name).setObject(nullptr).deactivate(); 159 159 } 160 160 } … … 164 164 // Note: Temporarily moved to GSRoot. 165 165 //// Call the scene objects 166 //for ( ObjectList<Tickable>::iterator it = ObjectList<Tickable>::begin(); it; ++it)167 // it->tick(time.getDeltaTime() * this->timeFactor_);166 //for (Tickable* tickable : ObjectList<Tickable>()) 167 // tickable->tick(time.getDeltaTime() * this->timeFactor_); 168 168 } 169 169 170 170 void GSLevel::prepareObjectTracking() 171 171 { 172 for ( ObjectList<BaseObject>::iterator it = ObjectList<BaseObject>::begin(); it != ObjectList<BaseObject>::end(); ++it)173 this->staticObjects_.insert( *it);172 for (BaseObject* baseObject : ObjectList<BaseObject>()) 173 this->staticObjects_.insert(baseObject); 174 174 } 175 175 … … 178 178 orxout(internal_info) << "Remaining objects:" << endl; 179 179 unsigned int i = 0; 180 for ( ObjectList<BaseObject>::iterator it = ObjectList<BaseObject>::begin(); it != ObjectList<BaseObject>::end(); ++it)181 { 182 std::set<BaseObject*>::const_iterator find = this->staticObjects_.find( *it);180 for (BaseObject* baseObject : ObjectList<BaseObject>()) 181 { 182 std::set<BaseObject*>::const_iterator find = this->staticObjects_.find(baseObject); 183 183 if (find == this->staticObjects_.end()) 184 184 { 185 orxout(internal_warning) << ++i << ": " << it->getIdentifier()->getName() << " (" << *it << "), references: " << it->getReferenceCount() << endl;185 orxout(internal_warning) << ++i << ": " << baseObject->getIdentifier()->getName() << " (" << baseObject << "), references: " << baseObject->getReferenceCount() << endl; 186 186 } 187 187 } … … 215 215 void GSLevel::unloadLevelAsClient() 216 216 { 217 for (ObjectList<Level>::iterator it = ObjectList<Level>::begin(); it != ObjectList<Level>::end(); ) 217 ObjectList<Level> listLevel; 218 for (ObjectList<Level>::iterator it = listLevel.begin(); it != listLevel.end(); ) 218 219 { 219 220 StrongPtr<Level> level = *(it++); // StrongPtr prevents that the Level gets destroyed while we loop over it 220 for (ObjectList<BaseObject>::iterator it = ObjectList<BaseObject>::begin(level); it != ObjectList<BaseObject>::end(level); ) 221 ObjectList<BaseObject> listBaseObject(level); 222 for (ObjectList<BaseObject>::iterator it = listBaseObject.begin(); it != listBaseObject.end(); ) 221 223 (it++)->destroy(); 222 224 } 223 225 224 for (ObjectList<Synchronisable>::iterator it = ObjectList<Synchronisable>::begin(); it != ObjectList<Synchronisable>::end(); ) 226 ObjectList<Synchronisable> listSynchronisable; 227 for (ObjectList<Synchronisable>::iterator it = listSynchronisable.begin(); it != listSynchronisable.end(); ) 225 228 { 226 229 if (it->getSyncMode() != 0x0) … … 235 238 // export all states 236 239 std::vector<GSLevelMementoState*> states; 237 for ( ObjectList<GSLevelMemento>::iterator it = ObjectList<GSLevelMemento>::begin(); it != ObjectList<GSLevelMemento>::end(); ++it)238 { 239 GSLevelMementoState* state = it->exportMementoState();240 for (GSLevelMemento* memento : ObjectList<GSLevelMemento>()) 241 { 242 GSLevelMementoState* state = memento->exportMementoState(); 240 243 if (state) 241 244 states.push_back(state); … … 247 250 248 251 // import all states 249 for ( ObjectList<GSLevelMemento>::iterator it = ObjectList<GSLevelMemento>::begin(); it != ObjectList<GSLevelMemento>::end(); ++it)250 it->importMementoState(states);252 for (GSLevelMemento* memento : ObjectList<GSLevelMemento>()) 253 memento->importMementoState(states); 251 254 252 255 // delete states 253 for ( size_t i = 0; i < states.size(); ++i)254 delete state s[i];256 for (GSLevelMementoState* state : states) 257 delete state; 255 258 } 256 259 -
code/trunk/src/orxonox/gamestates/GSLevel.h
r10624 r11071 44 44 ~GSLevel(); 45 45 46 v oid activate();47 v oid deactivate();48 v oid update(const Clock& time);46 virtual void activate() override; 47 virtual void deactivate() override; 48 virtual void update(const Clock& time) override; 49 49 50 50 static void startMainMenu(void); //!< Starts the MainMenu -
code/trunk/src/orxonox/gamestates/GSLevelMemento.h
r10281 r11071 48 48 protected: 49 49 /** 50 * Returns the state of this memento. Returns NULLif no state needed to persist.50 * Returns the state of this memento. Returns nullptr if no state needed to persist. 51 51 */ 52 52 virtual GSLevelMementoState* exportMementoState() = 0; -
code/trunk/src/orxonox/gamestates/GSMainMenu.cc
r10624 r11071 73 73 74 74 // create an empty Scene 75 this->scene_ = new Scene( NULL);75 this->scene_ = new Scene(nullptr); 76 76 this->scene_->setSyncMode( 0x0 ); 77 77 // and a Camera … … 132 132 InputManager::getInstance().leaveState("MainMenuHackery"); 133 133 134 GraphicsManager::getInstance().setCamera( 0);134 GraphicsManager::getInstance().setCamera(nullptr); 135 135 GUIManager::getInstance().setBackgroundImage(""); 136 136 GUIManager::hideGUI("MainMenu"); … … 140 140 ModifyConsoleCommand(__CC_startClient_name ).deactivate(); 141 141 ModifyConsoleCommand(__CC_startDedicated_name ).deactivate(); 142 ModifyConsoleCommand(__CC_setMainMenuSoundPath_name).setObject( 0);142 ModifyConsoleCommand(__CC_setMainMenuSoundPath_name).setObject(nullptr); 143 143 } 144 144 -
code/trunk/src/orxonox/gamestates/GSMainMenu.h
r9667 r11071 44 44 ~GSMainMenu(); 45 45 46 v oid activate();47 v oid deactivate();48 v oid update(const Clock& time);46 virtual void activate() override; 47 virtual void deactivate() override; 48 virtual void update(const Clock& time) override; 49 49 50 50 void setConfigValues(); -
code/trunk/src/orxonox/gamestates/GSMasterServer.h
r7801 r11071 45 45 ~GSMasterServer(); 46 46 47 v oid activate();48 v oid deactivate();49 v oid update(const Clock& time);47 virtual void activate() override; 48 virtual void deactivate() override; 49 virtual void update(const Clock& time) override; 50 50 51 51 private: -
code/trunk/src/orxonox/gamestates/GSRoot.cc
r10624 r11071 34 34 #include "core/GameMode.h" 35 35 #include "core/command/ConsoleCommandIncludes.h" 36 #include "core/object/ObjectList.h" 36 37 #include "network/NetworkFunctionIncludes.h" 37 38 #include "tools/Timer.h" … … 73 74 { 74 75 unsigned int nr=0; 75 for ( ObjectList<BaseObject>::iterator it = ObjectList<BaseObject>::begin(); it; ++it)76 { 77 Synchronisable* synchronisable = orxonox_cast<Synchronisable*>( *it);76 for (BaseObject* baseObject : ObjectList<BaseObject>()) 77 { 78 Synchronisable* synchronisable = orxonox_cast<Synchronisable*>(baseObject); 78 79 if (synchronisable) 79 orxout(debug_output) << "object: " << it->getIdentifier()->getName() << " id: " << synchronisable->getObjectID() << endl;80 orxout(debug_output) << "object: " << baseObject->getIdentifier()->getName() << " id: " << synchronisable->getObjectID() << endl; 80 81 else 81 orxout(debug_output) << "object: " << it->getIdentifier()->getName() << endl;82 orxout(debug_output) << "object: " << baseObject->getIdentifier()->getName() << endl; 82 83 nr++; 83 84 } … … 98 99 void GSRoot::deactivate() 99 100 { 100 ModifyConsoleCommand(__CC_setTimeFactor_name).setObject( 0);101 ModifyConsoleCommand(__CC_getTimeFactor_name).setObject( 0);102 ModifyConsoleCommand(__CC_setPause_name).setObject( 0);103 ModifyConsoleCommand(__CC_pause_name).setObject( 0);101 ModifyConsoleCommand(__CC_setTimeFactor_name).setObject(nullptr); 102 ModifyConsoleCommand(__CC_getTimeFactor_name).setObject(nullptr); 103 ModifyConsoleCommand(__CC_setPause_name).setObject(nullptr); 104 ModifyConsoleCommand(__CC_pause_name).setObject(nullptr); 104 105 } 105 106 … … 112 113 } 113 114 114 for (ObjectList<Timer>::iterator it = ObjectList<Timer>::begin(); it; ) 115 ObjectList<Timer> listTimer; 116 for (ObjectList<Timer>::iterator it = listTimer.begin(); it; ) 115 117 { 116 118 Timer* object = *it; … … 128 130 } 129 131 float realdt = leveldt * TimeFactorListener::getTimeFactor(); 130 for (ObjectList<Tickable>::iterator it = ObjectList<Tickable>::begin(); it; ) 132 ObjectList<Tickable> listTickable; 133 for (ObjectList<Tickable>::iterator it = listTickable.begin(); it; ) 131 134 { 132 135 Tickable* object = *it; -
code/trunk/src/orxonox/gamestates/GSRoot.h
r8706 r11071 44 44 static void printObjects(); 45 45 46 v oid activate();47 v oid deactivate();48 v oid update(const Clock& time);46 virtual void activate() override; 47 virtual void deactivate() override; 48 virtual void update(const Clock& time) override; 49 49 50 50 // this has to be public because proteced triggers a bug in msvc … … 59 59 60 60 protected: 61 virtual void changedTimeFactor(float factor_new, float factor_old) ;61 virtual void changedTimeFactor(float factor_new, float factor_old) override; 62 62 63 63 private: -
code/trunk/src/orxonox/gamestates/GSServer.cc
r10624 r11071 44 44 GSServer::GSServer(const GameStateInfo& info) 45 45 : GameState(info) 46 , server_( 0)46 , server_(nullptr) 47 47 { 48 48 } -
code/trunk/src/orxonox/gamestates/GSServer.h
r5929 r11071 43 43 ~GSServer(); 44 44 45 v oid activate();46 v oid deactivate();47 v oid update(const Clock& time);45 virtual void activate() override; 46 virtual void deactivate() override; 47 virtual void update(const Clock& time) override; 48 48 49 49 private: -
code/trunk/src/orxonox/gamestates/GSStandalone.h
r5929 r11071 41 41 ~GSStandalone(); 42 42 43 v oid activate();44 v oid deactivate();45 v oid update(const Clock& time);43 virtual void activate() override; 44 virtual void deactivate() override; 45 virtual void update(const Clock& time) override; 46 46 47 47 private:
Note: See TracChangeset
for help on using the changeset viewer.