Changeset 6183 for code/branches/presentation2/src/libraries/core
- Timestamp:
- Nov 30, 2009, 11:07:06 AM (15 years ago)
- Location:
- code/branches/presentation2/src/libraries/core
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation2/src/libraries/core/Core.cc
r6169 r6183 316 316 void Core::preUpdate(const Clock& time) 317 317 { 318 // singletons from other libraries319 ScopedSingletonManager:: update<ScopeID::Root>(time);318 // Update singletons before general ticking 319 ScopedSingletonManager::preUpdate<ScopeID::Root>(time); 320 320 if (this->bGraphicsLoaded_) 321 321 { 322 // process input events323 this->inputManager_-> update(time);324 // process gui events325 this->guiManager_-> update(time);326 // graphics singletons from other libraries327 ScopedSingletonManager:: update<ScopeID::Graphics>(time);328 } 329 // process console text330 this->ioConsole_-> update(time);331 // process thread commands332 this->tclThreadManager_-> update(time);322 // Process input events 323 this->inputManager_->preUpdate(time); 324 // Update GUI 325 this->guiManager_->preUpdate(time); 326 // Update singletons before general ticking 327 ScopedSingletonManager::preUpdate<ScopeID::Graphics>(time); 328 } 329 // Process console events and status line 330 this->ioConsole_->preUpdate(time); 331 // Process thread commands 332 this->tclThreadManager_->preUpdate(time); 333 333 } 334 334 335 335 void Core::postUpdate(const Clock& time) 336 336 { 337 // Update singletons just before rendering 338 ScopedSingletonManager::postUpdate<ScopeID::Root>(time); 337 339 if (this->bGraphicsLoaded_) 338 340 { 341 // Update singletons just before rendering 342 ScopedSingletonManager::postUpdate<ScopeID::Graphics>(time); 339 343 // Render (doesn't throw) 340 this->graphicsManager_-> update(time);344 this->graphicsManager_->postUpdate(time); 341 345 } 342 346 } -
code/branches/presentation2/src/libraries/core/GUIManager.cc
r6156 r6183 166 166 This time value is then used to provide a fluent animation of the GUI. 167 167 */ 168 void GUIManager:: update(const Clock& time)168 void GUIManager::preUpdate(const Clock& time) 169 169 { 170 170 assert(guiSystem_); -
code/branches/presentation2/src/libraries/core/GUIManager.h
r6156 r6183 66 66 ~GUIManager(); 67 67 68 void update(const Clock& time);68 void preUpdate(const Clock& time); 69 69 70 70 static void showGUI(const std::string& name, bool hidePrevious=false, bool showCursor=true); -
code/branches/presentation2/src/libraries/core/GraphicsManager.cc
r6105 r6183 341 341 need the time. So we shouldn't run into problems. 342 342 */ 343 void GraphicsManager:: update(const Clock& time)343 void GraphicsManager::postUpdate(const Clock& time) 344 344 { 345 345 Ogre::FrameEvent evt; -
code/branches/presentation2/src/libraries/core/GraphicsManager.h
r6105 r6183 63 63 void setConfigValues(); 64 64 65 void update(const Clock& time);65 void postUpdate(const Clock& time); 66 66 67 67 Ogre::Viewport* getViewport() { return this->viewport_; } -
code/branches/presentation2/src/libraries/core/IOConsole.cc
r6181 r6183 116 116 117 117 // Make sure we make way for the status lines 118 this-> update(Game::getInstance().getGameClock());118 this->preUpdate(Game::getInstance().getGameClock()); 119 119 } 120 120 … … 122 122 { 123 123 // Empty all buffers 124 this-> update(Game::getInstance().getGameClock());124 this->preUpdate(Game::getInstance().getGameClock()); 125 125 // Erase input and status lines 126 126 this->cout_ << "\033[1G\033[J"; … … 139 139 } 140 140 141 void IOConsole:: update(const Clock& time)141 void IOConsole::preUpdate(const Clock& time) 142 142 { 143 143 unsigned char c; … … 495 495 this->cursorChanged(); 496 496 this->lastRefreshTime_ = Game::getInstance().getGameClock().getRealMicroseconds(); 497 this-> update(Game::getInstance().getGameClock());497 this->preUpdate(Game::getInstance().getGameClock()); 498 498 499 499 this->shell_->registerListener(this); … … 505 505 this->shell_->unregisterListener(this); 506 506 // Empty all buffers 507 this-> update(Game::getInstance().getGameClock());507 this->preUpdate(Game::getInstance().getGameClock()); 508 508 509 509 // Erase input and status lines … … 523 523 524 524 //! Processes the pending input key strokes, refreshes the status lines and handles std::cout (redirected) 525 void IOConsole:: update(const Clock& time)525 void IOConsole::preUpdate(const Clock& time) 526 526 { 527 527 // Process input -
code/branches/presentation2/src/libraries/core/IOConsole.h
r6180 r6183 57 57 ~IOConsole(); 58 58 59 void update(const Clock& time);59 void preUpdate(const Clock& time); 60 60 61 61 private: -
code/branches/presentation2/src/libraries/core/ScopedSingletonManager.h
r6182 r6183 55 55 56 56 template<ScopeID::Value scope> 57 static void update(const Clock& time)57 static void preUpdate(const Clock& time) 58 58 { 59 59 assert(Scope<scope>::isActive()); 60 60 for (ManagerMultiMap::iterator it = getManagersByScope().lower_bound(scope); it != getManagersByScope().upper_bound(scope); ++it) 61 it->second-> update(time);61 it->second->preUpdate(time); 62 62 } 63 virtual void update(const Clock& time) = 0; 63 virtual void preUpdate(const Clock& time) = 0; 64 template<ScopeID::Value scope> 65 static void postUpdate(const Clock& time) 66 { 67 assert(Scope<scope>::isActive()); 68 for (ManagerMultiMap::iterator it = getManagersByScope().lower_bound(scope); it != getManagersByScope().upper_bound(scope); ++it) 69 it->second->postUpdate(time); 70 } 71 virtual void postUpdate(const Clock& time) = 0; 64 72 65 73 static std::map<std::string, ScopedSingletonManager*>& getManagers(); … … 113 121 114 122 //! Called every frame by the ScopedSingletonManager 115 void update(const Clock& time) 116 { 117 assert(Scope<scope>::isActive()); 118 // assuming T inherits Singleton<T> 119 singletonPtr_->updateSingleton(time); 123 void preUpdate(const Clock& time) 124 { 125 assert(Scope<scope>::isActive()); 126 // assuming T inherits Singleton<T> 127 singletonPtr_->preUpdateSingleton(time); 128 } 129 130 //! Called every frame by the ScopedSingletonManager 131 void postUpdate(const Clock& time) 132 { 133 assert(Scope<scope>::isActive()); 134 // assuming T inherits Singleton<T> 135 singletonPtr_->postUpdateSingleton(time); 120 136 } 121 137 … … 170 186 171 187 //! Called every frame by the ScopedSingletonManager 172 void update(const Clock& time)188 void preUpdate(const Clock& time) 173 189 { 174 190 assert(Scope<scope>::isActive()); 175 191 // assuming T inherits Singleton<T> 176 192 if (singletonPtr_ != NULL) 177 singletonPtr_->updateSingleton(time); 193 singletonPtr_->preUpdateSingleton(time); 194 } 195 196 //! Called every frame by the ScopedSingletonManager 197 void postUpdate(const Clock& time) 198 { 199 assert(Scope<scope>::isActive()); 200 // assuming T inherits Singleton<T> 201 if (singletonPtr_ != NULL) 202 singletonPtr_->postUpdateSingleton(time); 178 203 } 179 204 -
code/branches/presentation2/src/libraries/core/TclThreadManager.cc
r5929 r6183 122 122 @brief The "main loop" of the TclThreadManager. Creates new threads if needed and handles queries and queued commands for the main interpreter. 123 123 */ 124 void TclThreadManager:: update(const Clock& time)124 void TclThreadManager::preUpdate(const Clock& time) 125 125 { 126 126 // Get the bundle of the main interpreter (0) -
code/branches/presentation2/src/libraries/core/TclThreadManager.h
r5781 r6183 66 66 static void debug(const std::string& error); 67 67 68 void update(const Clock& time);68 void preUpdate(const Clock& time); 69 69 70 70 std::list<unsigned int> getThreadList() const; -
code/branches/presentation2/src/libraries/core/input/InputManager.cc
r6108 r6183 366 366 // ############################################################ 367 367 368 void InputManager:: update(const Clock& time)368 void InputManager::preUpdate(const Clock& time) 369 369 { 370 370 if (internalState_ & Bad) … … 466 466 @brief 467 467 Updates the currently active states (according to activeStates_) for each device. 468 Also, a list of all active states (no duplicates!) is compiled for the general update().468 Also, a list of all active states (no duplicates!) is compiled for the general preUpdate(). 469 469 */ 470 470 void InputManager::updateActiveStates() -
code/branches/presentation2/src/libraries/core/input/InputManager.h
r6150 r6183 99 99 was submitted while updating, the request will be postponed until the next update call. 100 100 */ 101 void update(const Clock& time);101 void preUpdate(const Clock& time); 102 102 //! Clears all input device buffers. This usually only includes the pressed button list. 103 103 void clearBuffers(); … … 108 108 Reloads all the input devices. Use this method to initialise new joy sticks. 109 109 @note 110 Only reloads immediately if the call stack doesn't include the update() method.110 Only reloads immediately if the call stack doesn't include the preUpdate() method. 111 111 */ 112 112 void reload(); … … 157 157 @remarks 158 158 - You can't remove the internal states "empty", "calibrator" and "detector". 159 - The removal process is being postponed if InputManager:: update() is currently running.159 - The removal process is being postponed if InputManager::preUpdate() is currently running. 160 160 */ 161 161 bool destroyState(const std::string& name);
Note: See TracChangeset
for help on using the changeset viewer.