Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 30, 2009, 11:07:06 AM (15 years ago)
Author:
rgrieder
Message:

Added preUpdate and postUpdate methods for all classes inheriting Singleton. Replaced update() with preUpdate except for the GraphicsManager (postUpdate).
However this does not apply to the Client and Server singletons in the network library. We should think about putting them in a scope as well.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation2/src/libraries/core/Core.cc

    r6169 r6183  
    316316    void Core::preUpdate(const Clock& time)
    317317    {
    318         // singletons from other libraries
    319         ScopedSingletonManager::update<ScopeID::Root>(time);
     318        // Update singletons before general ticking
     319        ScopedSingletonManager::preUpdate<ScopeID::Root>(time);
    320320        if (this->bGraphicsLoaded_)
    321321        {
    322             // process input events
    323             this->inputManager_->update(time);
    324             // process gui events
    325             this->guiManager_->update(time);
    326             // graphics singletons from other libraries
    327             ScopedSingletonManager::update<ScopeID::Graphics>(time);
    328         }
    329         // process console text
    330         this->ioConsole_->update(time);
    331         // process thread commands
    332         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);
    333333    }
    334334
    335335    void Core::postUpdate(const Clock& time)
    336336    {
     337        // Update singletons just before rendering
     338        ScopedSingletonManager::postUpdate<ScopeID::Root>(time);
    337339        if (this->bGraphicsLoaded_)
    338340        {
     341            // Update singletons just before rendering
     342            ScopedSingletonManager::postUpdate<ScopeID::Graphics>(time);
    339343            // Render (doesn't throw)
    340             this->graphicsManager_->update(time);
     344            this->graphicsManager_->postUpdate(time);
    341345        }
    342346    }
Note: See TracChangeset for help on using the changeset viewer.