Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 20, 2009, 4:13:26 PM (16 years ago)
Author:
rgrieder
Message:

Fixed tick-time issue: Not all tick times were being taken into account.
As of now, only GSRoot and GSGraphics manage the tick times themselves (marked with "AddGameState(GSRoot, "root", false)")

Location:
code/branches/netp3/src/orxonox/gamestates
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • code/branches/netp3/src/orxonox/gamestates/GSGraphics.cc

    r2928 r2996  
    5757namespace orxonox
    5858{
    59     AddGameState(GSGraphics, "graphics");
    60 
    61     GSGraphics::GSGraphics(const std::string& name)
    62         : GameState(name)
     59    AddGameState(GSGraphics, "graphics", false);
     60
     61    GSGraphics::GSGraphics(const std::string& name, bool countTickTime)
     62        : GameState(name, countTickTime)
    6363        , inputManager_(0)
    6464        , console_(0)
     
    213213        uint64_t timeBeforeTick = time.getRealMicroseconds();
    214214
    215         this->inputManager_->update(time);        // tick console
     215        this->inputManager_->update(time);
    216216        this->console_->update(time);
    217         this->guiManager_->update(time);
    218217
    219218        uint64_t timeAfterTick = time.getRealMicroseconds();
     
    222221        Game::getInstance().addTickTime(timeAfterTick - timeBeforeTick);
    223222
     223        // Process gui events
     224        this->guiManager_->update(time);
    224225        // Render
    225226        this->graphicsManager_->update(time);
  • code/branches/netp3/src/orxonox/gamestates/GSGraphics.h

    r2896 r2996  
    5151    {
    5252    public:
    53         GSGraphics(const std::string& name);
     53        GSGraphics(const std::string& name, bool countTickTime);
    5454        ~GSGraphics();
    5555        void setConfigValues();
  • code/branches/netp3/src/orxonox/gamestates/GSRoot.cc

    r2928 r2996  
    4343namespace orxonox
    4444{
    45     AddGameState(GSRoot, "root");
     45    AddGameState(GSRoot, "root", false);
    4646    SetCommandLineSwitch(console);
    4747    // Shortcuts for easy direct loading
     
    5151    SetCommandLineSwitch(standalone);
    5252
    53     GSRoot::GSRoot(const std::string& name)
    54         : GameState(name)
     53    GSRoot::GSRoot(const std::string& name, bool countTickTime)
     54        : GameState(name, countTickTime)
    5555        , timeFactor_(1.0f)
    5656        , bPaused_(false)
  • code/branches/netp3/src/orxonox/gamestates/GSRoot.h

    r2896 r2996  
    3939    {
    4040    public:
    41         GSRoot(const std::string& name);
     41        GSRoot(const std::string& name, bool countTickTime);
    4242        ~GSRoot();
    4343
Note: See TracChangeset for help on using the changeset viewer.