Changeset 473 for code/branches/FICN/src/orxonox
- Timestamp:
- Dec 12, 2007, 6:11:30 PM (17 years ago)
- Location:
- code/branches/FICN/src/orxonox
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/FICN/src/orxonox/graphicsEngine.cc
r462 r473 46 46 this->configPath_ = ""; 47 47 this->dataPath_ = ""; 48 scene_ = NULL; 48 49 } 49 50 … … 56 57 { 57 58 //TODO: Check if file exists (maybe not here) 58 #ifndef OGRE_STATIC_LIB59 /*#ifndef OGRE_STATIC_LIB 59 60 root_ = new Root(configPath_ + "plugins.cfg", configPath_ + "ogre.cfg", 60 61 configPath_ + "Ogre.log"); 61 #e ndif62 #else 62 63 root_ = new Root(NULL, configPath_ + "ogre.cfg", configPath_ + "Ogre.log"); 64 #endif*/ 65 root_ = new Root(); 63 66 } 64 67 65 68 /** 66 * returnsscene manager69 * @return scene manager 67 70 */ 68 71 SceneManager* GraphicsEngine::getSceneManager() 69 72 { 70 73 if(!scene_) 74 { 71 75 scene_ = root_->createSceneManager(ST_GENERIC, "Default SceneManager"); 76 std::cout << "created SceneMan: " << scene_ << std::endl; 77 } 72 78 return scene_; 73 79 } … … 94 100 // Load resource paths from data file using configfile ressource type 95 101 ConfigFile cf; 96 cf.load(dataPath _+ "resources.cfg");102 cf.load(dataPath + "resources.cfg"); 97 103 98 104 // Go through all sections & settings in the file -
code/branches/FICN/src/orxonox/main.cc
r462 r473 81 81 #if OGRE_PLATFORM == OGRE_PLATFORM_APPLE 82 82 orx->init(argc, argv, macBundlePath()); 83 orx->start();83 //orx->start(); 84 84 #else 85 85 orx->init(argc, argv, ""); 86 orx->start();86 //orx->start(); 87 87 #endif 88 88 -
code/branches/FICN/src/orxonox/orxonox.cc
r469 r473 63 63 #include "../network/Server.h" 64 64 #include "../network/Client.h" 65 //#include "../network/NetworkFrameListener.h"65 #include "../network/NetworkFrameListener.h" 66 66 67 67 // some tests to see if enet works without includsion … … 222 222 // load this file from config 223 223 string levelFile = "sample.oxw"; 224 loader_ = new loader::LevelLoader(levelFile);224 //loader_ = new loader::LevelLoader(levelFile); 225 225 //TODO: run engine 226 226 } … … 248 248 ogre_->setConfigPath(path); 249 249 ogre_->setup(); 250 if(!ogre_->load()) die(/* unable to load */); 251 } 252 253 void Orxonox::serverInit(std::string path) 254 { 255 ogre_->setConfigPath(path); 256 ogre_->setup(); 257 //server_g = new network::Server(); // add some settings if wanted 258 if(!ogre_->load()) die(/* unable to load */); 259 //ogre_->getRoot()->addFrameListener(new network::ServerFrameListener()); 260 ogre_->startRender(); 261 262 createScene(); 263 setupScene(); 264 } 265 266 void Orxonox::clientInit(std::string path) 267 { 268 ogre_->setConfigPath(path); 269 ogre_->setup(); 270 //client_g = new network::Client(); // address here 271 if(!ogre_->load()) die(/* unable to load */); 272 //ogre_->getRoot()->addFrameListener(new network::ClientFrameListener()); 273 ogre_->startRender(); 274 250 root_ = ogre_->getRoot(); 251 //if(!ogre_->load()) die(/* unable to load */); 252 253 defineResources(); 254 setupRenderSystem(); 255 createRenderWindow(); 256 initializeResourceGroups(); 275 257 createScene(); 276 258 setupScene(); … … 278 260 createFrameListener(); 279 261 startRenderLoop(); 262 } 263 264 void Orxonox::serverInit(std::string path) 265 { 266 ogre_->setConfigPath(path); 267 ogre_->setup(); 268 server_g = new network::Server(); // add some settings if wanted 269 if(!ogre_->load()) die(/* unable to load */); 270 //ogre_->getRoot()->addFrameListener(new network::ServerFrameListener()); 271 ogre_->startRender(); 272 273 createScene(); 274 setupScene(); 275 } 276 277 void Orxonox::clientInit(std::string path) 278 { 279 ogre_->setConfigPath(path); 280 ogre_->setup(); 281 client_g = new network::Client(); // address here 282 if(!ogre_->load()) die(/* unable to load */); 283 //ogre_->getRoot()->addFrameListener(new network::ClientFrameListener()); 284 ogre_->startRender(); 285 286 createScene(); 287 setupScene(); 288 setupInputSystem(); 289 createFrameListener(); 290 startRenderLoop(); 291 } 292 293 void Orxonox::defineResources() 294 { 295 Ogre::String secName, typeName, archName; 296 Ogre::ConfigFile cf; 297 #if OGRE_PLATFORM == OGRE_PLATFORM_APPLE 298 cf.load(macBundlePath() + "/Contents/Resources/resources.cfg"); 299 #else 300 cf.load("resources.cfg"); 301 #endif 302 303 Ogre::ConfigFile::SectionIterator seci = cf.getSectionIterator(); 304 while (seci.hasMoreElements()) 305 { 306 secName = seci.peekNextKey(); 307 Ogre::ConfigFile::SettingsMultiMap *settings = seci.getNext(); 308 Ogre::ConfigFile::SettingsMultiMap::iterator i; 309 for (i = settings->begin(); i != settings->end(); ++i) 310 { 311 typeName = i->first; 312 archName = i->second; 313 #if OGRE_PLATFORM == OGRE_PLATFORM_APPLE 314 Ogre::ResourceGroupManager::getSingleton().addResourceLocation( String(macBundlePath() + "/" + archName), typeName, secName); 315 #else 316 Ogre::ResourceGroupManager::getSingleton().addResourceLocation( archName, typeName, secName); 317 #endif 318 } 319 } 320 } 321 322 void Orxonox::setupRenderSystem() 323 { 324 if (!root_->restoreConfig() && !root_->showConfigDialog()) 325 throw Exception(52, "User canceled the config dialog!", "OrxApplication::setupRenderSystem()"); 326 } 327 328 void Orxonox::createRenderWindow() 329 { 330 root_->initialise(true, "OrxonoxV2"); 331 } 332 333 void Orxonox::initializeResourceGroups() 334 { 335 TextureManager::getSingleton().setDefaultNumMipmaps(5); 336 ResourceGroupManager::getSingleton().initialiseAllResourceGroups(); 280 337 } 281 338 -
code/branches/FICN/src/orxonox/orxonox.h
r462 r473 39 39 void clientInit(std::string path); 40 40 void standalone(std::string path); 41 void defineResources(); 42 void setupRenderSystem(); 43 void createRenderWindow(); 44 void initializeResourceGroups(); 41 45 void createScene(void); 42 46 void setupScene(); … … 46 50 private: 47 51 48 //static Orxonox* singletonRef_;49 52 GraphicsEngine* ogre_; //!< our dearest graphics engine <3 50 53 std::string dataPath_; //!< path to data … … 56 59 OIS::InputManager* inputManager_; 57 60 OrxListener* frameListener_; 61 Ogre::Root* root_; 58 62 }; 59 63 }
Note: See TracChangeset
for help on using the changeset viewer.