Changeset 2101 for code/branches/objecthierarchy/src/orxonox/Main.cc
- Timestamp:
- Nov 2, 2008, 12:09:55 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/objecthierarchy/src/orxonox/Main.cc
r2030 r2101 42 42 #include "util/SignalHandler.h" 43 43 #include "core/ConfigFileManager.h" 44 #include "core/CommandLine.h" 44 45 45 46 #include "gamestates/GSRoot.h" … … 51 52 #include "gamestates/GSGUI.h" 52 53 #include "gamestates/GSIOConsole.h" 53 54 using namespace orxonox;55 54 56 55 #if ORXONOX_PLATFORM == ORXONOX_PLATFORM_APPLE … … 86 85 //#endif 87 86 87 SetCommandLineArgument(settingsFile, "orxonox.ini"); 88 88 89 int main(int argc, char** argv) 89 90 { 91 using namespace orxonox; 92 90 93 // create a signal handler (only works for linux) 91 94 SignalHandler::getInstance()->doCatch(argv[0], "orxonox.log"); 92 95 93 // Specifiy config file before creating the GameStates in order to have 96 // Parse command line arguments 97 try 98 { 99 CommandLine::parseAll(argc, argv); 100 } 101 catch (ArgumentException& ex) 102 { 103 COUT(1) << ex.what() << std::endl; 104 COUT(0) << "Usage:" << std::endl << "orxonox " << CommandLine::getUsageInformation() << std::endl; 105 } 106 107 // Create the ConfigFileManager before creating the GameStates in order to have 94 108 // setConfigValues() in the constructor (required). 95 ConfigFileManager::getInstance().setFile(CFT_Settings, "orxonox.ini"); 109 ConfigFileManager* configFileManager = new ConfigFileManager(); 110 configFileManager->setFilename(ConfigFileType::Settings, CommandLine::getValue("settingsFile").getString()); 96 111 97 112 // create the gamestates … … 115 130 116 131 // Here happens the game 117 root.start(argc, argv); 132 root.start(); 133 134 // Destroy ConfigFileManager again. 135 delete configFileManager; 118 136 119 137 return 0;
Note: See TracChangeset
for help on using the changeset viewer.