Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Aug 31, 2008, 5:50:42 PM (17 years ago)
Author:
rgrieder
Message:

Modified the GameState hierarchy so that you can get the parent with the actual type by calling getParent().

File:
1 edited

Legend:

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

    r1686 r1688  
    3939{
    4040    GSGUI::GSGUI()
    41         : GameState("gui")
     41        : GameStateTyped<GSGraphics>("gui")
    4242    {
    4343    }
     
    4949    void GSGUI::enter()
    5050    {
     51        guiManager_ = getParent()->getGUIManager();
     52
    5153        // show main menu
    52         GUIManager::getInstance().showGUI("MainMenu", 0);
    53         GraphicsEngine::getInstance().getViewport()->setCamera(GUIManager::getInstance().getCamera());
     54        guiManager_->showGUI("MainMenu", 0);
     55        getParent()->getViewport()->setCamera(guiManager_->getCamera());
    5456    }
    5557
    5658    void GSGUI::leave()
    5759    {
    58         GUIManager::getInstance().hideGUI();
     60        guiManager_->hideGUI();
    5961    }
    6062
     
    6264    {
    6365        // tick CEGUI
    64         GUIManager::getInstance().tick(time.getDeltaTime());
     66        guiManager_->tick(time.getDeltaTime());
    6567
    6668        this->tickChild(time);
Note: See TracChangeset for help on using the changeset viewer.