Changeset 7908 for code/forks/sandbox_light/src/orxonox/Main.cc
- Timestamp:
- Feb 17, 2011, 5:47:22 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/forks/sandbox_light/src/orxonox/Main.cc
r7801 r7908 37 37 38 38 #include "core/CommandLineParser.h" 39 #include "core/Game.h" 40 #include "core/LuaState.h" 41 #include "ToluaBindOrxonox.h" 42 #include "ToluaBindNetwork.h" 43 44 DeclareToluaInterface(Orxonox); 45 DeclareToluaInterface(Network); 39 #include "core/Core.h" 46 40 47 41 namespace orxonox 48 42 { 49 SetCommandLineSwitch(console).information("Start in console mode (text IO only)");50 SetCommandLineSwitch(server).information("Start in server mode");51 SetCommandLineSwitch(client).information("Start in client mode");52 SetCommandLineSwitch(dedicated).information("Start in dedicated server mode");53 SetCommandLineSwitch(standalone).information("Start in standalone mode");54 SetCommandLineSwitch(dedicatedClient).information("Start in dedicated client mode");55 56 /* ADD masterserver command */57 SetCommandLineSwitch(masterserver).information("Start in masterserver mode");58 59 43 SetCommandLineArgument(generateDoc, "") 60 44 .information("Generates a Doxygen file from things like SetConsoleCommand"); … … 66 50 int main(const std::string& strCmdLine) 67 51 { 68 Game* game = new Game(strCmdLine);52 Core* core = new Core(strCmdLine); 69 53 70 54 if (CommandLineParser::getValue("generateDoc").getString().empty()) 71 55 { 72 /* TODO make this clear */ 73 game->setStateHierarchy( 74 "root" 75 " graphics" 76 " mainMenu" 77 " standalone,server,client" 78 " level" 79 " server,client,masterserver" 80 " level" 81 ); 82 83 game->requestState("root"); 84 85 // Some development hacks (not really, but in the future, these calls won't make sense anymore) 86 if (CommandLineParser::getValue("standalone").getBool()) 87 Game::getInstance().requestStates("graphics, standalone, level"); 88 else if (CommandLineParser::getValue("server").getBool()) 89 Game::getInstance().requestStates("graphics, server, level"); 90 else if (CommandLineParser::getValue("client").getBool()) 91 Game::getInstance().requestStates("graphics, client, level"); 92 else if (CommandLineParser::getValue("dedicated").getBool()) 93 Game::getInstance().requestStates("server, level"); 94 else if (CommandLineParser::getValue("dedicatedClient").getBool()) 95 Game::getInstance().requestStates("client, level"); 96 /* ADD masterserver command */ 97 else if (CommandLineParser::getValue("masterserver").getBool()) 98 Game::getInstance().requestStates("masterserver"); 99 else 100 { 101 if (!CommandLineParser::getValue("console").getBool()) 102 Game::getInstance().requestStates("graphics, mainMenu"); 103 } 104 105 game->run(); 56 // Start your program here 106 57 } 107 58 108 delete game;59 delete core; 109 60 110 61 return 0;
Note: See TracChangeset
for help on using the changeset viewer.