Changeset 1670 for code/branches/gui/src/orxonox/gamestates/GSGraphics.cc
- Timestamp:
- Aug 26, 2008, 4:26:04 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/gui/src/orxonox/gamestates/GSGraphics.cc
r1662 r1670 38 38 #include "core/ConfigValueIncludes.h" 39 39 #include "core/input/InputManager.h" 40 #include "core/Core.h" 40 #include "core/TclThreadManager.h" 41 //#include "core/Core.h" 41 42 #include "overlays/console/InGameConsole.h" 42 43 #include "gui/GUIManager.h" … … 48 49 : GameState("graphics") 49 50 , timer_(0) 50 , bAbort_(false)51 51 , debugRefreshTime_(0.0f) 52 52 , inputManager_(0) … … 90 90 // use the ogre timer class to measure time. 91 91 timer_ = new Ogre::Timer(); 92 93 // add console commands94 FunctorMember<GSGraphics>* functor = createFunctor(&GSGraphics::exitGame);95 functor->setObject(this);96 CommandExecutor::addConsoleCommandShortcut(createConsoleCommand(functor, "exit"));97 92 } 98 93 … … 123 118 need the time. So we shouldn't run into problems. 124 119 */ 125 bool GSGraphics::tick(float dt)120 void GSGraphics::ticked(float dt) 126 121 { 127 122 // note: paramter 'dt' is of no meaning … … 147 142 { 148 143 timer_->reset(); 149 while (! bAbort_)144 while (!this->hasScheduledTransition()) 150 145 { 151 146 // get current time … … 154 149 float dt = (timeBeforeTick - timeBeforeTickOld) / 1000000.0; 155 150 156 157 // tick the core (needs real time for input and tcl thread management) 158 // TODO: ticks of InputManager and tcl thread manager have to be separated. 159 Core::tick(dt); 160 161 // tick child state 162 if (this->getActiveChild()) 163 this->getActiveChild()->tick(dt); 151 this->inputManager_->tick(dt); 152 TclThreadManager::getInstance().tick(dt); 153 154 this->tickChild(dt); 164 155 165 156 // tick console … … 210 201 COUT(1) << ex.what() << std::endl; 211 202 COUT(1) << "Main loop was stopped by an unhandled exception. Shutting down." << std::endl; 212 } return true;203 } 213 204 } 214 205 }
Note: See TracChangeset
for help on using the changeset viewer.