Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 1663 for code/branches/gui/src


Ignore:
Timestamp:
Aug 20, 2008, 10:30:28 PM (16 years ago)
Author:
rgrieder
Message:

Added CommandLine class.
You can now call SetCommandLineArgument like SetConsoleCommand and hereby define a new command line argument. They are passed in main() and then they can be accessed by commandLine::getCommandLineArgument().

Location:
code/branches/gui/src
Files:
2 added
11 edited

Legend:

Unmodified
Added
Removed
  • code/branches/gui/src/core/CorePrereqs.h

    r1638 r1663  
    102102  class CommandEvaluation;
    103103  class CommandExecutor;
     104  class CommandLine;
     105  class BaseCommandLineArgument;
     106  template <class T>
     107  class CommandLineArgument;
    104108  class ConfigFile;
    105109  class ConfigFileEntry;
  • code/branches/gui/src/core/Exception.h

    r1660 r1663  
    5959            General,
    6060            FileNotFound,
     61            Argument,
    6162            PluginsNotFound,
    6263            InitialisationFailed,
     
    119120            RETURN_EXCEPTION_CODE(General)
    120121            RETURN_EXCEPTION_CODE(FileNotFound);
     122            RETURN_EXCEPTION_CODE(Argument);
    121123            RETURN_EXCEPTION_CODE(PluginsNotFound);
    122124            RETURN_EXCEPTION_CODE(InitialisationFailed);
     
    132134    CREATE_ORXONOX_EXCEPTION(General);
    133135    CREATE_ORXONOX_EXCEPTION(FileNotFound);
     136    CREATE_ORXONOX_EXCEPTION(Argument);
    134137    CREATE_ORXONOX_EXCEPTION(PluginsNotFound);
    135138    CREATE_ORXONOX_EXCEPTION(InitialisationFailed);
     
    142145    // define an assert macro that can display a message
    143146#ifndef NDEBUG
    144 #define OrxAssert(condition, errorMessage) \
    145     condition ? ((void)0) : (void)(orxonox::OutputHandler::getOutStream().setOutputLevel(ORX_ERROR) << errorMessage << std::endl); \
    146     assert(condition)
     147#define OrxAssert(assertion, errorMessage) \
     148    assertion ? ((void)0) : (void)(orxonox::OutputHandler::getOutStream().setOutputLevel(ORX_ERROR) << errorMessage << std::endl); \
     149    assert(assertion)
    147150#else
    148151#define OrxAssert(condition, errorMessage)  ((void)0)
  • code/branches/gui/src/orxonox/Main.cc

    r1661 r1663  
    3939
    4040#include "util/OrxonoxPlatform.h"
    41 #include "util/ArgReader.h"
    4241#include "core/SignalHandler.h"
    4342#include "core/Debug.h"
    44 #include "network/ClientConnection.h"
    45 #include "Settings.h"
    46 #include "Orxonox.h"
     43#include "core/CommandLine.h"
     44//#include "Orxonox.h"
    4745
    4846#include "gamestates/GSRoot.h"
     
    8078#endif
    8179
    82 bool parseCommandLine(int argc, char** argv)
    83 {
    84     ArgReader args;
    85     std::string errorStr = args.parse(argc, argv);
    86     if (errorStr != "")
    87     {
    88         COUT(1) << "Command Line: Parsing failed.\n" << errorStr << std::endl;
    89         return false;
    90     }
    91 
    92     // Argument reader parses the command line to check syntax.
    93     // Settings Singleton then stores the arguments. It always
    94     // expects a default value.
    95     bool success = true;
    96     success &= Settings::addCommandLineArgument<std::string>
    97         ("mode",     args.getArgument("mode"),     "standalone");
    98     success &= Settings::addCommandLineArgument<std::string>
    99         ("dataPath", args.getArgument("dataPath"), "./");
    100     success &= Settings::addCommandLineArgument<std::string>
    101         ("ip",       args.getArgument("ip"),       "127.0.0.0");
    102     success &= Settings::addCommandLineArgument<int>
    103         ("port",     args.getArgument("port"),     NETWORK_PORT);
    104 
    105     if (!success)
    106         return false;
    107 
    108     if (!args.allChecked())
    109     {
    110         COUT(1) << "Command Line: Parsing failed.\nNot all arguments were matched." << std::endl;
    111         return false;
    112     }
    113 
    114     return true;
    115 }
    116 
    117 #include "core/GameState.h"
    11880
    11981#ifdef __cplusplus
     
    12385int main(int argc, char** argv)
    12486{
     87    try
     88    {
     89        orxonox::CommandLine::parse(argc, argv);
     90    }
     91    catch (orxonox::ArgumentException& ex)
     92    {
     93        COUT(1) << ex.what() << std::endl;
     94        COUT(0) << "Usage:" << std::endl << "orxonox [--mode client|server|dedicated|standalone] "
     95                << "[--data PATH] [--ip IP] [--port PORT]" << std::endl;
     96    }
     97
     98
    12599    // create a signal handler (only works for linux)
    126100    SignalHandler::getInstance()->doCatch(argv[0], "orxonox.log");
    127101
    128     if (!parseCommandLine(argc, argv))
    129     {
    130         COUT(0) << "Usage:" << std::endl << "orxonox [--mode client|server|dedicated|standalone] "
    131                 << "[--data PATH] [--ip IP] [--port PORT]" << std::endl;
    132         return 0;
    133     }
    134102
    135103
     
    181149
    182150
    183     Orxonox orxonoxInstance;
     151    //Orxonox orxonoxInstance;
    184152
    185153    try
  • code/branches/gui/src/orxonox/Orxonox.cc

    r1662 r1663  
    108108    , bAbort_(false)
    109109    , timefactor_(1.0f)
    110     , mode_(GameMode::GM_Unspecified)
    111110    , debugRefreshTime_(0.0f)
    112111    , graphicsEngine_(0)
     
    119118
    120119    //assert(singletonRef_s == 0);
    121     OrxAssert(singletonRef_s == 0, "asdfasdfasdfasdfblahblah");
     120    OrxAssert(singletonRef_s == 0, "Cannot instantiate Orxonox class twice");
    122121    singletonRef_s = this;
    123122  }
     
    229228        setConfigValues();
    230229
    231         const Settings::CommandLineArgument* mode = Settings::getCommandLineArgument("mode");
    232         assert(mode);
    233         if (!mode->bHasDefaultValue_)
    234         {
    235             Settings::setGameMode(mode->value_);
    236             this->mode_ = Settings::getGameMode();
    237         }
    238         COUT(3) << "Orxonox: Game mode is " << mode_.name << "." << std::endl;
    239 
    240         const Settings::CommandLineArgument* dataPath = Settings::getCommandLineArgument("dataPath");
    241         assert(dataPath);
    242         if (!dataPath->bHasDefaultValue_)
    243         {
    244             if (*dataPath->value_.getString().end() != '/' && *dataPath->value_.getString().end() != '\\')
    245                 Settings::tsetDataPath(dataPath->value_.getString() + "/");
    246             else
    247                 Settings::tsetDataPath(dataPath->value_.getString());
    248         }
     230        //const Settings::CommandLineArgument* dataPath = Settings::getCommandLineArgument("dataPath");
     231        //assert(dataPath);
     232        //if (!dataPath->bHasDefaultValue_)
     233        //{
     234        //    if (*dataPath->value_.getString().end() != '/' && *dataPath->value_.getString().end() != '\\')
     235        //        Settings::tsetDataPath(dataPath->value_.getString() + "/");
     236        //    else
     237        //        Settings::tsetDataPath(dataPath->value_.getString());
     238        //}
    249239
    250240        try
     
    256246            graphicsEngine_->setup();       // creates ogre root and other essentials
    257247
    258             if (mode_.showsGraphics)
     248            if (Settings::showsGraphics())
    259249            {
    260250                graphicsEngine_->loadRenderer();    // creates the render window
     
    286276                // We probably want to use std::cin to catch input (OIS uses DirectX or X server)
    287277            }
    288 
    289             bool showGUI = true;
    290             if (mode_.mode != GameMode::Unspecified)
    291             {
    292                 showGUI = false;
    293                 // a game mode was specified with the command line
    294                 // we therefore load the game and level directly
    295 
    296                 if (!loadLevel(this->mode_))
    297                 {
    298                     COUT(1) << "Loading with predefined mode failed. Showing main menu." << std::endl;
    299                     showGUI = true;
    300                     mode_ = GameMode::GM_Unspecified;
    301                 }
    302             }
    303 
    304             if (showGUI)
    305             {
    306                 // show main menu
    307                 GUIManager::getInstance().showGUI("MainMenu", 0);
    308                 GraphicsEngine::getInstance().getViewport()->setCamera(GUIManager::getInstance().getCamera());
    309             }
    310278        }
    311279        catch (std::exception& ex)
     
    316284        }
    317285
    318         modeRequest_ = mode_;
    319286        // here happens the game
    320287        startRenderLoop();
    321288
    322         if (mode_.mode == GameMode::Client)
    323             network::Client::getSingleton()->closeConnection();
    324 
    325         if (mode_.hasServer)
    326             server_g->close();
    327     }
    328 
    329     /*static*/ void Orxonox::loadGame(const std::string& name)
    330     {
    331         const GameMode& mode = Settings::getGameMode(name);
    332         if (mode.mode == GameMode::None)
    333             return;
    334 
    335         getInstance().modeRequest_ = mode;
    336     }
    337 
    338     bool Orxonox::loadLevel(const GameMode& mode)
    339     {
    340         bool success = true;
    341 
    342         if (mode.showsGraphics)
    343         {
    344             // create Ogre SceneManager for the level
    345             graphicsEngine_->createNewScene();
    346 
    347             if (!loadPlayground())
    348                 return false;
    349         }
    350 
    351         switch (mode.mode)
    352         {
    353         case GameMode::Server:
    354             success &= serverLoad();
    355             break;
    356         case GameMode::Client:
    357             success &= clientLoad();
    358             break;
    359         case GameMode::Dedicated:
    360             success &= serverLoad();
    361             break;
    362         case GameMode::Standalone:
    363             success &= standaloneLoad();
    364             break;
    365         default: // never happens
    366             assert(false);
    367         }
    368 
    369         if (success)
    370         {
    371             InputManager::getInstance().requestEnterState("game");
    372             this->mode_ = mode;
    373         }
    374 
    375         return success;
     289        //if (mode_.mode == GameMode::Client)
     290        //    network::Client::getSingleton()->closeConnection();
     291
     292        //if (mode_.hasServer)
     293        //    server_g->close();
    376294    }
    377295
     
    408326    COUT(0) << "Loading level in server mode" << std::endl;
    409327
    410     assert(Settings::getCommandLineArgument("port"));
    411     int serverPort = Settings::getCommandLineArgument("port")->value_;
    412     //server_g = new network::Server(serverPort_);
    413     server_g = network::Server::createSingleton(serverPort);
     328    //assert(Settings::getCommandLineArgument("port"));
     329    //int serverPort = Settings::getCommandLineArgument("port")->value_;
     330    ////server_g = new network::Server(serverPort_);
     331    //server_g = network::Server::createSingleton(serverPort);
    414332
    415333    if (!loadScene())
     
    428346    COUT(0) << "Loading level in client mode" << std::endl;\
    429347
    430     assert(Settings::getCommandLineArgument("port"));
    431     assert(Settings::getCommandLineArgument("ip"));
    432     int serverPort = Settings::getCommandLineArgument("port")->value_;
    433     std::string serverIP = Settings::getCommandLineArgument("ip")->value_;
    434 
    435     if (serverIP.compare("") == 0)
    436       client_g = network::Client::createSingleton();
    437     else
    438       client_g = network::Client::createSingleton(serverIP, serverPort);
     348    //assert(Settings::getCommandLineArgument("port"));
     349    //assert(Settings::getCommandLineArgument("ip"));
     350    //int serverPort = Settings::getCommandLineArgument("port")->value_;
     351    //std::string serverIP = Settings::getCommandLineArgument("ip")->value_;
     352
     353    //if (serverIP.compare("") == 0)
     354    //  client_g = network::Client::createSingleton();
     355    //else
     356    //  client_g = network::Client::createSingleton(serverIP, serverPort);
    439357
    440358    if(!client_g->establishConnection())
     
    504422        float dt = (timeBeforeTick - timeBeforeTickOld) / 1000000.0;
    505423
    506         // check whether we have to load a game
    507         if (mode_.mode != modeRequest_.mode && mode_.mode == GameMode::Unspecified)
    508         {
    509             this->loadLevel(modeRequest_);
    510             this->modeRequest_ = GameMode::GM_None;
    511         }
    512 
    513424
    514425        // tick the core (needs real time for input and tcl thread management)
     
    552463        ogreRoot._fireFrameStarted(evt);
    553464
    554         if (mode_.showsGraphics)
     465        if (Settings::showsGraphics())
    555466        {
    556467          // Pump messages in all registered RenderWindows
  • code/branches/gui/src/orxonox/Orxonox.h

    r1654 r1663  
    7474      Orxonox(Orxonox& instance);
    7575
    76       bool loadLevel(const GameMode& mode);
    7776      bool serverLoad();
    7877      bool clientLoad();
     
    9190      float                 timefactor_;       //!< A factor to change the gamespeed
    9291
    93       // this is used to identify the mode (server/client/...) we're in
    94       GameMode              mode_;
    95       GameMode              modeRequest_;
    96 
    9792      // config values
    9893      float                 debugRefreshTime_;
  • code/branches/gui/src/orxonox/OrxonoxPrereqs.h

    r1653 r1663  
    7575    class GraphicsEngine;
    7676    class Orxonox;
     77    class Settings;
    7778
    7879    class RadarViewable;
  • code/branches/gui/src/orxonox/Settings.cc

    r1651 r1663  
    4242namespace orxonox
    4343{
    44 
    45 // Using a macro makes the above list much more readable.
    46 // Settings::addGameMode adds the mode in a map, so we can access game modes by string.
    47 #define CreateGameMode(name, showsGraphics, isMaster, hasServer)                                        \
    48     const GameMode GameMode::GM_##name = { GameMode::name, showsGraphics, isMaster, hasServer, #name }; \
    49     bool temporaryVariable##name = Settings::addGameMode(&GameMode::GM_##name)
    50 
    51     //                          showsGraphics  isMaster  hasServer
    52     CreateGameMode(None,        false,         false,    false);
    53     CreateGameMode(Unspecified, true,          false,    false);
    54     CreateGameMode(Server,      true,          true,     true );
    55     CreateGameMode(Client,      true,          false,    false);
    56     CreateGameMode(Standalone,  true,          true,     false);
    57     CreateGameMode(Dedicated,   false,         true,     true );
     44    Settings* Settings::singletonRef_s = 0;
    5845
    5946    /**
     
    6249    */
    6350    Settings::Settings()
     51        : bShowsGraphics_(false)
     52        , bHasServer_(false)
    6453    {
    6554        RegisterRootObject(Settings);
    66         gameMode_ = GameMode::GM_None;
     55        assert(singletonRef_s == 0);
     56        singletonRef_s = this;
    6757        setConfigValues();
    68     }
    69 
    70     /**
    71     @brief
    72         Returns a unique instance of Core.
    73     @return
    74         The instance
    75     */
    76     Settings& Settings::getInstance()
    77     {
    78         static Settings instance;
    79         return instance;
    8058    }
    8159
     
    11088    }
    11189
    112     /**
    113     @brief
    114         Sets the game mode.
    115     */
    116     /*static*/ void Settings::setGameMode(const std::string& mode)
    117     {
    118         std::string modeL = getLowercase(mode);
    119         std::map<std::string, const GameMode*>::const_iterator it = getInstance().gameModes_.find(modeL);
    120         if (it != getInstance().gameModes_.end())
    121             getInstance().gameMode_ = *(*it).second;
    122         else
    123         {
    124             COUT(2) << "Warning: mode \"" << mode << "\" doesn't exist. "
    125                     << "Defaulting to 'Standalone'" << std::endl;
    126             getInstance().gameMode_ = GameMode::GM_Standalone;
    127         }
    128     }
    129 
    130     /*static*/ bool Settings::addGameMode(const GameMode* mode)
    131     {
    132         getInstance().gameModes_[getLowercase(mode->name)] = mode;
    133         return true;
    134     }
    135 
    136 
    137     /**
    138     @brief
    139         Gets an argument from the command line by name.
    140     @return
    141         Is 0 if name was not found.
    142     */
    143     /*static*/ const Settings::CommandLineArgument* Settings::getCommandLineArgument(const std::string &name)
    144     {
    145         std::map<std::string, CommandLineArgument>::const_iterator it = getInstance().commandArguments_.find(name);
    146         if (it != getInstance().commandArguments_.end())
    147         {
    148             return &((*it).second);
    149         }
    150         else
    151             return 0;
    152     }
    153 
    15490}
  • code/branches/gui/src/orxonox/Settings.h

    r1638 r1663  
    4747namespace orxonox
    4848{
    49     /**
    50     @brief
    51         Defines a bit field structure that holds the mode as enum plus
    52         the attributes as single named bits.
    53         Every different GameMode is stored as static const, but if you wish to
    54         compare two modes, you will have to use the 'mode' member variable.
    55     */
    56     struct GameMode
     49    class _OrxonoxExport Settings : public OrxonoxClass
    5750    {
    58         enum Mode
    59         {
    60             None,
    61             Unspecified,
    62             Server,
    63             Client,
    64             Standalone,
    65             Dedicated,
    66         };
     51        friend class ClassIdentifier<Settings>;
     52        friend class GSRoot;
    6753
    68         Mode mode;
    69         bool showsGraphics;
    70         bool isMaster;
    71         bool hasServer;
    72         std::string name;
     54    public:
     55        static const std::string& getDataPath()
     56        { assert(singletonRef_s); return singletonRef_s->dataPath_; }
     57        static void tsetDataPath(const std::string& path)
     58        { assert(singletonRef_s); singletonRef_s->_tsetDataPath(path); }
    7359
    74         static const GameMode GM_None;
    75         static const GameMode GM_Unspecified;
    76         static const GameMode GM_Server;
    77         static const GameMode GM_Client;
    78         static const GameMode GM_Standalone;
    79         static const GameMode GM_Dedicated;
    80     };
     60        // an alternative to a global game mode variable
     61        static bool showsGraphics() { assert(singletonRef_s); return singletonRef_s->bShowsGraphics_; }
     62        static bool hasServer()     { assert(singletonRef_s); return singletonRef_s->bHasServer_; }
    8163
    8264
    83     class _OrxonoxExport Settings : public OrxonoxClass
    84     {
    85     public:
    86         struct CommandLineArgument
    87         {
    88             std::string name_;
    89             MultiTypeMath value_;
    90             bool bHasDefaultValue_;
    91         };
     65    private:
     66        // GSRoot has access to these
     67        static void setShowsGraphics(bool val) { assert(singletonRef_s); singletonRef_s->bShowsGraphics_ = val; }
     68        static void setHasServer    (bool val) { assert(singletonRef_s); singletonRef_s->bHasServer_     = val; }
     69
     70        Settings();
     71        Settings(const Settings& instance);
     72        ~Settings() { singletonRef_s = 0; }
     73
     74        static Settings& _getInstance() { assert(singletonRef_s); return *singletonRef_s; }
     75        void _tsetDataPath(const std::string& path);
    9276
    9377        void setConfigValues();
    9478
    95         static const std::string& getDataPath();
    96         static void tsetDataPath(const std::string& path);
     79        bool bShowsGraphics_;                                  //!< global variable that tells whether to show graphics
     80        bool bHasServer_;                                      //!< global variable that tells whether this is a server
    9781
    98         static const GameMode& getGameMode();
    99         static const GameMode& getGameMode(const std::string& name);
    100         static void setGameMode(const GameMode& mode);
    101         static void setGameMode(const std::string& mode);
    102         static bool addGameMode(const GameMode* mode);
     82        std::string dataPath_;                                 //!< Path to the game data
    10383
    104         static const CommandLineArgument* getCommandLineArgument(const std::string& name);
    105         template <class T>
    106         static bool addCommandLineArgument(const std::string &name, const std::string& valueStr, const T& defaultValue);
    107 
    108     private:
    109         Settings();
    110         Settings(const Settings& instance);
    111         ~Settings() { }
    112         static Settings& getInstance();
    113 
    114         void _tsetDataPath(const std::string& path);
    115 
    116         std::string dataPath_;                                        //!< Path to the game data
    117         GameMode gameMode_;                                           //!< Current game mode
    118         std::map<std::string, const GameMode*> gameModes_;            //!< Holds all game modes for easy string access
    119         //! holds all command line arguments (even if not given!)
    120         std::map<std::string, CommandLineArgument> commandArguments_;
     84        static Settings* singletonRef_s;                       //!< Static pointer to the only instance.
    12185    };
    12286
    123     /**
    124     @brief
    125         Returns the relative path to the game data.
    126     */
    127     inline const std::string& Settings::getDataPath()
    128     {
    129         return getInstance().dataPath_;
    130     }
    131 
    132     inline void Settings::tsetDataPath(const std::string& path)
    133     {
    134         getInstance()._tsetDataPath(path);
    135     }
    136 
    137     inline const GameMode& Settings::getGameMode()
    138     {
    139         return getInstance().gameMode_;
    140     }
    141 
    142     inline const GameMode& Settings::getGameMode(const std::string& name)
    143     {
    144         if (getInstance().gameModes_.find(name) != getInstance().gameModes_.end())
    145             return *getInstance().gameModes_[name];
    146         else
    147         {
    148             COUT(2) << "Warning: GameMode '" << name << "' doesn't exist." << std::endl;
    149             return GameMode::GM_None;
    150         }
    151     }
    152 
    153     inline void Settings::setGameMode(const GameMode& mode)
    154     {
    155         getInstance().gameMode_ = mode;
    156     }
    157 
    158     /**
    159     @brief
    160         Adds one argument of the command line to the map of command line arguments.
    161     @param name
    162         Name of the command line option.
    163     @param valueStr
    164         The value of the command line option as string
    165     @param defaultValue
    166         Default value for the option (marked when used).
    167     @return
    168         Dummy return value to enable code execution before main().
    169     */
    170     template <class T>
    171     bool Settings::addCommandLineArgument(const std::string &name, const std::string& valueStr, const T& defaultValue)
    172     {
    173         T value;
    174         bool useDefault = false;
    175         if (valueStr == "")
    176         {
    177             // note: ArgReader only returns "" for not found arguments, " " otherwise for empty ones.
    178             value = defaultValue;
    179             useDefault = true;
    180         }
    181         else if (!convertValue(&value, valueStr))
    182         {
    183             COUT(1) << "Command Line: Couldn't read option '" << name << "'." << std::endl;
    184             return false;
    185         }
    186         CommandLineArgument arg = { name, MultiTypeMath(value), useDefault };
    187         getInstance().commandArguments_[name] = arg;
    188         return true;
    189     }
    19087}
    19188
  • code/branches/gui/src/orxonox/gamestates/GSLevel.cc

    r1662 r1663  
    3535#include "core/input/KeyBinder.h"
    3636#include "core/Loader.h"
     37#include "core/CommandLine.h"
    3738#include "overlays/console/InGameConsole.h"
    3839#include "gui/GUIManager.h"
     
    4546namespace orxonox
    4647{
     48    SetCommandLineArgument(port, 55556).setShortcut("p");
     49    SetCommandLineArgument(ip, std::string("127.0.0.0"));
     50
    4751    GSLevel::GSLevel()
    4852        : GameState("level")
  • code/branches/gui/src/orxonox/gamestates/GSRoot.cc

    r1662 r1663  
    3838#include "core/TclBind.h"
    3939#include "core/Core.h"
     40#include "core/CommandLine.h"
    4041#include "GraphicsEngine.h"
    4142#include "Settings.h"
     
    4344namespace orxonox
    4445{
     46    SetCommandLineArgument(dataPath, std::string("./"));
     47
    4548    GSRoot::GSRoot()
    4649        : GameState("root")
     50        , settings_(0)
    4751        , graphicsEngine_(0)
    4852    {
     
    6468        Factory::createClassHierarchy();
    6569
    66         const Settings::CommandLineArgument* dataPath = Settings::getCommandLineArgument("dataPath");
    67         assert(dataPath);
    68         if (!dataPath->bHasDefaultValue_)
     70        // instantiate Settings class
     71        this->settings_ = new Settings();
     72
     73        const CommandLineArgument<std::string>* dataPath = CommandLine::getCommandLineArgument<std::string>("dataPath");
     74        if (!dataPath->hasDefaultValue())
    6975        {
    70             if (*dataPath->value_.getString().end() != '/' && *dataPath->value_.getString().end() != '\\')
    71                 Settings::tsetDataPath(dataPath->value_.getString() + "/");
     76            if (*dataPath->getValue().end() != '/' && *dataPath->getValue().end() != '\\')
     77                Settings::tsetDataPath(dataPath->getValue() + "/");
    7278            else
    73                 Settings::tsetDataPath(dataPath->value_.getString());
     79                Settings::tsetDataPath(dataPath->getValue());
    7480        }
    7581
     
    8995    void GSRoot::leave()
    9096    {
    91         if (this->graphicsEngine_)
    92             delete graphicsEngine_;
     97        delete graphicsEngine_;
     98
     99        delete settings_;
    93100    }
    94101
  • code/branches/gui/src/orxonox/gamestates/GSRoot.h

    r1662 r1663  
    4848        void leave();
    4949
     50        Settings*             settings_;
    5051        GraphicsEngine*       graphicsEngine_;   //!< our dearest graphics engine <3
    5152    };
Note: See TracChangeset for help on using the changeset viewer.