Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Aug 31, 2008, 5:50:42 PM (16 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/GSGraphics.cc

    r1686 r1688  
    5757{
    5858    GSGraphics::GSGraphics()
    59         : GameState("graphics")
     59        : GameStateTyped<GSRoot>("graphics")
    6060        , ogreRoot_(0)
    6161        , inputManager_(0)
     
    7777    void GSGraphics::setConfigValues()
    7878    {
    79         SetConfigValue(resourceFile_,    "resources.cfg").description("Location of the resources file in the data path.");
     79        SetConfigValue(resourceFile_, "resources.cfg").description("Location of the resources file in the data path.");
    8080        SetConfigValue(statisticsRefreshCycle_, 200000).description("Sets the time in microseconds interval at which average fps, etc. get updated.");
    8181    }
     
    8585        setConfigValues();
    8686
    87         this->ogreRoot_ = Ogre::Root::getSingletonPtr();
     87        this->ogreRoot_ = getParent()->getOgreRoot();
    8888
    8989        this->declareResources();
     
    9494
    9595        // HACK: temporary:
    96         GraphicsEngine& graphicsEngine = GraphicsEngine::getInstance();
    97         graphicsEngine.renderWindow_ = this->renderWindow_;
    98         graphicsEngine.root_ = this->ogreRoot_;
    99         graphicsEngine.viewport_ = this->viewport_;
     96        GraphicsEngine* graphicsEngine = getParent()->getGraphicsEngine();
     97        graphicsEngine->renderWindow_ = this->renderWindow_;
     98        graphicsEngine->root_          = this->ogreRoot_;
     99        graphicsEngine->viewport_      = this->viewport_;
    100100
    101101
Note: See TracChangeset for help on using the changeset viewer.