Changeset 1663 for code/branches/gui/src/orxonox/gamestates/GSRoot.cc
- Timestamp:
- Aug 20, 2008, 10:30:28 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/gui/src/orxonox/gamestates/GSRoot.cc
r1662 r1663 38 38 #include "core/TclBind.h" 39 39 #include "core/Core.h" 40 #include "core/CommandLine.h" 40 41 #include "GraphicsEngine.h" 41 42 #include "Settings.h" … … 43 44 namespace orxonox 44 45 { 46 SetCommandLineArgument(dataPath, std::string("./")); 47 45 48 GSRoot::GSRoot() 46 49 : GameState("root") 50 , settings_(0) 47 51 , graphicsEngine_(0) 48 52 { … … 64 68 Factory::createClassHierarchy(); 65 69 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()) 69 75 { 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() + "/"); 72 78 else 73 Settings::tsetDataPath(dataPath-> value_.getString());79 Settings::tsetDataPath(dataPath->getValue()); 74 80 } 75 81 … … 89 95 void GSRoot::leave() 90 96 { 91 if (this->graphicsEngine_) 92 delete graphicsEngine_; 97 delete graphicsEngine_; 98 99 delete settings_; 93 100 } 94 101
Note: See TracChangeset
for help on using the changeset viewer.