Changeset 568
- Timestamp:
- Dec 17, 2007, 12:09:13 PM (17 years ago)
- Location:
- code/branches/FICN/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/FICN/src/network/GameStateManager.cc
r514 r568 90 90 91 91 GameState *retval=new GameState; //return value 92 retval->id=id ;92 retval->id=id++; 93 93 // reserve a little memory and increase it later on 94 94 retval->data = (unsigned char*)malloc(1); … … 100 100 //get size of the synchronisable 101 101 tempsize=it->getSize(); 102 COUT(2) << "size of synchronisable: " << tempsize << std::endl; 102 103 // add place for data and 3 ints (length,classid,objectid) 103 104 totalsize+=tempsize+3*sizeof(int); -
code/branches/FICN/src/orxonox/objects/BaseEntity.h
r566 r568 16 16 void loadParams(TiXmlElement* xmlElem); 17 17 bool create(); 18 protected: 19 void registerAllVariables(); 18 20 private: 19 void registerAllVariables();20 21 21 // membervariables to be synchronised 22 22 std::string name_; -
code/branches/FICN/src/orxonox/orxonox.cc
r565 r568 217 217 //TODO: read config file 218 218 //TODO: give config file to Ogre 219 std::string mode = ""; 219 std::string mode; 220 if(argc>=2) 221 mode = std::string(argv[1]); 222 else 223 mode = ""; 220 224 ArgReader ar = ArgReader(argc, argv); 221 225 ar.checkArgument("mode", mode, false); … … 226 230 { 227 231 serverInit(path); 232 mode = SERVER; 228 233 } 229 234 else if(mode == std::string("client")) 230 235 { 231 236 clientInit(path); 237 mode = CLIENT; 232 238 } 233 239 else if(mode == std::string("presentation")) 234 240 { 235 playableServer(path); 236 } 237 else 238 standalone(path); 241 serverInit(path); 242 mode = PRESENTATION; 243 } 244 else{ 245 standaloneInit(path); 246 mode = STANDALONE; 247 } 239 248 } 240 249 … … 252 261 createFrameListener(); 253 262 Factory::createClassHierarchy(); 263 switch(mode_){ 264 case PRESENTATION: 265 server_g->open(); 266 break; 267 case SERVER: 268 case CLIENT: 269 case STANDALONE: 270 default: 271 break; 272 } 254 273 startRenderLoop(); 255 274 } … … 274 293 } 275 294 276 void Orxonox::standalone (std::string path)295 void Orxonox::standaloneInit(std::string path) 277 296 { 278 297 ogre_->setConfigPath(path); … … 320 339 startRenderLoop(); 321 340 } 341 342 void Orxonox::standalone(){ 343 344 345 346 } 322 347 323 348 void Orxonox::serverInit(std::string path) … … 327 352 server_g = new network::Server(); // add some settings if wanted 328 353 if(!ogre_->load()) die(/* unable to load */); 354 // add network framelistener 329 355 ogre_->getRoot()->addFrameListener(new network::ServerFrameListener()); 330 ogre_->startRender();331 332 createScene();333 setupScene();334 356 } 335 357 … … 341 363 if(!ogre_->load()) die(/* unable to load */); 342 364 ogre_->getRoot()->addFrameListener(new network::ClientFrameListener()); 343 ogre_->startRender();344 345 createScene();346 setupScene();347 setupInputSystem();348 createFrameListener();349 startRenderLoop();350 365 } 351 366 -
code/branches/FICN/src/orxonox/orxonox.h
r531 r568 23 23 namespace orxonox { 24 24 25 enum gameMode{ 26 STANDALONE, 27 SERVER, 28 CLIENT, 29 PRESENTATION 30 }; 31 25 32 class OrxListener; 26 33 … … 39 46 Orxonox(); 40 47 virtual ~Orxonox(); 48 // init functions 41 49 void serverInit(std::string path); 42 50 void clientInit(std::string path); 43 void standalone(std::string path); 51 void standaloneInit(std::string path); 52 // run functions 44 53 void playableServer(std::string path); 54 void standalone(); 45 55 void defineResources(); 46 56 void setupRenderSystem(); … … 65 75 OrxListener* frameListener_; 66 76 Ogre::Root* root_; 77 78 // this is used to identify the mode (server/client/...) we're in 79 gameMode mode_; 67 80 }; 68 81 }
Note: See TracChangeset
for help on using the changeset viewer.