Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 28, 2011, 7:15:14 AM (13 years ago)
Author:
rgrieder
Message:

Merged kicklib2 branch back to trunk (includes former branches ois_update, mac_osx and kicklib).

Notes for updating

Linux:
You don't need an extra package for CEGUILua and Tolua, it's already shipped with CEGUI.
However you do need to make sure that the OgreRenderer is installed too with CEGUI 0.7 (may be a separate package).
Also, Orxonox now recognises if you install the CgProgramManager (a separate package available on newer Ubuntu on Debian systems).

Windows:
Download the new dependency packages versioned 6.0 and use these. If you have problems with that or if you don't like the in game console problem mentioned below, you can download the new 4.3 version of the packages (only available for Visual Studio 2005/2008).

Key new features:

  • *Support for Mac OS X*
  • Visual Studio 2010 support
  • Bullet library update to 2.77
  • OIS library update to 1.3
  • Support for CEGUI 0.7 —> Support for Arch Linux and even SuSE
  • Improved install target
  • Compiles now with GCC 4.6
  • Ogre Cg Shader plugin activated for Linux if available
  • And of course lots of bug fixes

There are also some regressions:

  • No support for CEGUI 0.5, Ogre 1.4 and boost 1.35 - 1.39 any more
  • In game console is not working in main menu for CEGUI 0.7
  • Tolua (just the C lib, not the application) and CEGUILua libraries are no longer in our repository. —> You will need to get these as well when compiling Orxonox
  • And of course lots of new bugs we don't yet know about
File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/libraries/core/GraphicsManager.cc

    r8079 r8351  
    3030#include "GraphicsManager.h"
    3131
     32#include <cstdlib>
    3233#include <fstream>
    3334#include <sstream>
     
    3536#include <boost/shared_array.hpp>
    3637
    37 #include <OgreArchiveFactory.h>
    38 #include <OgreArchiveManager.h>
    3938#include <OgreFrameListener.h>
    4039#include <OgreRoot.h>
     
    6059#include "GUIManager.h"
    6160#include "Loader.h"
    62 #include "MemoryArchive.h"
    6361#include "PathConfig.h"
    6462#include "ViewportEventListener.h"
     
    102100    GraphicsManager::GraphicsManager(bool bLoadRenderer)
    103101        : ogreWindowEventListener_(new OgreWindowEventListener())
    104 #if OGRE_VERSION < 0x010600
    105         , memoryArchiveFactory_(new MemoryArchiveFactory())
    106 #endif
    107102        , renderWindow_(0)
    108103        , viewport_(0)
     
    126121        // Only for development runs
    127122        if (PathConfig::isDevelopmentRun())
    128         {
    129123            Ogre::ResourceGroupManager::getSingleton().addResourceLocation(PathConfig::getExternalDataPathString(), "FileSystem");
    130             extResources_.reset(new XMLFile("resources.oxr"));
    131             extResources_->setLuaSupport(false);
    132             Loader::open(extResources_.get());
    133         }
     124
     125        extResources_.reset(new XMLFile("resources.oxr"));
     126        extResources_->setLuaSupport(false);
     127        Loader::open(extResources_.get());
    134128
    135129        if (bLoadRenderer)
     
    156150        // Undeclare the resources
    157151        Loader::unload(resources_.get());
    158         if (PathConfig::isDevelopmentRun())
    159             Loader::unload(extResources_.get());
     152        Loader::unload(extResources_.get());
    160153    }
    161154
     
    164157        SetConfigValue(ogreConfigFile_,  "ogre.cfg")
    165158            .description("Location of the Ogre config file");
    166         SetConfigValue(ogrePluginsDirectory_, specialConfig::ogrePluginsDirectory)
    167             .description("Folder where the Ogre plugins are located.");
    168159        SetConfigValue(ogrePlugins_, specialConfig::ogrePlugins)
    169160            .description("Comma separated list of all plugins to load.");
     
    196187        this->loadRenderer();
    197188
    198 #if OGRE_VERSION < 0x010600
    199         // WORKAROUND: There is an incompatibility for particle scripts when trying
    200         // to support both Ogre 1.4 and 1.6. The hacky solution is to create
    201         // scripts for the 1.6 version and then remove the inserted "particle_system"
    202         // keyword. But we need to supply these new scripts as well, which is why
    203         // there is an extra Ogre::Archive dealing with it in the memory.
    204         using namespace Ogre;
    205         ArchiveManager::getSingleton().addArchiveFactory(memoryArchiveFactory_.get());
    206         const StringVector& groups = ResourceGroupManager::getSingleton().getResourceGroups();
    207         // Travers all groups
    208         for (StringVector::const_iterator itGroup = groups.begin(); itGroup != groups.end(); ++itGroup)
    209         {
    210             FileInfoListPtr files = ResourceGroupManager::getSingleton().findResourceFileInfo(*itGroup, "*.particle");
    211             for (FileInfoList::const_iterator itFile = files->begin(); itFile != files->end(); ++itFile)
    212             {
    213                 // open file
    214                 Ogre::DataStreamPtr input = ResourceGroupManager::getSingleton().openResource(itFile->filename, *itGroup, false);
    215                 std::stringstream output;
    216                 // Parse file and replace "particle_system" with nothing
    217                 while (!input->eof())
    218                 {
    219                     std::string line = input->getLine();
    220                     size_t pos = line.find("particle_system");
    221                     if (pos != std::string::npos)
    222                     {
    223                         // 15 is the length of "particle_system"
    224                         line.replace(pos, 15, "");
    225                     }
    226                     output << line << std::endl;
    227                 }
    228                 // Add file to the memory archive
    229                 shared_array<char> data(new char[output.str().size()]);
    230                 // Debug optimisations
    231                 const std::string& outputStr = output.str();
    232                 char* rawData = data.get();
    233                 for (unsigned i = 0; i < outputStr.size(); ++i)
    234                     rawData[i] = outputStr[i];
    235                 MemoryArchive::addFile("particle_scripts_ogre_1.4_" + *itGroup, itFile->filename, data, output.str().size());
    236             }
    237             if (!files->empty())
    238             {
    239                 // Declare the files, but using a new group
    240                 ResourceGroupManager::getSingleton().addResourceLocation("particle_scripts_ogre_1.4_" + *itGroup,
    241                     "Memory", "particle_scripts_ogre_1.4_" + *itGroup);
    242             }
    243         }
    244 #endif
    245 
    246189        // Initialise all resources (do this AFTER the renderer has been loaded!)
    247190        // Note: You can only do this once! Ogre will check whether a resource group has
     
    305248    void GraphicsManager::loadOgrePlugins()
    306249    {
    307         // just to make sure the next statement doesn't segfault
    308         if (ogrePluginsDirectory_.empty())
    309             ogrePluginsDirectory_ = '.';
    310 
    311         boost::filesystem::path folder(ogrePluginsDirectory_);
     250        // Plugin path can have many different locations...
     251        std::string pluginPath = specialConfig::ogrePluginsDirectory;
     252#ifdef DEPENDENCY_PACKAGE_ENABLE
     253        if (!PathConfig::isDevelopmentRun())
     254        {
     255#  if defined(ORXONOX_PLATFORM_WINDOWS)
     256            pluginPath = PathConfig::getExecutablePathString();
     257#  elif defined(ORXONOX_PLATFORM_APPLE)
     258            // TODO: Where are the plugins being installed to?
     259            pluginPath = PathConfig::getExecutablePathString();
     260#  endif
     261        }
     262#endif
     263
     264#ifdef ORXONOX_PLATFORM_WINDOWS
     265        // Add OGRE plugin path to the environment. That way one plugin could
     266        // also depend on another without problems on Windows
     267        const char* currentPATH = getenv("PATH");
     268        std::string newPATH = pluginPath;
     269        if (currentPATH != NULL)
     270            newPATH = std::string(currentPATH) + ';' + newPATH;
     271        putenv(const_cast<char*>(("PATH=" + newPATH).c_str()));
     272#endif
     273
    312274        // Do some SubString magic to get the comma separated list of plugins
    313275        SubString plugins(ogrePlugins_, ",", " ", false, '\\', false, '"', false, '{', '}', false, '\0');
    314         // Use backslash paths on Windows! file_string() already does that though.
    315276        for (unsigned int i = 0; i < plugins.size(); ++i)
    316             ogreRoot_->loadPlugin((folder / plugins[i]).file_string());
     277            ogreRoot_->loadPlugin(pluginPath + '/' + plugins[i]);
    317278    }
    318279
Note: See TracChangeset for help on using the changeset viewer.