Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 2244


Ignore:
Timestamp:
Nov 21, 2008, 12:36:23 AM (16 years ago)
Author:
rgrieder
Message:

Applied long created patch that removes plugins.cfg and puts the content into orxonox.ini
This also allows to specify the media path for each 'distribution' individually because orxonox.ini has been added to the default files.

Location:
code/branches/buildsystem
Files:
6 edited
3 moved

Legend:

Unmodified
Added
Removed
  • code/branches/buildsystem/bin/CMakeLists.txt

    r2243 r2244  
    1010  SET(CONFIG_FILES ${CONFIG_FILES}
    1111    linux/run-script
    12         tardis/plugins.cfg
     12        tardis/orxonox.ini
    1313  )
    1414
     
    1616  SET(CONFIG_FILES ${CONFIG_FILES}
    1717    linux/run-script
    18         linux/plugins.cfg
     18        linux/orxonox.ini
    1919  )
    2020ENDIF(IS_TARDIS)
     
    2222IF(MINGW)
    2323  SET(CONFIG_FILES ${CONFIG_FILES}
    24     "mingw/plugins.cfg"
     24    "mingw/orxonox.ini"
    2525    "mingw/orxonox.bat"
    2626  )
  • code/branches/buildsystem/bin/linux/orxonox.ini

    r2243 r2244  
    1 # Defines plugins to load
     1[Settings]
     2dataPath_ = ../../../media/
    23
    3 # Define plugin folder
    4 PluginFolder=/usr/lib/OGRE
    5 
    6 # Define plugins
    7 #Plugin=RenderSystem_Direct3D9
    8 Plugin=RenderSystem_GL
    9 Plugin=Plugin_ParticleFX
    10 Plugin=Plugin_CgProgramManager
    11 #Plugin=Plugin_BSPSceneManager
    12 #Plugin=Plugin_OctreeSceneManager
    13 
    14 
     4[GSGraphics]
     5ogrePluginsFolder_ = /usr/lib/OGRE
     6ogrePlugins_ = RenderSystem_GL, Plugin_ParticleFX, Plugin_CgProgramManager #,Plugin_BSPSceneManager, Plugin_OctreeSceneManager
  • code/branches/buildsystem/bin/mingw/orxonox.ini

    r2243 r2244  
    1 # Defines plugins to load
     1[Settings]
     2dataPath_ = ../../../media/
    23
    3 # Define plugin folder
    4 PluginFolder=..\..\libs\ogre\Samples\Common\bin\Release\
    5 
    6 # Define plugins
    7 Plugin=RenderSystem_Direct3D9
    8 Plugin=RenderSystem_GL
    9 Plugin=Plugin_ParticleFX
    10 Plugin=Plugin_CgProgramManager
    11 #Plugin=Plugin_BSPSceneManager
    12 #Plugin=Plugin_OctreeSceneManager
    13 
     4[GSGraphics]
     5ogrePluginsFolder_ = ..\..\libs\ogre\Samples\Common\bin\Release\
     6ogrePlugins_ = RenderSystem_Direct3D9, RenderSystem_GL, Plugin_ParticleFX, Plugin_CgProgramManager #,Plugin_BSPSceneManager, Plugin_OctreeSceneManager
  • code/branches/buildsystem/bin/tardis/orxonox.ini

    r2243 r2244  
    1 # Defines plugins to load
     1[Settings]
     2dataPath_ = ../../../media/
    23
    3 # Define plugin folder
    4 PluginFolder=/usr/pack/ogre-1.4.5-sd/i686-debian-linux3.1/lib/OGRE/
    5 
    6 # Define plugins
    7 #Plugin=RenderSystem_Direct3D9
    8 Plugin=RenderSystem_GL
    9 Plugin=Plugin_ParticleFX
    10 Plugin=Plugin_CgProgramManager
    11 #Plugin=Plugin_BSPSceneManager
    12 #Plugin=Plugin_OctreeSceneManager
    13 
    14 
     4[GSGraphics]
     5ogrePluginsFolder_ = /usr/pack/ogre-1.4.5-sd/i686-debian-linux3.1/lib/OGRE/
     6ogrePlugins_ = RenderSystem_GL, Plugin_ParticleFX, Plugin_CgProgramManager #,Plugin_BSPSceneManager, Plugin_OctreeSceneManager
  • code/branches/buildsystem/src/orxonox/gamestates/GSGraphics.cc

    r1828 r2244  
    4343#include "util/Debug.h"
    4444#include "util/Exception.h"
     45#include "util/String.h"
     46#include "util/SubString.h"
    4547#include "core/ConsoleCommand.h"
    4648#include "core/ConfigValueIncludes.h"
     
    8284    {
    8385        SetConfigValue(resourceFile_, "resources.cfg").description("Location of the resources file in the data path.");
     86        SetConfigValue(ogrePluginsFolder_, ".").description("Folder where the Ogre plugins are located.");
     87        SetConfigValue(ogrePlugins_, "RenderSystem_GL, Plugin_ParticleFX").description("Comma separated list of all plugins to load.");
    8488        SetConfigValue(statisticsRefreshCycle_, 200000).description("Sets the time in microseconds interval at which average fps, etc. get updated.");
    8589    }
     
    9397        this->ogreRoot_ = getParent()->getOgreRoot();
    9498
     99        // load all the required plugins for Ogre
     100        loadOgrePlugins();
     101        // read resource declaration file
    95102        this->declareResources();
    96         this->loadRenderer();    // creates the render window
     103        // Reads ogre config and creates the render window
     104        this->loadRenderer();
     105
    97106        // TODO: Spread this so that this call only initialises things needed for the Console and GUI
    98107        this->initialiseResources();
     
    232241
    233242        ++frameCount_;
     243    }
     244
     245    void GSGraphics::loadOgrePlugins()
     246    {
     247        // just to make sure the next statement doesn't segfault
     248        if (ogrePluginsFolder_ == "")
     249            ogrePluginsFolder_ = ".";
     250
     251#if ORXONOX_PLATFORM == ORXONOX_PLATFORM_WIN32
     252        convertToWindowsPath(&ogrePluginsFolder_);
     253#else
     254        convertToUnixPath(&ogrePluginsFolder_);
     255#endif
     256
     257        // Do some SubString magic to get the comma separated list of plugins
     258        SubString plugins(ogrePlugins_, ",", " ", false, 92, false, 34, false, 40, 41, false, '\0');
     259        for (unsigned int i = 0; i < plugins.size(); ++i)
     260            ogreRoot_->loadPlugin(ogrePluginsFolder_ + plugins[i]);
    234261    }
    235262
  • code/branches/buildsystem/src/orxonox/gamestates/GSGraphics.h

    r1788 r2244  
    5656        void setConfigValues();
    5757
     58        void loadOgrePlugins();
    5859        void declareResources();
    5960        void loadRenderer();
     
    8889        // config values
    8990        std::string           resourceFile_;          //!< resources file name
     91        std::string           ogrePluginsFolder_;     //!< Folder where the Ogre plugins are located
     92        std::string           ogrePlugins_;           //!< Comma separated list of all plugins to load
    9093        unsigned int          detailLevelParticle_;   //!< Detail level of particle effects (0: off, 1: low, 2: normal, 3: high)
    9194    };
  • code/branches/buildsystem/src/orxonox/gamestates/GSRoot.cc

    r1826 r2244  
    286286            probe.close();
    287287
    288         ogreRoot_ = new Ogre::Root(ogrePluginsFile_, ogreConfigFile_, ogreLogFile_);
     288        // Leave plugins file empty. We're going to do that part manually later
     289        ogreRoot_ = new Ogre::Root("", ogreConfigFile_, ogreLogFile_);
    289290
    290291#if 0 // Ogre 1.4.3 doesn't yet support setDebugOutputEnabled(.)
  • code/branches/buildsystem/src/util/String.cc

    r1830 r2244  
    485485    return std::string::npos;
    486486}
     487
     488/**
     489    @brief Converts a path string to windows with "\" instead of "/".
     490    @param str String pointer to be manipulated
     491*/
     492void convertToWindowsPath(std::string* str)
     493{
     494    std::string& path = *str;
     495    // replace all occurences of "/" with "\"
     496    for (unsigned int i = 0; i < path.length(); ++i)
     497    {
     498        if (path[i] == '/')
     499            path[i] = '\\';
     500    }
     501    // add an extra '\\' at the end to make it a complete path
     502    if (path != "" && path[path.length() - 1] != '\\')
     503        path.append("\\");
     504}
     505
     506/**
     507    @brief Converts a path string to unix with "/" instead of "\".
     508    @param str String pointer to be manipulated
     509*/
     510void convertToUnixPath(std::string* str)
     511{
     512    std::string& path = *str;
     513    // replace all occurences of "\" with "/"
     514    for (unsigned int i = 0; i < path.length(); ++i)
     515    {
     516        if (path[i] == '\\')
     517            path[i] = '/';
     518    }
     519    // add an extra '\\' at the end to make it a complete path
     520    if (path != "" && path[path.length() - 1] != '/')
     521        path.append("/");
     522}
  • code/branches/buildsystem/src/util/String.h

    r1791 r2244  
    7777_UtilExport unsigned int getNextCommentPosition(const std::string& str, unsigned int start = 0);
    7878
     79_UtilExport void         convertToWindowsPath(std::string* str);
     80_UtilExport void         convertToUnixPath(std::string* str);
     81
    7982#endif /* _Util_String_H__ */
Note: See TracChangeset for help on using the changeset viewer.