Changeset 911 for code/branches/script/src/orxonox
- Timestamp:
- Mar 20, 2008, 3:56:23 PM (17 years ago)
- Location:
- code/branches/script/src/orxonox
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/script/src/orxonox/GraphicsEngine.cc
r790 r911 36 36 #include <OgreTextureManager.h> 37 37 38 #include "core/CoreIncludes.h" 38 39 #include "core/Debug.h" 39 40 #include "GraphicsEngine.h" … … 46 47 GraphicsEngine::GraphicsEngine() 47 48 { 49 RegisterObject(GraphicsEngine); 50 this->bOverwritePath_ = false; 51 this->setConfigValues(); 48 52 // set to standard values 49 53 this->configPath_ = ""; 50 this->dataPath_ = "";51 54 scene_ = NULL; 52 55 } … … 55 58 GraphicsEngine::~GraphicsEngine() 56 59 { 60 } 61 62 void GraphicsEngine::setConfigValues() 63 { 64 SetConfigValue(dataPath_, dataPath_).description("relative path to media data"); 65 //if(this->bOverwritePath_) 66 ResetConfigValue(dataPath_); 67 57 68 } 58 69 … … 87 98 } 88 99 89 bool GraphicsEngine::load( )100 bool GraphicsEngine::load(std::string dataPath) 90 101 { 102 if( dataPath != "" ) { 103 dataPath_ = dataPath; 104 bOverwritePath_ = true; 105 setConfigValues(); 106 } 91 107 loadRessourceLocations(this->dataPath_); 92 108 if (!root_->restoreConfig() && !root_->showConfigDialog()) … … 108 124 // Load resource paths from data file using configfile ressource type 109 125 ConfigFile cf; 126 /*dataPath = "/home/piranha/orxonox/trunk/"; 127 //dataPath += "resources.cfg"; 128 std::cout << "*******************" << std::endl; 129 std::cout << dataPath << std::endl; 130 std::cout << "*******************" << std::endl;*/ 110 131 cf.load(dataPath + "resources.cfg"); 111 132 -
code/branches/script/src/orxonox/GraphicsEngine.h
r790 r911 14 14 15 15 #include "OrxonoxPrereqs.h" 16 #include "core/BaseObject.h" 16 17 17 18 … … 21 22 * graphics engine manager class 22 23 */ 23 class _OrxonoxExport GraphicsEngine { 24 class _OrxonoxExport GraphicsEngine : public BaseObject 25 { 24 26 public: 25 27 GraphicsEngine(); … … 27 29 // find a better way for this 28 30 inline Ogre::Root* getRoot() { return root_; }; 31 void setConfigValues(); 29 32 void setup(); 30 bool load( );33 bool load(std::string path); 31 34 void loadRessourceLocations(std::string path); 32 35 Ogre::SceneManager* getSceneManager(); … … 39 42 std::string dataPath_; //!< path to data file 40 43 Ogre::SceneManager* scene_; //!< scene manager of the game 44 bool bOverwritePath_; //!< overwrites path 41 45 42 46 }; -
code/branches/script/src/orxonox/Orxonox.cc
r871 r911 251 251 ogre_->setup(); 252 252 root_ = ogre_->getRoot(); 253 if(!ogre_->load( )) die(/* unable to load */);253 if(!ogre_->load(this->dataPath_)) die(/* unable to load */); 254 254 255 255 //defineResources(); … … 270 270 ogre_->setup(); 271 271 root_ = ogre_->getRoot(); 272 defineResources();273 setupRenderSystem();272 ogre_->load(this->dataPath_); 273 /*setupRenderSystem(); 274 274 createRenderWindow(); 275 initializeResourceGroups(); 275 initializeResourceGroups();*/ 276 276 setupInputSystem(); 277 277 Factory::createClassHierarchy(); … … 305 305 ogre_->setup(); 306 306 server_g = new network::Server(); // FIXME add some settings if wanted 307 if(!ogre_->load( )) die(/* unable to load */);307 if(!ogre_->load(this->dataPath_)) die(/* unable to load */); 308 308 // FIXME add network framelistener 309 309 } … … 318 318 else 319 319 client_g = new network::Client(serverIp_, 55556); 320 if(!ogre_->load( )) die(/* unable to load */);320 if(!ogre_->load(this->dataPath_)) die(/* unable to load */); 321 321 ogre_->getRoot()->addFrameListener(new network::ClientFrameListener()); 322 322 } 323 323 /* 324 324 void Orxonox::defineResources() 325 325 { … … 349 349 } 350 350 } 351 } 352 351 }*/ 352 /* 353 353 void Orxonox::setupRenderSystem() 354 354 { 355 355 if (!root_->restoreConfig() && !root_->showConfigDialog()) 356 356 throw Ogre::Exception(52, "User canceled the config dialog!", "OrxApplication::setupRenderSystem()"); 357 } 358 357 }*/ 358 /* 359 359 void Orxonox::createRenderWindow() 360 360 { … … 366 366 Ogre::TextureManager::getSingleton().setDefaultNumMipmaps(5); 367 367 Ogre::ResourceGroupManager::getSingleton().initialiseAllResourceGroups(); 368 } 368 }*/ 369 369 370 370 /** -
code/branches/script/src/orxonox/Orxonox.h
r871 r911 56 56 void playableServer(std::string path); 57 57 void standalone(); 58 void defineResources(); 59 void setupRenderSystem(); 60 void createRenderWindow(); 61 void initializeResourceGroups(); 58 //void setupRenderSystem(); 59 //void createRenderWindow(); 60 //void initializeResourceGroups(); 62 61 void createScene(void); 63 62 void setupScene();
Note: See TracChangeset
for help on using the changeset viewer.