Changeset 3280 for code/trunk/src/orxonox/gamestates
- Timestamp:
- Jul 12, 2009, 11:58:01 PM (15 years ago)
- Location:
- code/trunk
- Files:
-
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
/code/branches/core4 (added) merged: 3235-3237,3245-3250,3253-3254,3260-3261,3265,3270
- Property svn:mergeinfo changed
-
code/trunk/src/orxonox/gamestates/GSClient.cc
r3196 r3280 38 38 namespace orxonox 39 39 { 40 AddGameState(GSClient, "client");40 DeclareGameState(GSClient, "client", false, true); 41 41 42 SetCommandLineArgument(ip, "127.0.0.1").information(" #.#.#.#");42 SetCommandLineArgument(ip, "127.0.0.1").information("Sever IP as strin in the form #.#.#.#"); 43 43 44 GSClient::GSClient(const std::string& name)45 : GameState( name)44 GSClient::GSClient(const GameStateConstrParams& params) 45 : GameState(params) 46 46 , client_(0) 47 47 { -
code/trunk/src/orxonox/gamestates/GSClient.h
r3196 r3280 40 40 { 41 41 public: 42 GSClient(const std::string& name);42 GSClient(const GameStateConstrParams& params); 43 43 ~GSClient(); 44 44 -
code/trunk/src/orxonox/gamestates/GSDedicated.cc
r3205 r3280 51 51 const unsigned int MAX_COMMAND_LENGTH = 255; 52 52 53 AddGameState(GSDedicated, "dedicated");53 DeclareGameState(GSDedicated, "dedicated", false, false); 54 54 55 55 termios* GSDedicated::originalTerminalSettings_; 56 56 57 GSDedicated::GSDedicated(const std::string& name)58 : GameState( name)57 GSDedicated::GSDedicated(const GameStateConstrParams& params) 58 : GameState(params) 59 59 , server_(0) 60 60 , timeSinceLastUpdate_(0) -
code/trunk/src/orxonox/gamestates/GSDedicated.h
r3198 r3280 48 48 { 49 49 public: 50 GSDedicated(const std::string& name);50 GSDedicated(const GameStateConstrParams& params); 51 51 ~GSDedicated(); 52 52 -
code/trunk/src/orxonox/gamestates/GSGraphics.cc
r3196 r3280 57 57 namespace orxonox 58 58 { 59 AddGameState(GSGraphics, "graphics", false);60 61 GSGraphics::GSGraphics(const std::string& name, bool countTickTime)62 : GameState( name, countTickTime)59 DeclareGameState(GSGraphics, "graphics", true, true); 60 61 GSGraphics::GSGraphics(const GameStateConstrParams& params) 62 : GameState(params) 63 63 , inputManager_(0) 64 64 , console_(0) … … 108 108 setConfigValues(); 109 109 110 // initialise graphics manager. Doesn't load the render window yet!110 // Load OGRE including the render window 111 111 this->graphicsManager_ = new GraphicsManager(); 112 this->graphicsManager_->initialise();113 112 114 113 // load debug overlay … … 198 197 void GSGraphics::toggleGUI() 199 198 { 200 199 GUIManager::getInstance().executeCode("toggleGUI()"); 201 200 } 202 201 -
code/trunk/src/orxonox/gamestates/GSGraphics.h
r3196 r3280 52 52 { 53 53 public: 54 GSGraphics(const std::string& name, bool countTickTime);54 GSGraphics(const GameStateConstrParams& params); 55 55 ~GSGraphics(); 56 56 void setConfigValues(); -
code/trunk/src/orxonox/gamestates/GSIOConsole.cc
r3196 r3280 36 36 namespace orxonox 37 37 { 38 AddGameState(GSIOConsole, "ioConsole");38 DeclareGameState(GSIOConsole, "ioConsole", false, false); 39 39 40 GSIOConsole::GSIOConsole(const std::string& name)41 : GameState( name)40 GSIOConsole::GSIOConsole(const GameStateConstrParams& params) 41 : GameState(params) 42 42 { 43 43 } -
code/trunk/src/orxonox/gamestates/GSIOConsole.h
r2896 r3280 38 38 { 39 39 public: 40 GSIOConsole(const std::string& name);40 GSIOConsole(const GameStateConstrParams& params); 41 41 ~GSIOConsole(); 42 42 -
code/trunk/src/orxonox/gamestates/GSLevel.cc
r3196 r3280 34 34 #include "core/input/KeyBinder.h" 35 35 #include "core/Clock.h" 36 #include "core/CommandLine.h"37 36 #include "core/ConsoleCommand.h" 38 37 #include "core/ConfigValueIncludes.h" … … 56 55 namespace orxonox 57 56 { 58 AddGameState(GSLevel, "level"); 59 60 SetCommandLineArgument(level, "").shortcut("l"); 57 DeclareGameState(GSLevel, "level", false, true); 61 58 SetConsoleCommand(GSLevel, showIngameGUI, true); 62 59 63 60 XMLFile* GSLevel::startFile_s = NULL; 64 61 65 GSLevel::GSLevel(const std::string& name)66 : GameState( name)62 GSLevel::GSLevel(const GameStateConstrParams& params) 63 : GameState(params) 67 64 , keyBinder_(0) 68 65 , gameInputState_(0) … … 71 68 , radar_(0) 72 69 , cameraManager_(0) 73 , levelManager_(0)74 70 { 75 71 RegisterObject(GSLevel); … … 120 116 if (GameMode::isMaster()) 121 117 { 122 // create the global LevelManager123 this->levelManager_ = new LevelManager();124 125 118 this->loadLevel(); 126 119 } … … 202 195 } 203 196 204 if (this->levelManager_)205 {206 delete this->levelManager_;207 this->levelManager_ = 0;208 }209 210 197 if (this->playerManager_) 211 198 { … … 252 239 // call the loader 253 240 COUT(0) << "Loading level..." << std::endl; 254 std::string levelName; 255 CommandLine::getValue("level", &levelName); 256 if (levelName == "") 257 startFile_s = new XMLFile(Core::getMediaPathString() + "levels" + '/' + Game::getInstance().getLevel()); 258 else 259 startFile_s = new XMLFile(Core::getMediaPathString() + "levels" + '/' + levelName); 241 startFile_s = new XMLFile(Core::getMediaPathString() + "levels" + '/' + LevelManager::getInstance().getDefaultLevel()); 260 242 Loader::open(startFile_s); 261 243 } -
code/trunk/src/orxonox/gamestates/GSLevel.h
r3196 r3280 41 41 { 42 42 public: 43 GSLevel(const std::string& name);43 GSLevel(const GameStateConstrParams& params); 44 44 ~GSLevel(); 45 45 void setConfigValues(); … … 68 68 Radar* radar_; //!< represents the Radar (not the HUD part) 69 69 CameraManager* cameraManager_; //!< camera manager for this level 70 LevelManager* levelManager_; //!< global level manager71 70 PlayerManager* playerManager_; //!< player manager for this level 72 71 QuestManager* questManager_; -
code/trunk/src/orxonox/gamestates/GSMainMenu.cc
r3196 r3280 43 43 namespace orxonox 44 44 { 45 AddGameState(GSMainMenu, "mainMenu");45 DeclareGameState(GSMainMenu, "mainMenu", false, true); 46 46 47 GSMainMenu::GSMainMenu(const std::string& name)48 : GameState( name)47 GSMainMenu::GSMainMenu(const GameStateConstrParams& params) 48 : GameState(params) 49 49 , inputState_(0) 50 50 { … … 67 67 68 68 // show main menu 69 GUIManager::getInstance().showGUI("mainmenu_ 2");69 GUIManager::getInstance().showGUI("mainmenu_3"); 70 70 GUIManager::getInstance().setCamera(this->camera_); 71 71 GraphicsManager::getInstance().setCamera(this->camera_); -
code/trunk/src/orxonox/gamestates/GSMainMenu.h
r3196 r3280 40 40 { 41 41 public: 42 GSMainMenu(const std::string& name);42 GSMainMenu(const GameStateConstrParams& params); 43 43 ~GSMainMenu(); 44 44 -
code/trunk/src/orxonox/gamestates/GSRoot.cc
r3196 r3280 37 37 #include "interfaces/TimeFactorListener.h" 38 38 #include "interfaces/Tickable.h" 39 #include "LevelManager.h" 39 40 40 41 namespace orxonox 41 42 { 42 AddGameState(GSRoot, "root", false);43 SetCommandLineSwitch(console) ;43 DeclareGameState(GSRoot, "root", true, false); 44 SetCommandLineSwitch(console).information("Start in console mode (text IO only)"); 44 45 // Shortcuts for easy direct loading 45 SetCommandLineSwitch(server) ;46 SetCommandLineSwitch(client) ;47 SetCommandLineSwitch(dedicated) ;48 SetCommandLineSwitch(standalone) ;49 50 GSRoot::GSRoot(const std::string& name, bool countTickTime)51 : GameState( name, countTickTime)46 SetCommandLineSwitch(server).information("Start in server mode"); 47 SetCommandLineSwitch(client).information("Start in client mode"); 48 SetCommandLineSwitch(dedicated).information("Start in dedicated server mode"); 49 SetCommandLineSwitch(standalone).information("Start in standalone mode"); 50 51 GSRoot::GSRoot(const GameStateConstrParams& params) 52 : GameState(params) 52 53 , timeFactor_(1.0f) 53 54 , bPaused_(false) … … 83 84 } 84 85 86 // create the global LevelManager 87 this->levelManager_ = new LevelManager(); 88 85 89 // Load level directly? 86 90 bool loadLevel = false; … … 129 133 } 130 134 */ 135 136 delete this->levelManager_; 131 137 } 132 138 -
code/trunk/src/orxonox/gamestates/GSRoot.h
r3196 r3280 38 38 { 39 39 public: 40 GSRoot(const std::string& name, bool countTickTime);40 GSRoot(const GameStateConstrParams& params); 41 41 ~GSRoot(); 42 42 … … 52 52 53 53 private: 54 float timeFactor_; //!< A factor that sets the gamespeed. 1 is normal.54 float timeFactor_; //!< A factor that sets the gamespeed. 1 is normal. 55 55 bool bPaused_; 56 56 float timeFactorPauseBackup_; 57 58 LevelManager* levelManager_; //!< global level manager 57 59 58 60 // console commands -
code/trunk/src/orxonox/gamestates/GSServer.cc
r3196 r3280 37 37 namespace orxonox 38 38 { 39 AddGameState(GSServer, "server");39 DeclareGameState(GSServer, "server", false, true); 40 40 41 SetCommandLineArgument(port, 55556).shortcut("p").information(" 0-65535");41 SetCommandLineArgument(port, 55556).shortcut("p").information("Network communication port to be used 0-65535 (default: 55556)"); 42 42 43 GSServer::GSServer(const std::string& name)44 : GameState( name)43 GSServer::GSServer(const GameStateConstrParams& params) 44 : GameState(params) 45 45 , server_(0) 46 46 { -
code/trunk/src/orxonox/gamestates/GSServer.h
r3196 r3280 40 40 { 41 41 public: 42 GSServer(const std::string& name);42 GSServer(const GameStateConstrParams& params); 43 43 ~GSServer(); 44 44 -
code/trunk/src/orxonox/gamestates/GSStandalone.cc
r3196 r3280 34 34 namespace orxonox 35 35 { 36 AddGameState(GSStandalone, "standalone");36 DeclareGameState(GSStandalone, "standalone", false, true); 37 37 38 GSStandalone::GSStandalone(const std::string& name)39 : GameState( name)38 GSStandalone::GSStandalone(const GameStateConstrParams& params) 39 : GameState(params) 40 40 { 41 41 } -
code/trunk/src/orxonox/gamestates/GSStandalone.h
r2896 r3280 38 38 { 39 39 public: 40 GSStandalone(const std::string& name);40 GSStandalone(const GameStateConstrParams& params); 41 41 ~GSStandalone(); 42 42
Note: See TracChangeset
for help on using the changeset viewer.