[Orxonox-commit 5002] r9669 - in code/branches/libs/src: libraries/core modules/objects orxonox/graphics

landauf at orxonox.net landauf at orxonox.net
Wed Sep 4 21:49:17 CEST 2013


Author: landauf
Date: 2013-09-04 21:49:17 +0200 (Wed, 04 Sep 2013)
New Revision: 9669

Modified:
   code/branches/libs/src/libraries/core/GraphicsManager.cc
   code/branches/libs/src/libraries/core/GraphicsManager.h
   code/branches/libs/src/libraries/core/Resource.cc
   code/branches/libs/src/modules/objects/Planet.cc
   code/branches/libs/src/orxonox/graphics/Model.cc
Log:
adjusted code for ogre 1.8.1

Modified: code/branches/libs/src/libraries/core/GraphicsManager.cc
===================================================================
--- code/branches/libs/src/libraries/core/GraphicsManager.cc	2013-09-04 19:44:31 UTC (rev 9668)
+++ code/branches/libs/src/libraries/core/GraphicsManager.cc	2013-09-04 19:49:17 UTC (rev 9669)
@@ -401,9 +401,17 @@
     @param logName
         The name of this log (so you can have several listeners
         for different logs, and identify them)
+    @param skipThisMessage
+        If set to true by the messageLogged() implementation message will not be logged
     */
+#if OGRE_VERSION >= 0x010800
     void GraphicsManager::messageLogged(const std::string& message,
+        Ogre::LogMessageLevel lml, bool maskDebug, const std::string& logName, bool& skipThisMessage)
+        // TODO: do we have to ignore the message if skipThisMessage is set?
+#else
+    void GraphicsManager::messageLogged(const std::string& message,
         Ogre::LogMessageLevel lml, bool maskDebug, const std::string& logName)
+#endif
     {
         OutputLevel orxonoxLevel;
         std::string introduction;

Modified: code/branches/libs/src/libraries/core/GraphicsManager.h
===================================================================
--- code/branches/libs/src/libraries/core/GraphicsManager.h	2013-09-04 19:44:31 UTC (rev 9668)
+++ code/branches/libs/src/libraries/core/GraphicsManager.h	2013-09-04 19:49:17 UTC (rev 9669)
@@ -107,8 +107,11 @@
         void loadRenderer();
 
         // event from Ogre::LogListener
-        void messageLogged(const std::string& message, Ogre::LogMessageLevel lml,
-        bool maskDebug, const std::string& logName);
+#if OGRE_VERSION >= 0x010800
+        void messageLogged(const std::string& message, Ogre::LogMessageLevel lml, bool maskDebug, const std::string& logName, bool& skipThisMessage);
+#else
+        void messageLogged(const std::string& message, Ogre::LogMessageLevel lml, bool maskDebug, const std::string& logName);
+#endif
 
         // console commands
         void printScreen();

Modified: code/branches/libs/src/libraries/core/Resource.cc
===================================================================
--- code/branches/libs/src/libraries/core/Resource.cc	2013-09-04 19:44:31 UTC (rev 9668)
+++ code/branches/libs/src/libraries/core/Resource.cc	2013-09-04 19:49:17 UTC (rev 9669)
@@ -100,7 +100,11 @@
                 ptr->basename = it->basename;
                 ptr->group = group;
                 ptr->size = it->uncompressedSize;
+#if OGRE_VERSION >= 0x010800
+                if (dynamic_cast<const Ogre::FileSystemArchive*>(it->archive) != NULL)
+#else
                 if (dynamic_cast<Ogre::FileSystemArchive*>(it->archive) != NULL)
+#endif
                 {
                     boost::filesystem::path base(it->archive->getName());
                     base /= it->filename;

Modified: code/branches/libs/src/modules/objects/Planet.cc
===================================================================
--- code/branches/libs/src/modules/objects/Planet.cc	2013-09-04 19:44:31 UTC (rev 9668)
+++ code/branches/libs/src/modules/objects/Planet.cc	2013-09-04 19:49:17 UTC (rev 9669)
@@ -107,11 +107,13 @@
 
                 float scaleFactor = this->getScale();
 
-    #if OGRE_VERSION >= 0x010700
+#if OGRE_VERSION >= 0x010800
+                Ogre::ProgressiveMesh::LodValueList distList;
+#elif OGRE_VERSION >= 0x010700
                 Ogre::Mesh::LodValueList distList;
-    #else
+#else
                 Ogre::Mesh::LodDistanceList distList;
-    #endif
+#endif
 
                 distList.push_back(10.0f*scaleFactor);
                 distList.push_back(19.0f*scaleFactor);
@@ -126,7 +128,12 @@
 
                 float reductionValue = 0.2f;
 
+#if OGRE_VERSION >= 0x010800
+                Ogre::ProgressiveMesh::generateLodLevels(this->mesh_.getEntity()->getMesh().get(), distList, Ogre::ProgressiveMesh::VRQ_PROPORTIONAL,
+                    reductionValue);
+#else
                 this->mesh_.getEntity()->getMesh()->generateLodLevels(distList, Ogre::ProgressiveMesh::VRQ_PROPORTIONAL, reductionValue);
+#endif
                 billboard_.setBillboardSet(this->getScene()->getSceneManager(), this->atmosphere_, Vector3(0,0,0));
 
                 this->attachOgreObject(this->billboard_.getBillboardSet());

Modified: code/branches/libs/src/orxonox/graphics/Model.cc
===================================================================
--- code/branches/libs/src/orxonox/graphics/Model.cc	2013-09-04 19:44:31 UTC (rev 9668)
+++ code/branches/libs/src/orxonox/graphics/Model.cc	2013-09-04 19:49:17 UTC (rev 9669)
@@ -29,6 +29,7 @@
 #include "Model.h"
 
 #include <OgreEntity.h>
+#include <OgreProgressiveMesh.h>
 
 #include "core/CoreIncludes.h"
 #include "core/config/ConfigValueIncludes.h"
@@ -161,7 +162,9 @@
 */
                 orxout(verbose, context::lod) << "Setting lodLevel for " << this->meshSrc_<< " with lodLevel_: " << this->lodLevel_ <<" and volume: "<< volume << ":" << endl;
 
-#if OGRE_VERSION >= 0x010700
+#if OGRE_VERSION >= 0x010800
+                Ogre::ProgressiveMesh::LodValueList distList;
+#elif OGRE_VERSION >= 0x010700
                 Ogre::Mesh::LodValueList distList;
 #else
                 Ogre::Mesh::LodDistanceList distList;
@@ -189,7 +192,12 @@
 
 
                     //Generiert LOD-Levels
+#if OGRE_VERSION >= 0x010800
+                    Ogre::ProgressiveMesh::generateLodLevels(this->mesh_.getEntity()->getMesh().get(), distList, Ogre::ProgressiveMesh::VRQ_PROPORTIONAL,
+                        this->lodReductionRate_);
+#else
                     this->mesh_.getEntity()->getMesh()->generateLodLevels(distList, Ogre::ProgressiveMesh::VRQ_PROPORTIONAL, this->lodReductionRate_);
+#endif
                 }
                 else
                 {




More information about the Orxonox-commit mailing list