Changeset 873 for code/branches/core2/src/orxonox/Orxonox.cc
- Timestamp:
- Mar 9, 2008, 5:27:07 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core2/src/orxonox/Orxonox.cc
r871 r873 58 58 // loader and audio 59 59 //#include "loader/LevelLoader.h" 60 #include "audio/AudioManager.h"60 //#include "audio/AudioManager.h" 61 61 62 62 // 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" 66 66 67 67 // objects 68 68 #include "objects/Tickable.h" 69 69 #include "tools/Timer.h" 70 #include "objects/NPC.h"70 //#include "objects/NPC.h" 71 71 #include "core/ArgReader.h" 72 72 #include "core/Factory.h" 73 73 #include "core/Debug.h" 74 74 #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" 77 77 #include "GraphicsEngine.h" 78 78 … … 85 85 { 86 86 public: 87 OrxListener(OIS::Keyboard *keyboard , audio::AudioManager* auMan, gameMode mode)87 OrxListener(OIS::Keyboard *keyboard/*, audio::AudioManager* auMan*/, gameMode mode) 88 88 { 89 89 mKeyboard = keyboard; 90 90 mode_=mode; 91 auMan_ = auMan;91 // auMan_ = auMan; 92 92 } 93 93 94 94 bool frameStarted(const Ogre::FrameEvent& evt) 95 95 { 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); 103 103 104 104 usleep(10); … … 107 107 return !mKeyboard->isKeyDown(OIS::KC_ESCAPE); 108 108 } 109 109 /* 110 110 void updateAI() 111 111 { … … 115 115 } 116 116 } 117 117 */ 118 118 private: 119 119 gameMode mode_; 120 120 OIS::Keyboard *mKeyboard; 121 audio::AudioManager* auMan_;121 // audio::AudioManager* auMan_; 122 122 }; 123 123 … … 133 133 this->dataPath_ = ""; 134 134 // this->loader_ = 0; 135 this->auMan_ = 0;135 // this->auMan_ = 0; 136 136 this->singletonRef_ = 0; 137 137 this->keyboard_ = 0; … … 214 214 //ogre_->getRoot()->addFrameListener(new network::ServerFrameListener()); 215 215 //std::cout << "could not add framelistener" << std::endl; 216 server_g->open();216 // server_g->open(); 217 217 break; 218 218 case CLIENT: 219 client_g->establishConnection();219 // client_g->establishConnection(); 220 220 break; 221 221 case SERVER: … … 280 280 createFrameListener(); 281 281 try{ 282 server_g = new network::Server(); //!< add port and bindadress283 server_g->open(); //!< open server and create listener thread284 if(ogre_ && ogre_->getRoot())285 ogre_->getRoot()->addFrameListener(new network::ServerFrameListener()); // adds a framelistener for the server282 // 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 286 286 COUT(3) << "Info: network framelistener added" << std::endl; 287 287 } … … 304 304 ogre_->setConfigPath(path); 305 305 ogre_->setup(); 306 server_g = new network::Server(); // FIXME add some settings if wanted306 // server_g = new network::Server(); // FIXME add some settings if wanted 307 307 if(!ogre_->load()) die(/* unable to load */); 308 308 // FIXME add network framelistener … … 314 314 ogre_->setConfigPath(path); 315 315 ogre_->setup(); 316 if(serverIp_.compare("")==0)317 client_g = new network::Client();318 else319 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); 320 320 if(!ogre_->load()) die(/* unable to load */); 321 ogre_->getRoot()->addFrameListener(new network::ClientFrameListener());321 // ogre_->getRoot()->addFrameListener(new network::ClientFrameListener()); 322 322 } 323 323 … … 375 375 { 376 376 // Init audio 377 auMan_ = new audio::AudioManager();378 379 bulletMgr_ = new BulletManager();377 // auMan_ = new audio::AudioManager(); 378 379 // bulletMgr_ = new BulletManager(); 380 380 381 381 // load this file from config … … 385 385 Loader::open(startlevel); 386 386 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(); 393 393 394 394 /* … … 461 461 462 462 //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_); 464 464 ogre_->getRoot()->addFrameListener(frameListener_); 465 465 }
Note: See TracChangeset
for help on using the changeset viewer.