Changeset 2662 for code/trunk/src/orxonox/Main.cc
- Timestamp:
- Feb 14, 2009, 10:17:35 PM (15 years ago)
- Location:
- code/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
-
code/trunk/src/orxonox/Main.cc
r2103 r2662 43 43 #include "core/ConfigFileManager.h" 44 44 #include "core/CommandLine.h" 45 #include "core/CommandExecutor.h" 46 #include "core/Identifier.h" 47 #include "core/Core.h" 48 #include "core/Language.h" 45 49 46 50 #include "gamestates/GSRoot.h" … … 92 96 93 97 // create a signal handler (only works for linux) 94 SignalHandler::getInstance()->doCatch(argv[0], "orxonox.log"); 98 SignalHandler signalHandler; 99 signalHandler.doCatch(argv[0], "orxonox.log"); 95 100 96 101 // Parse command line arguments … … 109 114 ConfigFileManager* configFileManager = new ConfigFileManager(); 110 115 configFileManager->setFilename(ConfigFileType::Settings, CommandLine::getValue("settingsFile").getString()); 116 // create the Core settings to configure the output level 117 Language* language = new Language(); 118 Core* core = new Core(); 111 119 112 // create the gamestates 113 GSRoot root; 114 GSGraphics graphics; 115 GSStandalone standalone; 116 GSServer server; 117 GSClient client; 118 GSDedicated dedicated; 119 GSGUI gui; 120 GSIOConsole ioConsole; 120 // put GameStates in its own scope so we can destroy the identifiers at the end of main(). 121 { 122 // create the gamestates 123 GSRoot root; 124 GSGraphics graphics; 125 GSStandalone standalone; 126 GSServer server; 127 GSClient client; 128 GSDedicated dedicated; 129 GSGUI gui; 130 GSIOConsole ioConsole; 121 131 122 // make the hierarchy123 root.addChild(&graphics);124 graphics.addChild(&standalone);125 graphics.addChild(&server);126 graphics.addChild(&client);127 graphics.addChild(&gui);128 root.addChild(&ioConsole);129 root.addChild(&dedicated);132 // make the hierarchy 133 root.addChild(&graphics); 134 graphics.addChild(&standalone); 135 graphics.addChild(&server); 136 graphics.addChild(&client); 137 graphics.addChild(&gui); 138 root.addChild(&ioConsole); 139 root.addChild(&dedicated); 130 140 131 // Here happens the game 132 root.start(); 141 // Here happens the game 142 root.start(); 143 } 133 144 134 // Destroy ConfigFileManager again. 145 // destroy singletons 146 delete core; 147 delete language; 135 148 delete configFileManager; 149 150 // Clean up class hierarchy stuff (identifiers, xmlport, configvalue, consolecommand) 151 Identifier::destroyAllIdentifiers(); 152 // destroy command line arguments 153 CommandLine::destroyAllArguments(); 154 // Also delete external console command that don't belong to an Identifier 155 CommandExecutor::destroyExternalCommands(); 136 156 137 157 return 0;
Note: See TracChangeset
for help on using the changeset viewer.