Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 20, 2008, 3:56:23 PM (17 years ago)
Author:
bknecht
Message:

applied some old changes (compiles, but may fail running)

Location:
code/branches/script/src/orxonox
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • code/branches/script/src/orxonox/GraphicsEngine.cc

    r790 r911  
    3636#include <OgreTextureManager.h>
    3737
     38#include "core/CoreIncludes.h"
    3839#include "core/Debug.h"
    3940#include "GraphicsEngine.h"
     
    4647  GraphicsEngine::GraphicsEngine()
    4748  {
     49    RegisterObject(GraphicsEngine);
     50    this->bOverwritePath_ = false;
     51    this->setConfigValues();
    4852    // set to standard values
    4953    this->configPath_ = "";
    50     this->dataPath_ = "";
    5154    scene_ = NULL;
    5255  }
     
    5558  GraphicsEngine::~GraphicsEngine()
    5659  {
     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
    5768  }
    5869
     
    8798  }
    8899
    89   bool GraphicsEngine::load()
     100  bool GraphicsEngine::load(std::string dataPath)
    90101  {
     102    if( dataPath != "" ) {
     103      dataPath_ = dataPath;
     104      bOverwritePath_ = true;
     105      setConfigValues();
     106    }
    91107    loadRessourceLocations(this->dataPath_);
    92108    if (!root_->restoreConfig() && !root_->showConfigDialog())
     
    108124    // Load resource paths from data file using configfile ressource type
    109125    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;*/
    110131    cf.load(dataPath + "resources.cfg");
    111132
  • code/branches/script/src/orxonox/GraphicsEngine.h

    r790 r911  
    1414
    1515#include "OrxonoxPrereqs.h"
     16#include "core/BaseObject.h"
    1617
    1718
     
    2122   * graphics engine manager class
    2223 */
    23   class _OrxonoxExport GraphicsEngine {
     24  class _OrxonoxExport GraphicsEngine : public BaseObject
     25  {
    2426    public:
    2527      GraphicsEngine();
     
    2729      // find a better way for this
    2830      inline Ogre::Root* getRoot() { return root_; };
     31      void setConfigValues();
    2932      void setup();
    30       bool load();
     33      bool load(std::string path);
    3134      void loadRessourceLocations(std::string path);
    3235      Ogre::SceneManager* getSceneManager();
     
    3942      std::string         dataPath_;    //!< path to data file
    4043      Ogre::SceneManager* scene_;       //!< scene manager of the game
     44      bool               bOverwritePath_; //!< overwrites path
    4145
    4246  };
  • code/branches/script/src/orxonox/Orxonox.cc

    r871 r911  
    251251    ogre_->setup();
    252252    root_ = ogre_->getRoot();
    253     if(!ogre_->load()) die(/* unable to load */);
     253    if(!ogre_->load(this->dataPath_)) die(/* unable to load */);
    254254
    255255    //defineResources();
     
    270270    ogre_->setup();
    271271    root_ = ogre_->getRoot();
    272     defineResources();
    273     setupRenderSystem();
     272    ogre_->load(this->dataPath_);
     273    /*setupRenderSystem();
    274274    createRenderWindow();
    275     initializeResourceGroups();
     275    initializeResourceGroups();*/
    276276    setupInputSystem();
    277277    Factory::createClassHierarchy();
     
    305305    ogre_->setup();
    306306    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 */);
    308308    // FIXME add network framelistener
    309309  }
     
    318318    else
    319319      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 */);
    321321    ogre_->getRoot()->addFrameListener(new network::ClientFrameListener());
    322322  }
    323 
     323/*
    324324  void Orxonox::defineResources()
    325325  {
     
    349349      }
    350350    }
    351   }
    352 
     351  }*/
     352/*
    353353  void Orxonox::setupRenderSystem()
    354354  {
    355355    if (!root_->restoreConfig() && !root_->showConfigDialog())
    356356      throw Ogre::Exception(52, "User canceled the config dialog!", "OrxApplication::setupRenderSystem()");
    357   }
    358 
     357  }*/
     358/*
    359359  void Orxonox::createRenderWindow()
    360360  {
     
    366366    Ogre::TextureManager::getSingleton().setDefaultNumMipmaps(5);
    367367    Ogre::ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
    368   }
     368  }*/
    369369
    370370  /**
  • code/branches/script/src/orxonox/Orxonox.h

    r871 r911  
    5656      void playableServer(std::string path);
    5757      void standalone();
    58       void defineResources();
    59       void setupRenderSystem();
    60       void createRenderWindow();
    61       void initializeResourceGroups();
     58      //void setupRenderSystem();
     59      //void createRenderWindow();
     60      //void initializeResourceGroups();
    6261      void createScene(void);
    6362      void setupScene();
Note: See TracChangeset for help on using the changeset viewer.