[Orxonox-commit 3257] r7948 - in code/branches/kicklib: . cmake src/external/ogreceguirenderer src/libraries/core src/libraries/tools

rgrieder at orxonox.net rgrieder at orxonox.net
Mon Feb 21 06:16:25 CET 2011


Author: rgrieder
Date: 2011-02-21 06:16:24 +0100 (Mon, 21 Feb 2011)
New Revision: 7948

Removed:
   code/branches/kicklib/src/libraries/core/MemoryArchive.cc
   code/branches/kicklib/src/libraries/core/MemoryArchive.h
Modified:
   code/branches/kicklib/INSTALL
   code/branches/kicklib/cmake/LibraryConfig.cmake
   code/branches/kicklib/src/external/ogreceguirenderer/OgreCEGUIRenderer.cpp
   code/branches/kicklib/src/external/ogreceguirenderer/VERSION
   code/branches/kicklib/src/external/ogreceguirenderer/changes_orxonox.diff
   code/branches/kicklib/src/libraries/core/CMakeLists.txt
   code/branches/kicklib/src/libraries/core/GraphicsManager.cc
   code/branches/kicklib/src/libraries/core/GraphicsManager.h
   code/branches/kicklib/src/libraries/tools/Mesh.cc
Log:
Dropped support for OGRE v1.4 and removed the remaining workarounds.

Modified: code/branches/kicklib/INSTALL
===================================================================
--- code/branches/kicklib/INSTALL	2011-02-21 03:35:28 UTC (rev 7947)
+++ code/branches/kicklib/INSTALL	2011-02-21 05:16:24 UTC (rev 7948)
@@ -8,7 +8,7 @@
 In order to compile Orxonox you will need the following libraries:
 (for windows there are already precompiled packages on the website)
 
-OGRE 3D Graphics Engine          1.4 - 1.7
+OGRE 3D Graphics Engine          1.6 - 1.7
 CEGUI (Crazy Eddie's GUI System) 0.6
 Boost libraries                  1.35 -
 ENet (Network library)           1.1 - 1.2

Modified: code/branches/kicklib/cmake/LibraryConfig.cmake
===================================================================
--- code/branches/kicklib/cmake/LibraryConfig.cmake	2011-02-21 03:35:28 UTC (rev 7947)
+++ code/branches/kicklib/cmake/LibraryConfig.cmake	2011-02-21 05:16:24 UTC (rev 7948)
@@ -92,7 +92,7 @@
 ############### Library finding #################
 # Performs the search and sets the variables    #
 
-FIND_PACKAGE(OGRE     1.4    REQUIRED)
+FIND_PACKAGE(OGRE     1.6    REQUIRED)
 #FIND_PACKAGE(ENet     1.1    REQUIRED)
 FIND_PACKAGE(Lua5.1          REQUIRED)
 FIND_PACKAGE(Ogg             REQUIRED)

Modified: code/branches/kicklib/src/external/ogreceguirenderer/OgreCEGUIRenderer.cpp
===================================================================
--- code/branches/kicklib/src/external/ogreceguirenderer/OgreCEGUIRenderer.cpp	2011-02-21 03:35:28 UTC (rev 7947)
+++ code/branches/kicklib/src/external/ogreceguirenderer/OgreCEGUIRenderer.cpp	2011-02-21 05:16:24 UTC (rev 7948)
@@ -454,11 +454,7 @@
 	d_render_sys->_setTextureUnitFiltering(0, FO_LINEAR, FO_LINEAR, FO_POINT);
 	d_render_sys->_setTextureAddressingMode(0, d_uvwAddressMode);
 	d_render_sys->_setTextureMatrix(0, Matrix4::IDENTITY);
-#if OGRE_VERSION >= 0x010600
 	d_render_sys->_setAlphaRejectSettings(CMPF_ALWAYS_PASS, 0, false);
-#else
-	d_render_sys->_setAlphaRejectSettings(CMPF_ALWAYS_PASS, 0);
-#endif
 	d_render_sys->_setTextureBlendMode(0, d_colourBlendMode);
 	d_render_sys->_setTextureBlendMode(0, d_alphaBlendMode);
 	d_render_sys->_disableTextureUnitsFrom(1);

Modified: code/branches/kicklib/src/external/ogreceguirenderer/VERSION
===================================================================
--- code/branches/kicklib/src/external/ogreceguirenderer/VERSION	2011-02-21 03:35:28 UTC (rev 7947)
+++ code/branches/kicklib/src/external/ogreceguirenderer/VERSION	2011-02-21 05:16:24 UTC (rev 7948)
@@ -1,4 +1,4 @@
-This library is part of the OGRE v1.6.1 source.
+This library is part of the OGRE v1.6.5 source.
 
 -----
 

Modified: code/branches/kicklib/src/external/ogreceguirenderer/changes_orxonox.diff
===================================================================
--- code/branches/kicklib/src/external/ogreceguirenderer/changes_orxonox.diff	2011-02-21 03:35:28 UTC (rev 7947)
+++ code/branches/kicklib/src/external/ogreceguirenderer/changes_orxonox.diff	2011-02-21 05:16:24 UTC (rev 7948)
@@ -17,18 +17,6 @@
  
  #include "OgreCEGUIRenderer.h"
  #include "OgreCEGUITexture.h"
-@@ -454,7 +454,11 @@
- 	d_render_sys->_setTextureUnitFiltering(0, FO_LINEAR, FO_LINEAR, FO_POINT);
- 	d_render_sys->_setTextureAddressingMode(0, d_uvwAddressMode);
- 	d_render_sys->_setTextureMatrix(0, Matrix4::IDENTITY);
-+#if OGRE_VERSION >= 0x010600
-+	d_render_sys->_setAlphaRejectSettings(CMPF_ALWAYS_PASS, 0, false);
-+#else
- 	d_render_sys->_setAlphaRejectSettings(CMPF_ALWAYS_PASS, 0);
-+#endif
- 	d_render_sys->_setTextureBlendMode(0, d_colourBlendMode);
- 	d_render_sys->_setTextureBlendMode(0, d_alphaBlendMode);
- 	d_render_sys->_disableTextureUnitsFrom(1);
 --- OgreCEGUIRenderer.h	Wed Jan 28 21:14:09 2009
 +++ OgreCEGUIRenderer.h	Wed Jan 28 21:06:46 2009
 @@ -29,15 +29,15 @@

Modified: code/branches/kicklib/src/libraries/core/CMakeLists.txt
===================================================================
--- code/branches/kicklib/src/libraries/core/CMakeLists.txt	2011-02-21 03:35:28 UTC (rev 7947)
+++ code/branches/kicklib/src/libraries/core/CMakeLists.txt	2011-02-21 05:16:24 UTC (rev 7948)
@@ -53,7 +53,6 @@
 COMPILATION_BEGIN FilesystemCompilation.cc
   command/ArgumentCompletionFunctions.cc
   ConfigFileManager.cc
-  MemoryArchive.cc
   PathConfig.cc
 COMPILATION_END
 

Modified: code/branches/kicklib/src/libraries/core/GraphicsManager.cc
===================================================================
--- code/branches/kicklib/src/libraries/core/GraphicsManager.cc	2011-02-21 03:35:28 UTC (rev 7947)
+++ code/branches/kicklib/src/libraries/core/GraphicsManager.cc	2011-02-21 05:16:24 UTC (rev 7948)
@@ -34,8 +34,6 @@
 #include <boost/filesystem.hpp>
 #include <boost/shared_array.hpp>
 
-#include <OgreArchiveFactory.h>
-#include <OgreArchiveManager.h>
 #include <OgreFrameListener.h>
 #include <OgreRoot.h>
 #include <OgreLogManager.h>
@@ -57,7 +55,6 @@
 #include "Game.h"
 #include "GameMode.h"
 #include "Loader.h"
-#include "MemoryArchive.h"
 #include "PathConfig.h"
 #include "WindowEventListener.h"
 #include "XMLFile.h"
@@ -89,9 +86,6 @@
     */
     GraphicsManager::GraphicsManager(bool bLoadRenderer)
         : ogreWindowEventListener_(new OgreWindowEventListener())
-#if OGRE_VERSION < 0x010600
-        , memoryArchiveFactory_(new MemoryArchiveFactory())
-#endif
         , renderWindow_(0)
         , viewport_(0)
     {
@@ -178,54 +172,6 @@
 
         this->loadRenderer();
 
-#if OGRE_VERSION < 0x010600
-        // WORKAROUND: There is an incompatibility for particle scripts when trying
-        // to support both Ogre 1.4 and 1.6. The hacky solution is to create
-        // scripts for the 1.6 version and then remove the inserted "particle_system"
-        // keyword. But we need to supply these new scripts as well, which is why
-        // there is an extra Ogre::Archive dealing with it in the memory.
-        using namespace Ogre;
-        ArchiveManager::getSingleton().addArchiveFactory(memoryArchiveFactory_.get());
-        const StringVector& groups = ResourceGroupManager::getSingleton().getResourceGroups();
-        // Travers all groups
-        for (StringVector::const_iterator itGroup = groups.begin(); itGroup != groups.end(); ++itGroup)
-        {
-            FileInfoListPtr files = ResourceGroupManager::getSingleton().findResourceFileInfo(*itGroup, "*.particle");
-            for (FileInfoList::const_iterator itFile = files->begin(); itFile != files->end(); ++itFile)
-            {
-                // open file
-                Ogre::DataStreamPtr input = ResourceGroupManager::getSingleton().openResource(itFile->filename, *itGroup, false);
-                std::stringstream output;
-                // Parse file and replace "particle_system" with nothing
-                while (!input->eof())
-                {
-                    std::string line = input->getLine();
-                    size_t pos = line.find("particle_system");
-                    if (pos != std::string::npos)
-                    {
-                        // 15 is the length of "particle_system"
-                        line.replace(pos, 15, "");
-                    }
-                    output << line << std::endl;
-                }
-                // Add file to the memory archive
-                shared_array<char> data(new char[output.str().size()]);
-                // Debug optimisations
-                const std::string& outputStr = output.str();
-                char* rawData = data.get();
-                for (unsigned i = 0; i < outputStr.size(); ++i)
-                    rawData[i] = outputStr[i];
-                MemoryArchive::addFile("particle_scripts_ogre_1.4_" + *itGroup, itFile->filename, data, output.str().size());
-            }
-            if (!files->empty())
-            {
-                // Declare the files, but using a new group
-                ResourceGroupManager::getSingleton().addResourceLocation("particle_scripts_ogre_1.4_" + *itGroup,
-                    "Memory", "particle_scripts_ogre_1.4_" + *itGroup);
-            }
-        }
-#endif
-
         // Initialise all resources (do this AFTER the renderer has been loaded!)
         // Note: You can only do this once! Ogre will check whether a resource group has
         // already been initialised. If you need to load resources later, you will have to

Modified: code/branches/kicklib/src/libraries/core/GraphicsManager.h
===================================================================
--- code/branches/kicklib/src/libraries/core/GraphicsManager.h	2011-02-21 03:35:28 UTC (rev 7947)
+++ code/branches/kicklib/src/libraries/core/GraphicsManager.h	2011-02-21 05:16:24 UTC (rev 7948)
@@ -97,9 +97,6 @@
         void printScreen();
 
         scoped_ptr<OgreWindowEventListener> ogreWindowEventListener_; //!< Pimpl to hide OgreWindowUtilities.h
-#if OGRE_VERSION < 0x010600
-        scoped_ptr<MemoryArchiveFactory>    memoryArchiveFactory_;    //!< Stores the modified particle scripts
-#endif
         scoped_ptr<Ogre::LogManager>        ogreLogger_;
         scoped_ptr<Ogre::Root>              ogreRoot_;                //!< Ogre's root
         Ogre::RenderWindow* renderWindow_;             //!< the one and only render window

Deleted: code/branches/kicklib/src/libraries/core/MemoryArchive.cc
===================================================================
--- code/branches/kicklib/src/libraries/core/MemoryArchive.cc	2011-02-21 03:35:28 UTC (rev 7947)
+++ code/branches/kicklib/src/libraries/core/MemoryArchive.cc	2011-02-21 05:16:24 UTC (rev 7948)
@@ -1,141 +0,0 @@
-/*
- *   ORXONOX - the hottest 3D action shooter ever to exist
- *                    > www.orxonox.net <
- *
- *
- *   License notice:
- *
- *   This program is free software; you can redistribute it and/or
- *   modify it under the terms of the GNU General Public License
- *   as published by the Free Software Foundation; either version 2
- *   of the License, or (at your option) any later version.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program; if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- *
- *   Author:
- *      Reto Grieder
- *   Co-authors:
- *      ...
- *
- */
-
-#include "MemoryArchive.h"
-
-#if OGRE_VERSION < 0x010600
-
-#include <OgreException.h>
-#include <boost/filesystem.hpp>
-#include <boost/version.hpp>
-
-// Boost 1.36 has some issues with deprecated functions that have been omitted
-#if (BOOST_VERSION == 103600)
-#  define BOOST_HAS_BRANCH_PATH_FUNCTION has_parent_path
-#else
-#  define BOOST_HAS_BRANCH_PATH_FUNCTION has_branch_path
-#endif
-
-namespace orxonox
-{
-    using namespace Ogre;
-
-    MemoryArchive::ArchiveMap MemoryArchive::archives_s;
-
-    void MemoryArchive::load()
-    {
-        if (archives_s.find(this->getName()) == archives_s.end())
-            OGRE_EXCEPT(Ogre::Exception::ERR_INTERNAL_ERROR, this->getName() + " - MemoryArchive not found.", "MemoryArchive");
-    }
-
-    DataStreamPtr MemoryArchive::open(const Ogre::String& filename) const
-    {
-        const FileMap& files = archives_s[this->getName()];
-        FileMap::const_iterator itFile = files.find(filename);
-        if (itFile == files.end())
-            return DataStreamPtr();
-        else
-            return MemoryDataStreamPtr(new MemoryDataStream(itFile->second.first.get(), itFile->second.second));
-    }
-
-    void MemoryArchive::findFiles(const Ogre::String& pattern, bool bRecursive,
-        bool bDirs, Ogre::StringVector* simpleList, Ogre::FileInfoList* detailList)
-    {
-        const FileMap& files = archives_s[this->getName()];
-
-        for (FileMap::const_iterator it = files.begin(); it != files.end(); ++it)
-        {
-            boost::filesystem::path file = it->first;
-            // Check pattern
-            if (!StringUtil::match(file.string(), pattern, true))
-                continue;
-            if (bDirs)
-                file = file.branch_path();
-            if (file.empty())
-                continue;
-            if (file.BOOST_HAS_BRANCH_PATH_FUNCTION() && !bRecursive)
-                continue;
-            if (simpleList)
-                simpleList->push_back(file.string());
-            if (detailList)
-            {
-                FileInfo fi;
-                fi.archive = this;
-                fi.filename = file.string();
-                fi.basename = file.leaf();
-                fi.path = file.branch_path().string();
-                fi.compressedSize = it->second.second;
-                fi.uncompressedSize = it->second.second;
-                detailList->push_back(fi);
-            }
-        }
-    }
-    StringVectorPtr MemoryArchive::list(bool recursive, bool dirs)
-    {
-        StringVectorPtr ret(new StringVector());
-        findFiles("*", recursive, dirs, ret.getPointer(), 0);
-        return ret;
-    }
-
-    FileInfoListPtr MemoryArchive::listFileInfo(bool recursive, bool dirs)
-    {
-        FileInfoListPtr ret(new FileInfoList());
-        findFiles("*", recursive, dirs, 0, ret.getPointer());
-        return ret;
-    }
-
-    StringVectorPtr MemoryArchive::find(const Ogre::String& pattern,
-                                            bool recursive, bool dirs)
-    {
-        StringVectorPtr ret(new StringVector());
-        findFiles(pattern, recursive, dirs, ret.getPointer(), 0);
-        return ret;
-    }
-
-    FileInfoListPtr MemoryArchive::findFileInfo(const Ogre::String& pattern,
-        bool recursive, bool dirs)
-    {
-        FileInfoListPtr ret(new FileInfoList());
-        findFiles(pattern, recursive, dirs, 0, ret.getPointer());
-        return ret;
-    }
-
-    bool MemoryArchive::exists(const Ogre::String& filename)
-    {
-        const FileMap& files = archives_s[this->getName()];
-        return files.find(filename) != files.end();
-    }
-
-    const Ogre::String& MemoryArchiveFactory::getType(void) const
-    {
-        static std::string result("Memory");
-        return result;
-    }
-}
-
-#endif /* OGRE_VERSION < 0x010600 */

Deleted: code/branches/kicklib/src/libraries/core/MemoryArchive.h
===================================================================
--- code/branches/kicklib/src/libraries/core/MemoryArchive.h	2011-02-21 03:35:28 UTC (rev 7947)
+++ code/branches/kicklib/src/libraries/core/MemoryArchive.h	2011-02-21 05:16:24 UTC (rev 7948)
@@ -1,106 +0,0 @@
-/*
- *   ORXONOX - the hottest 3D action shooter ever to exist
- *                    > www.orxonox.net <
- *
- *
- *   License notice:
- *
- *   This program is free software; you can redistribute it and/or
- *   modify it under the terms of the GNU General Public License
- *   as published by the Free Software Foundation; either version 2
- *   of the License, or (at your option) any later version.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program; if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- *
- *   Author:
- *      Reto Grieder
- *   Co-authors:
- *      ...
- *
- */
-
-/**
-    @file
-    @ingroup Management Resources
-*/
-
-#ifndef _MemoryArchive_H__
-#define _MemoryArchive_H__
-
-#include "CorePrereqs.h"
-#include <OgrePrerequisites.h>
-
-#if OGRE_VERSION < 0x010600
-
-#include <map>
-#include <OgreArchive.h>
-#include <OgreArchiveFactory.h>
-#include <boost/shared_array.hpp>
-
-namespace orxonox
-{
-    /**
-    @brief
-        Provides a simple mechanism of 'memory mapped IO', but compatible for Ogre 1.4
-
-        Files are stored as shared_array<char> in a static map with the archive names
-        (imaging the different archives as resource locations). This map then contains
-        yet another map with the actual files.
-        If you want to know why we make such a fuss, contact GraphicsManager::upgradeToGraphics()
-        for more information.
-    */
-    class MemoryArchive : public Ogre::Archive
-    {
-    public:
-        MemoryArchive(const Ogre::String& name, const Ogre::String& archiveType) : Ogre::Archive(name, archiveType) { }
-        ~MemoryArchive() { }
-
-        bool isCaseSensitive(void) const { return true; }
-
-        void load();
-        void unload() { }
-
-        Ogre::DataStreamPtr open(const Ogre::String& filename) const;
-
-        Ogre::StringVectorPtr list(bool recursive = true, bool dirs = false);
-        Ogre::FileInfoListPtr listFileInfo(bool recursive = true, bool dirs = false);
-
-        Ogre::StringVectorPtr find(const Ogre::String& pattern, bool recursive = true,
-            bool dirs = false);
-        Ogre::FileInfoListPtr findFileInfo(const Ogre::String& pattern, bool recursive = true,
-            bool dirs = false);
-
-        bool exists(const Ogre::String& filename);
-
-        static void addFile(const std::string& archiveName, const std::string& filename, shared_array<char> content, size_t size)
-            { archives_s[archiveName][filename] = std::make_pair(content, size); }
-
-    private:
-        void findFiles(const Ogre::String& pattern, bool bRecursive,
-            bool bDirs, Ogre::StringVector* simpleList, Ogre::FileInfoList* detailList);
-
-        typedef std::map<std::string, std::pair<shared_array<char>, size_t> > FileMap;
-        typedef std::map<std::string, FileMap> ArchiveMap;
-        static ArchiveMap archives_s;
-    };
-
-    //! Specialisation of ArchiveFactory for MemoryArchive.
-    class _CoreExport MemoryArchiveFactory : public Ogre::ArchiveFactory
-    {
-    public:
-        const Ogre::String& getType(void) const;
-        Ogre::Archive* createInstance(const Ogre::String& name) { return new MemoryArchive(name, "Memory"); }
-        void destroyInstance(Ogre::Archive* arch)               { delete arch; }
-    };
-}
-
-#endif /* OGRE_VERSION < 0x010600 */
-
-#endif /* _MemoryArchive_H__ */

Modified: code/branches/kicklib/src/libraries/tools/Mesh.cc
===================================================================
--- code/branches/kicklib/src/libraries/tools/Mesh.cc	2011-02-21 03:35:28 UTC (rev 7947)
+++ code/branches/kicklib/src/libraries/tools/Mesh.cc	2011-02-21 05:16:24 UTC (rev 7948)
@@ -68,17 +68,6 @@
             {
                 this->entity_ = this->scenemanager_->createEntity("Mesh" + multi_cast<std::string>(Mesh::meshCounter_s++), meshsource);
                 this->entity_->setCastShadows(this->bCastShadows_);
-
-#if OGRE_VERSION < 0x010600
-                this->entity_->setNormaliseNormals(true);
-                /*
-                    Excerpt from Ogre forum:
-                    "Note that the above is only for the fixed function pipeline.
-                    If/when you get into shaders, you'll need to manually normalize() the normal inside the vertex or pixel shader."
-
-                    I don't know exactly what this means, but I put this here if there will be problems with shaders.
-                */
-#endif
             }
             catch (...)
             {




More information about the Orxonox-commit mailing list