Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 25, 2009, 5:23:00 PM (15 years ago)
Author:
rgrieder
Message:

Implemented new GameState concept. It doesn't differ that much from the old one, but there's still lots of changes.
The most important change is that one GameState can occur multiple times in the hierarchy.

Short log:

  • No RootGameState anymore. Simply the highest is root.
  • Game::requestGameState(name) can refer to the parent, grandparent, great-grandparent, etc. or one of the children.
  • Requested states are saved. So if you select "level", the next request (even right after the call) will be relative to "level"
  • Game::popState() will simply unload the current one
  • Re added Main.cc again because Game as well as GameState have been moved to the core
  • Adapted all GameStates to the new system

Things should already work, except for network support because standalone only works with a little hack.
We can now start creating a better hierarchy.

File:
1 edited

Legend:

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

    r2817 r2844  
    4545#include "gui/GUIManager.h"
    4646#include "GraphicsManager.h"
    47 #include "Game.h"
     47#include "core/Game.h"
    4848
    4949namespace orxonox
    5050{
    51     GSGraphics::GSGraphics()
    52         : GameState("graphics")
     51    AddGameState(GSGraphics, "graphics");
     52
     53    GSGraphics::GSGraphics(const std::string& name)
     54        : GameState(name)
    5355        , inputManager_(0)
    5456        , console_(0)
     
    6062    {
    6163        RegisterRootObject(GSGraphics);
    62         setConfigValues();
    6364    }
    6465
     
    7172    }
    7273
    73     void GSGraphics::enter()
     74    void GSGraphics::activate()
    7475    {
     76        setConfigValues();
     77
    7578        Core::setShowsGraphics(true);
    7679
     
    108111    }
    109112
    110     void GSGraphics::leave()
     113    void GSGraphics::deactivate()
    111114    {
    112115        if (Core::showsGraphics())
     
    146149        need the time. So we shouldn't run into problems.
    147150    */
    148     void GSGraphics::ticked(const Clock& time)
     151    void GSGraphics::update(const Clock& time)
    149152    {
    150153        uint64_t timeBeforeTick = time.getRealMicroseconds();
     
    152155        this->inputManager_->update(time);        // tick console
    153156        this->console_->update(time);
    154         this->tickChild(time);
    155157
    156158        uint64_t timeAfterTick = time.getRealMicroseconds();
Note: See TracChangeset for help on using the changeset viewer.