Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 17, 2008, 8:59:48 PM (16 years ago)
Author:
rgrieder
Message:

Merged revisions 1875-2278 of the buildsystem branch to buildsystem2.

Location:
code/branches/buildsystem2
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • code/branches/buildsystem2

  • code/branches/buildsystem2/src/orxonox/gamestates/GSGraphics.cc

    r2171 r2509  
    4444#include "util/Debug.h"
    4545#include "util/Exception.h"
     46#include "util/String.h"
     47#include "util/SubString.h"
    4648#include "core/ConsoleCommand.h"
    4749#include "core/ConfigValueIncludes.h"
     
    9698        SetConfigValue(ogreConfigFile_,  "ogre.cfg")
    9799            .description("Location of the Ogre config file");
    98         SetConfigValue(ogrePluginsFile_, "plugins.cfg")
    99             .description("Location of the Ogre plugins file");
     100        SetConfigValue(ogrePluginsFolder_, ".")
     101            .description("Folder where the Ogre plugins are located.");
     102        SetConfigValue(ogrePlugins_, "RenderSystem_GL, Plugin_ParticleFX")
     103            .description("Comma separated list of all plugins to load.");
    100104        SetConfigValue(ogreLogFile_,     "ogre.log")
    101105            .description("Logfile for messages from Ogre. Use \"\" to suppress log file creation.");
     
    121125        // Ogre setup procedure
    122126        setupOgre();
     127        // load all the required plugins for Ogre
     128        loadOgrePlugins();
     129        // read resource declaration file
    123130        this->declareResources();
    124         this->loadRenderer();    // creates the render window
     131        // Reads ogre config and creates the render window
     132        this->loadRenderer();
     133
    125134        // TODO: Spread this so that this call only initialises things needed for the Console and GUI
    126135        this->initialiseResources();
     
    345354            probe.close();
    346355
    347         ogreRoot_ = new Ogre::Root(ogrePluginsFile_, ogreConfigFile_, ogreLogFile_);
     356        // Leave plugins file empty. We're going to do that part manually later
     357        ogreRoot_ = new Ogre::Root("", ogreConfigFile_, ogreLogFile_);
    348358
    349359#if 0 // Ogre 1.4.3 doesn't yet support setDebugOutputEnabled(.)
     
    358368
    359369        COUT(3) << "Ogre set up done." << std::endl;
     370    }
     371
     372    void GSGraphics::loadOgrePlugins()
     373    {
     374        // just to make sure the next statement doesn't segfault
     375        if (ogrePluginsFolder_ == "")
     376            ogrePluginsFolder_ = ".";
     377
     378#if ORXONOX_PLATFORM == ORXONOX_PLATFORM_WIN32
     379        convertToWindowsPath(&ogrePluginsFolder_);
     380#else
     381        convertToUnixPath(&ogrePluginsFolder_);
     382#endif
     383
     384        // Do some SubString magic to get the comma separated list of plugins
     385        SubString plugins(ogrePlugins_, ",", " ", false, 92, false, 34, false, 40, 41, false, '\0');
     386        for (unsigned int i = 0; i < plugins.size(); ++i)
     387            ogreRoot_->loadPlugin(ogrePluginsFolder_ + plugins[i]);
    360388    }
    361389
  • code/branches/buildsystem2/src/orxonox/gamestates/GSGraphics.h

    r2103 r2509  
    6060
    6161        void setupOgre();
     62        void loadOgrePlugins();
    6263        void declareResources();
    6364        void loadRenderer();
     
    105106        std::string           resourceFile_;             //!< resources file name
    106107        std::string           ogreConfigFile_;           //!< ogre config file name
    107         std::string           ogrePluginsFile_;          //!< ogre plugins file name
     108        std::string           ogrePluginsFolder_;        //!< Folder where the Ogre plugins are located
     109        std::string           ogrePlugins_;              //!< Comma separated list of all plugins to load
    108110        std::string           ogreLogFile_;              //!< log file name for Ogre log messages
    109111        int                   ogreLogLevelTrivial_;      //!< Corresponding Orxonx debug level for LL_TRIVIAL
Note: See TracChangeset for help on using the changeset viewer.