Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 9, 2008, 5:27:07 PM (17 years ago)
Author:
landauf
Message:

simplified core2 branch

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core2/src/orxonox/Orxonox.cc

    r871 r873  
    5858// loader and audio
    5959//#include "loader/LevelLoader.h"
    60 #include "audio/AudioManager.h"
     60//#include "audio/AudioManager.h"
    6161
    6262// network
    63 #include "network/Server.h"
    64 #include "network/Client.h"
    65 #include "network/NetworkFrameListener.h"
     63//#include "network/Server.h"
     64//#include "network/Client.h"
     65//#include "network/NetworkFrameListener.h"
    6666
    6767// objects
    6868#include "objects/Tickable.h"
    6969#include "tools/Timer.h"
    70 #include "objects/NPC.h"
     70//#include "objects/NPC.h"
    7171#include "core/ArgReader.h"
    7272#include "core/Factory.h"
    7373#include "core/Debug.h"
    7474#include "core/Loader.h"
    75 #include "hud/HUD.h"
    76 #include "objects/weapon/BulletManager.h"
     75//#include "hud/HUD.h"
     76//#include "objects/weapon/BulletManager.h"
    7777#include "GraphicsEngine.h"
    7878
     
    8585  {
    8686    public:
    87       OrxListener(OIS::Keyboard *keyboard, audio::AudioManager*  auMan, gameMode mode)
     87      OrxListener(OIS::Keyboard *keyboard/*, audio::AudioManager*  auMan*/, gameMode mode)
    8888      {
    8989        mKeyboard = keyboard;
    9090        mode_=mode;
    91         auMan_ = auMan;
     91//        auMan_ = auMan;
    9292      }
    9393
    9494      bool frameStarted(const Ogre::FrameEvent& evt)
    9595      {
    96         auMan_->update();
    97         updateAI();
    98 
    99         if(mode_ == PRESENTATION)
    100           server_g->tick(evt.timeSinceLastFrame);
    101         else if(mode_ == CLIENT)
    102           client_g->tick(evt.timeSinceLastFrame);
     96//        auMan_->update();
     97//        updateAI();
     98
     99//        if(mode_ == PRESENTATION)
     100//          server_g->tick(evt.timeSinceLastFrame);
     101//        else if(mode_ == CLIENT)
     102//          client_g->tick(evt.timeSinceLastFrame);
    103103
    104104        usleep(10);
     
    107107        return !mKeyboard->isKeyDown(OIS::KC_ESCAPE);
    108108      }
    109 
     109/*
    110110      void updateAI()
    111111      {
     
    115115        }
    116116      }
    117 
     117*/
    118118    private:
    119119      gameMode mode_;
    120120      OIS::Keyboard *mKeyboard;
    121       audio::AudioManager*  auMan_;
     121//      audio::AudioManager*  auMan_;
    122122  };
    123123
     
    133133    this->dataPath_ = "";
    134134//    this->loader_ = 0;
    135     this->auMan_ = 0;
     135//    this->auMan_ = 0;
    136136    this->singletonRef_ = 0;
    137137    this->keyboard_ = 0;
     
    214214      //ogre_->getRoot()->addFrameListener(new network::ServerFrameListener());
    215215      //std::cout << "could not add framelistener" << std::endl;
    216       server_g->open();
     216//      server_g->open();
    217217      break;
    218218    case CLIENT:
    219       client_g->establishConnection();
     219//      client_g->establishConnection();
    220220      break;
    221221    case SERVER:
     
    280280    createFrameListener();
    281281    try{
    282       server_g = new network::Server(); //!< add port and bindadress
    283       server_g->open(); //!< open server and create listener thread
    284       if(ogre_ && ogre_->getRoot())
    285         ogre_->getRoot()->addFrameListener(new network::ServerFrameListener()); // adds a framelistener for the server
     282//      server_g = new network::Server(); //!< add port and bindadress
     283//      server_g->open(); //!< open server and create listener thread
     284//      if(ogre_ && ogre_->getRoot())
     285//        ogre_->getRoot()->addFrameListener(new network::ServerFrameListener()); // adds a framelistener for the server
    286286      COUT(3) << "Info: network framelistener added" << std::endl;
    287287    }
     
    304304    ogre_->setConfigPath(path);
    305305    ogre_->setup();
    306     server_g = new network::Server(); // FIXME add some settings if wanted
     306//    server_g = new network::Server(); // FIXME add some settings if wanted
    307307    if(!ogre_->load()) die(/* unable to load */);
    308308    // FIXME add network framelistener
     
    314314    ogre_->setConfigPath(path);
    315315    ogre_->setup();
    316     if(serverIp_.compare("")==0)
    317       client_g = new network::Client();
    318     else
    319       client_g = new network::Client(serverIp_, 55556);
     316//    if(serverIp_.compare("")==0)
     317//      client_g = new network::Client();
     318//    else
     319//      client_g = new network::Client(serverIp_, 55556);
    320320    if(!ogre_->load()) die(/* unable to load */);
    321     ogre_->getRoot()->addFrameListener(new network::ClientFrameListener());
     321//    ogre_->getRoot()->addFrameListener(new network::ClientFrameListener());
    322322  }
    323323
     
    375375  {
    376376        // Init audio
    377     auMan_ = new audio::AudioManager();
    378 
    379     bulletMgr_ = new BulletManager();
     377//    auMan_ = new audio::AudioManager();
     378
     379//    bulletMgr_ = new BulletManager();
    380380
    381381    // load this file from config
     
    385385    Loader::open(startlevel);
    386386
    387     Ogre::Overlay* hudOverlay = Ogre::OverlayManager::getSingleton().getByName("Orxonox/HUD1.2");
    388     HUD* orxonoxHud;
    389     orxonoxHud = new HUD();
    390     orxonoxHud->setEnergyValue(20);
    391     orxonoxHud->setEnergyDistr(20,20,60);
    392     hudOverlay->show();
     387//    Ogre::Overlay* hudOverlay = Ogre::OverlayManager::getSingleton().getByName("Orxonox/HUD1.2");
     388//    HUD* orxonoxHud;
     389//    orxonoxHud = new HUD();
     390//    orxonoxHud->setEnergyValue(20);
     391//    orxonoxHud->setEnergyDistr(20,20,60);
     392//    hudOverlay->show();
    393393
    394394        /*
     
    461461
    462462    //if(mode_!=CLIENT) // FIXME just a hack ------- remove this in future
    463       frameListener_ = new OrxListener(keyboard_, auMan_, mode_);
     463      frameListener_ = new OrxListener(keyboard_/*, auMan_*/, mode_);
    464464    ogre_->getRoot()->addFrameListener(frameListener_);
    465465  }
Note: See TracChangeset for help on using the changeset viewer.