Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 534


Ignore:
Timestamp:
Dec 15, 2007, 10:48:50 PM (16 years ago)
Author:
bknecht
Message:

some updates

Location:
code/branches/FICN/src/orxonox
Files:
2 edited

Legend:

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

    r496 r534  
    7575#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
    7676    orx->init(argc, argv, macBundlePath());
    77     //orx->start();
     77    orx->start();
    7878#else
    7979    orx->init(argc, argv, "");
    80     //orx->start();
     80    orx->start();
    8181#endif
    8282
  • code/branches/FICN/src/orxonox/orxonox.cc

    r531 r534  
    217217    //TODO: read config file
    218218    //TODO: give config file to Ogre
    219    
     219
    220220    if(argc >=2 && strcmp(argv[1], "server")==0)
    221221    {
     
    225225    {
    226226      clientInit(path);
    227     } else if(argc >=2 && strcmp(argv[1], "presentation")==0)
     227    }
     228    else if(argc >=2 && strcmp(argv[1], "presentation")==0)
    228229    {
    229230      playableServer(path);
    230     } else
     231    }
     232    else
    231233      standalone(path);
    232234  }
     
    238240  {
    239241    //TODO: start modules
    240 
     242    ogre_->startRender();
    241243    //TODO: run engine
    242   }
    243 
    244   /**
    245    * @return singleton object
    246    */
    247   Orxonox* Orxonox::getSingleton()
    248   {
    249     if (!singletonRef_)
    250       singletonRef_ = new Orxonox();
    251     return singletonRef_;
    252   }
    253 
    254   /**
    255    * error kills orxonox
    256    */
    257   void Orxonox::die(/* some error code */)
    258   {
    259     //TODO: destroy and destruct everything and print nice error msg
    260   }
    261 
    262   void Orxonox::standalone(std::string path)
    263   {
    264     ogre_->setConfigPath(path);
    265     ogre_->setup();
    266     root_ = ogre_->getRoot();
    267     //if(!ogre_->load()) die(/* unable to load */);
    268 
    269     defineResources();
    270     setupRenderSystem();
    271     createRenderWindow();
    272     initializeResourceGroups();
    273244    createScene();
    274245    setupScene();
     
    278249    startRenderLoop();
    279250  }
    280  
     251
     252  /**
     253   * @return singleton object
     254   */
     255  Orxonox* Orxonox::getSingleton()
     256  {
     257    if (!singletonRef_)
     258      singletonRef_ = new Orxonox();
     259    return singletonRef_;
     260  }
     261
     262  /**
     263   * error kills orxonox
     264   */
     265  void Orxonox::die(/* some error code */)
     266  {
     267    //TODO: destroy and destruct everything and print nice error msg
     268  }
     269
     270  void Orxonox::standalone(std::string path)
     271  {
     272    ogre_->setConfigPath(path);
     273    ogre_->setup();
     274    root_ = ogre_->getRoot();
     275    if(!ogre_->load()) die(/* unable to load */);
     276
     277    //defineResources();
     278    //setupRenderSystem();
     279    //createRenderWindow();
     280    //initializeResourceGroups();
     281    /*createScene();
     282    setupScene();
     283    setupInputSystem();
     284    createFrameListener();
     285    Factory::createClassHierarchy();
     286    startRenderLoop();*/
     287  }
     288
    281289  void Orxonox::playableServer(std::string path)
    282290  {
     
    294302    createFrameListener();
    295303    try{
    296     server_g = new network::Server(); // add port and bindadress
    297     server_g->open(); // open server and create listener thread
    298     if(ogre_ && ogre_->getRoot())
    299       ogre_->getRoot()->addFrameListener(new network::ServerFrameListener()); // adds a framelistener for the server
    300     std::cout << "network framelistener added" << std::endl;
    301     } 
     304      server_g = new network::Server(); // add port and bindadress
     305      server_g->open(); // open server and create listener thread
     306      if(ogre_ && ogre_->getRoot())
     307        ogre_->getRoot()->addFrameListener(new network::ServerFrameListener()); // adds a framelistener for the server
     308      std::cout << "network framelistener added" << std::endl;
     309    }
    302310    catch(exception &e)
    303311    {
Note: See TracChangeset for help on using the changeset viewer.