Changeset 3358
- Timestamp:
- Jul 27, 2009, 2:42:37 PM (15 years ago)
- Location:
- code/branches/resource/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/resource/src/core/Game.cc
r3356 r3358 390 390 } 391 391 392 //if (this->bChangingState_)393 //{394 //COUT(2) << "Warning: Requesting GameStates while loading/unloading a GameState is illegal! Ignoring." << std::endl;395 //return;396 //}392 if (this->bChangingState_) 393 { 394 COUT(2) << "Warning: Requesting GameStates while loading/unloading a GameState is illegal! Ignoring." << std::endl; 395 return; 396 } 397 397 398 398 shared_ptr<GameStateTreeNode> lastRequestedNode; -
code/branches/resource/src/orxonox/Main.cc
r3323 r3358 46 46 #include "util/Debug.h" 47 47 #include "util/Exception.h" 48 #include "core/CommandLine.h" 48 49 #include "core/Game.h" 50 51 SetCommandLineSwitch(console).information("Start in console mode (text IO only)"); 52 // Shortcuts for easy direct loading 53 SetCommandLineSwitch(server).information("Start in server mode"); 54 SetCommandLineSwitch(client).information("Start in client mode"); 55 SetCommandLineSwitch(dedicated).information("Start in dedicated server mode"); 56 SetCommandLineSwitch(standalone).information("Start in standalone mode"); 49 57 50 58 /* … … 86 94 87 95 game->requestState("root"); 96 97 // Some development hacks (not really, but in the future, this calls won't make sense anymore) 98 if (CommandLine::getValue("standalone").getBool()) 99 Game::getInstance().requestStates("graphics, standalone, level"); 100 else if (CommandLine::getValue("server").getBool()) 101 Game::getInstance().requestStates("graphics, server, level"); 102 else if (CommandLine::getValue("client").getBool()) 103 Game::getInstance().requestStates("graphics, client, level"); 104 else if (CommandLine::getValue("dedicated").getBool()) 105 Game::getInstance().requestStates("dedicated, level"); 106 else if (CommandLine::getValue("console").getBool()) 107 Game::getInstance().requestStates("ioConsole"); 108 else 109 Game::getInstance().requestStates("graphics, mainMenu"); 88 110 } 89 111 catch (const std::exception& ex) -
code/branches/resource/src/orxonox/gamestates/GSGraphics.cc
r3357 r3358 68 68 masterInputState_ = InputManager::getInstance().createInputState("master", true); 69 69 masterKeyBinder_ = new KeyBinder(); 70 masterInputState_->setKeyHandler(masterKeyBinder_); 70 71 } 71 72 … … 99 100 100 101 masterKeyBinder_->loadBindings("masterKeybindings.ini"); 101 masterInputState_->setKeyHandler(masterKeyBinder_);102 102 103 103 // Load the SoundManager -
code/branches/resource/src/orxonox/gamestates/GSRoot.cc
r3355 r3358 30 30 31 31 #include "core/Clock.h" 32 #include "core/CommandLine.h"33 32 #include "core/ConsoleCommand.h" 34 33 #include "core/Game.h" … … 46 45 { 47 46 DeclareGameState(GSRoot, "root", false, false); 48 SetCommandLineSwitch(console).information("Start in console mode (text IO only)");49 // Shortcuts for easy direct loading50 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 47 55 48 GSRoot::GSRoot(const GameStateInfo& info) … … 95 88 // create the global LevelManager 96 89 this->levelManager_ = new LevelManager(); 97 98 // Load level directly?99 bool loadLevel = false;100 if (CommandLine::getValue("standalone").getBool())101 {102 Game::getInstance().requestStates("graphics, standalone, level");103 loadLevel = true;104 }105 if (CommandLine::getValue("server").getBool())106 {107 Game::getInstance().requestStates("graphics, server, level");108 loadLevel = true;109 }110 if (CommandLine::getValue("client").getBool())111 {112 Game::getInstance().requestStates("graphics, client, level");113 loadLevel = true;114 }115 if (CommandLine::getValue("dedicated").getBool())116 {117 Game::getInstance().requestStates("dedicated, level");118 loadLevel = true;119 }120 121 // Determine where to start otherwise122 if (!loadLevel && !CommandLine::getValue("console").getBool())123 {124 // Also load graphics125 Game::getInstance().requestState("graphics");126 }127 90 } 128 91
Note: See TracChangeset
for help on using the changeset viewer.