Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Aug 19, 2008, 8:12:15 PM (16 years ago)
Author:
rgrieder
Message:
  • Changed static Executor/Functor in ConsoleCommand to generic one that enables console commands for member functions. (This is more of a temporary solution, but can be made permanent with right adjustments)
  • The whole GameState thing seems to works so far. But I there's only standalone mode at the moment
  • Console now shows in GUI too. I will have to implement a master InputState in the InputManager (little bit of a break with the concept, but probably necessary)
File:
1 edited

Legend:

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

    r1661 r1662  
    3030#include "GSRoot.h"
    3131
    32 #include <cassert>
    3332#include "core/Factory.h"
    3433#include "core/ConfigFileManager.h"
     
    3635#include "core/ConsoleCommand.h"
    3736#include "core/Debug.h"
    38 //#include "core/Exception.h"
     37#include "core/Exception.h"
    3938#include "core/TclBind.h"
    4039#include "core/Core.h"
     
    6564        Factory::createClassHierarchy();
    6665
    67         // TODO: config values
    68         //setConfigValues();
    69 
    7066        const Settings::CommandLineArgument* dataPath = Settings::getCommandLineArgument("dataPath");
    7167        assert(dataPath);
     
    8177        TclBind::getInstance().setDataPath(Settings::getDataPath());
    8278
     79        // initialise graphics engine. Doesn't load the render window yet!
    8380        graphicsEngine_ = new GraphicsEngine();
    8481        graphicsEngine_->setup();       // creates ogre root and other essentials
    8582
     83        // console commands
     84        FunctorMember<GSRoot>* functor = createFunctor(&GSRoot::loadGame);
     85        functor->setObject(this);
     86        CommandExecutor::addConsoleCommandShortcut(createConsoleCommand(functor, "loadGame"));
    8687    }
    8788
     
    9899        return true;
    99100    }
     101
     102    /**
     103    @brief
     104        Requests a state.
     105    */
     106    void GSRoot::loadGame(const std::string& name)
     107    {
     108        this->requestState(name);
     109    }
    100110}
Note: See TracChangeset for help on using the changeset viewer.