Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 17, 2007, 12:09:13 PM (16 years ago)
Author:
scheusso
Message:

added capability for presentation mode

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/FICN/src/orxonox/orxonox.cc

    r565 r568  
    217217    //TODO: read config file
    218218    //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 = "";
    220224    ArgReader ar = ArgReader(argc, argv);
    221225    ar.checkArgument("mode", mode, false);
     
    226230    {
    227231      serverInit(path);
     232      mode = SERVER;
    228233    }
    229234    else if(mode == std::string("client"))
    230235    {
    231236      clientInit(path);
     237      mode = CLIENT;
    232238    }
    233239    else if(mode == std::string("presentation"))
    234240    {
    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    }
    239248  }
    240249
     
    252261    createFrameListener();
    253262    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    }
    254273    startRenderLoop();
    255274  }
     
    274293  }
    275294
    276   void Orxonox::standalone(std::string path)
     295  void Orxonox::standaloneInit(std::string path)
    277296  {
    278297    ogre_->setConfigPath(path);
     
    320339    startRenderLoop();
    321340  }
     341 
     342  void Orxonox::standalone(){
     343   
     344   
     345   
     346  }
    322347
    323348  void Orxonox::serverInit(std::string path)
     
    327352    server_g = new network::Server(); // add some settings if wanted
    328353    if(!ogre_->load()) die(/* unable to load */);
     354    // add network framelistener
    329355    ogre_->getRoot()->addFrameListener(new network::ServerFrameListener());
    330     ogre_->startRender();
    331 
    332     createScene();
    333     setupScene();
    334356  }
    335357
     
    341363    if(!ogre_->load()) die(/* unable to load */);
    342364    ogre_->getRoot()->addFrameListener(new network::ClientFrameListener());
    343     ogre_->startRender();
    344 
    345     createScene();
    346     setupScene();
    347     setupInputSystem();
    348     createFrameListener();
    349     startRenderLoop();
    350365  }
    351366
Note: See TracChangeset for help on using the changeset viewer.