Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 1493 for code/branches/network


Ignore:
Timestamp:
May 31, 2008, 10:35:56 PM (17 years ago)
Author:
rgrieder
Message:
  • declared the ogre LogManager problem a linux one..
  • removed the shader hacks in Orxonox::loadScene()
Location:
code/branches/network/src/orxonox
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • code/branches/network/src/orxonox/GraphicsEngine.cc

    r1487 r1493  
    157157      myLog = logger->createLog("ogre.log", true, false, true);
    158158    else
    159           myLog = logger->createLog(this->ogreLogfile_, true, false, false);
     159      myLog = logger->createLog(this->ogreLogfile_, true, false, false);
    160160    CCOUT(4) << "Ogre Log created" << std::endl;
    161161
     
    166166    // Root will detect that we've already created a Log
    167167    CCOUT(4) << "Creating Ogre Root..." << std::endl;
    168     root_ = new Ogre::Root(plugin_filename);
     168
     169    root_ = new Ogre::Root(plugin_filename, "ogre.cfg", this->ogreLogfile_);
     170
     171#if ORXONOX_PLATFORM != ORXONOX_PLATFORM_WIN32
     172    // tame the ogre ouput so we don't get all the mess in the console
     173    Ogre::Log* defaultLog = Ogre::LogManager::getSingleton().getDefaultLog();
     174    defaultLog->setDebugOutputEnabled(false);
     175    defaultLog->setLogDetail(Ogre::LL_BOREME);
     176    defaultLog->addListener(this);
     177#endif
     178
    169179    CCOUT(4) << "Creating Ogre Root done" << std::endl;
    170180
     
    251261  bool GraphicsEngine::createNewScene()
    252262  {
    253     CCOUT(4) << "Creating new SceneManager" << std::endl;
     263    CCOUT(4) << "Creating new SceneManager..." << std::endl;
    254264    if (scene_)
    255265    {
  • code/branches/network/src/orxonox/Orxonox.cc

    r1491 r1493  
    187187      mode_ = SERVER;
    188188    else if (mode == "dedicated")
    189       mode_= DEDICATED;
     189      mode_ = DEDICATED;
    190190    else
    191191    {
     
    217217  bool Orxonox::start()
    218218  {
    219     //if (mode_ == DEDICATED)
    220     // do something else
    221     //else
    222 
    223     if (!ogre_->loadRenderer())    // creates the render window
    224       return false;
    225 
    226     // Calls the InputManager which sets up the input devices.
    227     // The render window width and height are used to set up the mouse movement.
    228     if (!InputManager::initialise(ogre_->getWindowHandle(),
    229           ogre_->getWindowWidth(), ogre_->getWindowHeight(), true, true, true))
    230       return false;
    231 
    232     // TODO: Spread this so that this call only initialises things needed for the GUI
    233     if (!ogre_->initialiseResources())
    234       return false;
    235 
    236     // TOOD: load the GUI here
    237     // set InputManager to GUI mode
    238     InputManager::setInputState(InputManager::IS_GUI);
    239     // TODO: run GUI here
    240 
    241     // The following lines depend very much on the GUI output, so they're probably misplaced here..
    242 
    243     InputManager::setInputState(InputManager::IS_NONE);
    244 
    245     if (!loadPlayground())
    246       return false;
     219    if (mode_ == DEDICATED)
     220    {
     221      // do something else
     222    }
     223    else
     224    { // not dedicated server
     225      if (!ogre_->loadRenderer())    // creates the render window
     226        return false;
     227
     228      // Calls the InputManager which sets up the input devices.
     229      // The render window width and height are used to set up the mouse movement.
     230      if (!InputManager::initialise(ogre_->getWindowHandle(),
     231            ogre_->getWindowWidth(), ogre_->getWindowHeight(), true, true, true))
     232        return false;
     233
     234      // TODO: Spread this so that this call only initialises things needed for the GUI
     235      if (!ogre_->initialiseResources())
     236        return false;
     237
     238      // TOOD: load the GUI here
     239      // set InputManager to GUI mode
     240      InputManager::setInputState(InputManager::IS_GUI);
     241      // TODO: run GUI here
     242
     243      // The following lines depend very much on the GUI output, so they're probably misplaced here..
     244
     245      InputManager::setInputState(InputManager::IS_NONE);
     246
     247      // create Ogre SceneManager
     248      ogre_->createNewScene();
     249
     250      if (!loadPlayground())
     251        return false;
     252    }
    247253
    248254    switch (mode_)
     
    256262        return false;
    257263      break;
     264    case DEDICATED:
     265      if (!serverLoad())
     266        return false;
     267      break;
    258268    default:
    259269      if (!standaloneLoad())
     
    272282  bool Orxonox::loadPlayground()
    273283  {
    274     ogre_->createNewScene();
    275 
    276           // Init audio
     284    // Init audio
    277285    //auMan_ = new audio::AudioManager();
    278286    //auMan_->ambientAdd("a1");
     
    346354    Loader::open(startlevel);
    347355   
    348 
    349     Ogre::SceneManager* mSceneMgr = GraphicsEngine::getSingleton().getSceneManager();
     356    // HACK: shader stuff for presentation
     357    /*Ogre::SceneManager* mSceneMgr = GraphicsEngine::getSingleton().getSceneManager();
    350358    mSceneMgr->setAmbientLight(ColourValue(0.4,0.4,0.4));
    351359    Ogre::Light* dirlight = mSceneMgr->createLight("Light1");
    352360
    353        dirlight->setType(Ogre::Light::LT_DIRECTIONAL);
    354        dirlight->setDirection(Vector3( 0, 1, 5 ));
    355        dirlight->setDiffuseColour(ColourValue(0.6, 0.6, 0.4));
    356        dirlight->setSpecularColour(ColourValue(1.0, 1.0, 1.0));
     361    dirlight->setType(Ogre::Light::LT_DIRECTIONAL);
     362    dirlight->setDirection(Vector3( 0, 1, 5 ));
     363    dirlight->setDiffuseColour(ColourValue(0.6, 0.6, 0.4));
     364    dirlight->setSpecularColour(ColourValue(1.0, 1.0, 1.0));*/
    357365   
    358366    return true;
     
    402410
    403411    COUT(3) << "Orxonox: Starting the main loop." << std::endl;
    404           while (!bAbort_)
    405           {
    406                   // Pump messages in all registered RenderWindows
    407       // This calls the WindowEventListener objects.
    408       Ogre::WindowEventUtilities::messagePump();
    409 
     412    while (!bAbort_)
     413    {
    410414      // get current time
    411415      unsigned long now = timer_->getMilliseconds();
     
    419423      // show the current time in the HUD
    420424      // HUD::getSingleton().setTime(now);
    421       if (frameTime > 0.4f)
     425      if (mode_ != DEDICATED && frameTime > 0.4f)
    422426      {
    423427        HUD::getSingleton().setRenderTimeRatio(renderTime / frameTime);
     
    435439      // don't forget to call _fireFrameStarted in ogre to make sure
    436440      // everything goes smoothly
    437       if(mode_!=DEDICATED)
    438         ogreRoot._fireFrameStarted(evt);
     441      ogreRoot._fireFrameStarted(evt);
    439442
    440443      // get current time
     
    442445      calculateEventTime(now, eventTimes[2]);
    443446
    444       if(mode_!=DEDICATED)
    445         ogreRoot._updateAllRenderTargets(); // only render in non-server mode
     447      if (mode_ != DEDICATED)
     448      {
     449        // Pump messages in all registered RenderWindows
     450        // This calls the WindowEventListener objects.
     451        Ogre::WindowEventUtilities::messagePump();
     452
     453        // render
     454        ogreRoot._updateAllRenderTargets();
     455      }
    446456
    447457      // get current time
     
    453463
    454464      // again, just to be sure ogre works fine
    455       if(mode_!=DEDICATED)
    456         ogreRoot._fireFrameEnded(evt);
    457           }
    458 
    459     if (mode_==CLIENT)
     465      ogreRoot._fireFrameEnded(evt);
     466      //msleep(200);
     467    }
     468
     469    if (mode_ == CLIENT)
    460470      network::Client::getSingleton()->closeConnection();
    461     else if (mode_==SERVER)
     471    else if (mode_ == SERVER)
    462472      server_g->close();
    463473
  • code/branches/network/src/orxonox/tools/Mesh.cc

    r1056 r1493  
    4040    unsigned int Mesh::meshCounter_s = 0;
    4141
    42     Mesh::Mesh()
     42    Mesh::Mesh() :
     43      entity_(0)
    4344    {
    44         this->entity_ = 0;
    4545    }
    4646
Note: See TracChangeset for help on using the changeset viewer.