Changeset 708 for code/branches/FICN/src/orxonox/Orxonox.cc
- Timestamp:
- Dec 28, 2007, 10:30:29 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/FICN/src/orxonox/Orxonox.cc
r673 r708 32 32 33 33 //****** OGRE ****** 34 #include <OgreString.h>35 34 #include <OgreException.h> 36 35 #include <OgreRoot.h> … … 47 46 48 47 //****** STD ******* 49 #include <string>50 48 #include <iostream> 51 49 #include <exception> 52 50 53 51 //***** ORXONOX **** 52 //misc 53 #include "misc/Sleep.h" 54 54 55 // loader and audio 55 56 #include "loader/LevelLoader.h" … … 77 78 namespace orxonox 78 79 { 79 using namespace Ogre;80 81 80 // put this in a seperate Class or solve the problem in another fashion 82 class OrxListener : public FrameListener81 class OrxListener : public Ogre::FrameListener 83 82 { 84 83 public: … … 90 89 } 91 90 92 bool frameStarted(const FrameEvent& evt)91 bool frameStarted(const Ogre::FrameEvent& evt) 93 92 { 94 93 auMan_->update(); … … 154 153 * @param path path to config (in home dir or something) 155 154 */ 156 void Orxonox::init(int argc, char **argv, std::string path)155 void Orxonox::init(int argc, char **argv, String path) 157 156 { 158 157 //TODO: find config file (assuming executable directory) 159 158 //TODO: read config file 160 159 //TODO: give config file to Ogre 161 std::string mode;160 String mode; 162 161 // if(argc>=2) 163 // mode = std::string(argv[1]);162 // mode = String(argv[1]); 164 163 // else 165 164 // mode = ""; … … 170 169 //mode = "presentation"; 171 170 if(ar.errorHandling()) die(); 172 if(mode == std::string("server"))171 if(mode == String("server")) 173 172 { 174 173 serverInit(path); 175 174 mode_ = SERVER; 176 175 } 177 else if(mode == std::string("client"))176 else if(mode == String("client")) 178 177 { 179 178 clientInit(path); 180 179 mode_ = CLIENT; 181 180 } 182 else if(mode == std::string("presentation"))181 else if(mode == String("presentation")) 183 182 { 184 183 serverInit(path); … … 244 243 } 245 244 246 void Orxonox::standaloneInit( std::string path)245 void Orxonox::standaloneInit(String path) 247 246 { 248 247 ogre_->setConfigPath(path); … … 263 262 } 264 263 265 void Orxonox::playableServer( std::string path)264 void Orxonox::playableServer(String path) 266 265 { 267 266 ogre_->setConfigPath(path); … … 297 296 } 298 297 299 void Orxonox::serverInit( std::string path)298 void Orxonox::serverInit(String path) 300 299 { 301 300 COUT(2) << "initialising server" << std::endl; … … 307 306 } 308 307 309 void Orxonox::clientInit( std::string path)308 void Orxonox::clientInit(String path) 310 309 { 311 310 COUT(2) << "initialising client" << std::endl; … … 322 321 void Orxonox::defineResources() 323 322 { 324 Ogre::String secName, typeName, archName;323 String secName, typeName, archName; 325 324 Ogre::ConfigFile cf; 326 325 #if OGRE_PLATFORM == OGRE_PLATFORM_APPLE … … 341 340 archName = i->second; 342 341 #if OGRE_PLATFORM == OGRE_PLATFORM_APPLE 343 ResourceGroupManager::getSingleton().addResourceLocation( String(macBundlePath() + "/" + archName), typeName, secName);342 Ogre::ResourceGroupManager::getSingleton().addResourceLocation( String(macBundlePath() + "/" + archName), typeName, secName); 344 343 #else 345 ResourceGroupManager::getSingleton().addResourceLocation( archName, typeName, secName);344 Ogre::ResourceGroupManager::getSingleton().addResourceLocation( archName, typeName, secName); 346 345 #endif 347 346 } … … 352 351 { 353 352 if (!root_->restoreConfig() && !root_->showConfigDialog()) 354 throw Exception(52, "User canceled the config dialog!", "OrxApplication::setupRenderSystem()");353 throw Ogre::Exception(52, "User canceled the config dialog!", "OrxApplication::setupRenderSystem()"); 355 354 } 356 355 … … 362 361 void Orxonox::initializeResourceGroups() 363 362 { 364 TextureManager::getSingleton().setDefaultNumMipmaps(5);365 ResourceGroupManager::getSingleton().initialiseAllResourceGroups();363 Ogre::TextureManager::getSingleton().setDefaultNumMipmaps(5); 364 Ogre::ResourceGroupManager::getSingleton().initialiseAllResourceGroups(); 366 365 } 367 366 … … 381 380 loader_->loadLevel(); 382 381 383 O verlay* hudOverlay =OverlayManager::getSingleton().getByName("Orxonox/HUD1.2");384 hud::HUD* orxonoxHud;385 orxonoxHud = new hud::HUD();382 Ogre::Overlay* hudOverlay = Ogre::OverlayManager::getSingleton().getByName("Orxonox/HUD1.2"); 383 HUD* orxonoxHud; 384 orxonoxHud = new HUD(); 386 385 orxonoxHud->setEnergyValue(20); 387 386 orxonoxHud->setEnergyDistr(20,20,60); … … 427 426 // fixes auto repeat problem 428 427 #if defined OIS_LINUX_PLATFORM 429 pl.insert(std::make_pair( std::string("XAutoRepeatOn"), std::string("true")));428 pl.insert(std::make_pair(String("XAutoRepeatOn"), String("true"))); 430 429 #endif 431 430 432 RenderWindow *win = ogre_->getRoot()->getAutoCreatedWindow();431 Ogre::RenderWindow *win = ogre_->getRoot()->getAutoCreatedWindow(); 433 432 win->getCustomAttribute("WINDOW", &windowHnd); 434 433 windowHndStr << windowHnd; 435 pl.insert(std::make_pair( std::string("WINDOW"), windowHndStr.str()));434 pl.insert(std::make_pair(String("WINDOW"), windowHndStr.str())); 436 435 inputManager_ = OIS::InputManager::createInputSystem(pl); 437 436
Note: See TracChangeset
for help on using the changeset viewer.