Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Sep 16, 2008, 8:45:13 PM (16 years ago)
Author:
rgrieder
Message:

Changed initialisation of TclThreadManager, TclBind and Shell to match the simple singleton concept (runtime assert in the c'tor).
That simplifies things a lot. The instances now 'belong' to GSRoot.

Location:
code/trunk/src/orxonox/gamestates
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/orxonox/gamestates/GSRoot.cc

    r1764 r1792  
    3333#include <OgreRoot.h>
    3434
    35 //#include "util/SubString.h"
    3635#include "util/Exception.h"
    3736#include "util/Debug.h"
     
    4241#include "core/ConsoleCommand.h"
    4342#include "core/CommandLine.h"
     43#include "core/Shell.h"
    4444#include "core/TclBind.h"
    4545#include "core/TclThreadManager.h"
     
    7373        , ogreLogger_(0)
    7474        , graphicsEngine_(0)
     75        , tclBind_(0)
     76        , tclThreadManager_(0)
     77        , shell_(0)
    7578    {
    7679        RegisterRootObject(GSRoot);
     
    120123
    121124        // initialise TCL
    122         TclBind::getInstance().setDataPath(Settings::getDataPath());
    123         TclThreadManager::getInstance();
     125        this->tclBind_ = new TclBind(Settings::getDataPath());
     126        this->tclThreadManager_ = new TclThreadManager(tclBind_->getTclInterpreter());
     127
     128        // create a shell
     129        this->shell_ = new Shell();
    124130
    125131        setupOgre();
     
    149155    void GSRoot::leave()
    150156    {
     157        // TODO: remove and destroy console commands
     158
    151159        delete graphicsEngine_;
    152160
     
    160168#endif
    161169
     170        delete this->shell_;
     171        delete this->tclThreadManager_;
     172        delete this->tclBind_;
     173
    162174        delete settings_;
    163175
    164         // TODO: remove and destroy console commands
    165176    }
    166177
  • code/trunk/src/orxonox/gamestates/GSRoot.h

    r1755 r1792  
    6565        Ogre::LogManager*     ogreLogger_;
    6666        GraphicsEngine*       graphicsEngine_;   //!< Interface to Ogre
     67        TclBind*              tclBind_;
     68        TclThreadManager*     tclThreadManager_;
     69        Shell*                shell_;
    6770
    6871        std::string           ogreConfigFile_;        //!< ogre config file name
Note: See TracChangeset for help on using the changeset viewer.