Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 25, 2009, 5:23:00 PM (16 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/GSStandalone.cc

    r2834 r2844  
    3636#include "gui/GUIManager.h"
    3737#include "GraphicsManager.h"
     38#include "core/Game.h"
    3839
    3940namespace orxonox
    4041{
    41     GSStandalone::GSStandalone()
    42         : GameState("standalone")
     42    AddGameState(GSStandalone, "standalone");
     43
     44    GSStandalone::GSStandalone(const std::string& name)
     45        : GameState(name)
    4346    {
    4447    }
     
    4952
    5053
    51     void GSStandalone::enter()
     54    void GSStandalone::activate()
    5255    {
    5356        Core::setIsStandalone(true);
    54 
    55         GSLevel::enter();
    5657
    5758        guiManager_ = GUIManager::getInstancePtr();
     
    6061    }
    6162
    62     void GSStandalone::leave()
     63    void GSStandalone::deactivate()
    6364    {
    64         GSLevel::leave();
    65 
    6665        Core::setIsStandalone(false);
    6766    }
    6867
    69     void GSStandalone::ticked(const Clock& time)
     68    void GSStandalone::update(const Clock& time)
    7069    {
    7170        //Ogre::Viewport* viewport = GraphicsManager::getInstance().getViewport();
     
    7776        // tick CEGUI
    7877        guiManager_->update(time);
    79 
    80         GSLevel::ticked(time);
    81         this->tickChild(time);
    8278    }
    8379}
Note: See TracChangeset for help on using the changeset viewer.