Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 2, 2015, 11:20:45 PM (9 years ago)
Author:
landauf
Message:

use the generic UpdateListener interface to receive calls to preUpdate() and postUpdate() instead of limiting this functionality to singletons.

File:
1 edited

Legend:

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

    r10407 r10413  
    7979#include "object/ObjectList.h"
    8080#include "module/ModuleInstance.h"
     81#include "UpdateListener.h"
    8182
    8283namespace orxonox
     
    481482    void Core::preUpdate(const Clock& time)
    482483    {
    483         // Update singletons before general ticking
    484         ScopedSingletonManager::preUpdate<ScopeID::Root>(time);
     484        // Update UpdateListeners before general ticking
     485        for (ObjectList<UpdateListener>::iterator it = ObjectList<UpdateListener>::begin(); it != ObjectList<UpdateListener>::end(); ++it)
     486            it->preUpdate(time);
    485487        if (this->bGraphicsLoaded_)
    486488        {
     
    489491            // Update GUI
    490492            this->guiManager_->preUpdate(time);
    491             // Update singletons before general ticking
    492             ScopedSingletonManager::preUpdate<ScopeID::Graphics>(time);
    493493        }
    494494        // Process console events and status line
     
    501501    void Core::postUpdate(const Clock& time)
    502502    {
    503         // Update singletons just before rendering
    504         ScopedSingletonManager::postUpdate<ScopeID::Root>(time);
     503        // Update UpdateListeners just before rendering
     504        for (ObjectList<UpdateListener>::iterator it = ObjectList<UpdateListener>::begin(); it != ObjectList<UpdateListener>::end(); ++it)
     505            it->postUpdate(time);
    505506        if (this->bGraphicsLoaded_)
    506507        {
    507             // Update singletons just before rendering
    508             ScopedSingletonManager::postUpdate<ScopeID::Graphics>(time);
    509508            // Render (doesn't throw)
    510509            this->graphicsManager_->postUpdate(time);
Note: See TracChangeset for help on using the changeset viewer.