fix building with gcc52 with patch from Sven Eden via bug #559472
authorMichael Sterrett <mr_bones_@gentoo.org>
Thu, 3 Sep 2015 18:25:21 +0000 (14:25 -0400)
committerMichael Sterrett <mr_bones_@gentoo.org>
Thu, 3 Sep 2015 18:25:35 +0000 (14:25 -0400)
Package-Manager: portage-2.2.20.1

dev-games/ogre/files/ogre-1.9.0-gcc52.patch [new file with mode: 0644]
dev-games/ogre/files/ogre-1.9.0-remove_media_path_to_bindir.patch
dev-games/ogre/files/ogre-1.9.0-remove_resource_path_to_bindir.patch
dev-games/ogre/ogre-1.9.0-r1.ebuild

diff --git a/dev-games/ogre/files/ogre-1.9.0-gcc52.patch b/dev-games/ogre/files/ogre-1.9.0-gcc52.patch
new file mode 100644 (file)
index 0000000..030368d
--- /dev/null
@@ -0,0 +1,63 @@
+--- a/OgreMain/include/OgreProgressiveMeshGenerator.h
++++ b/OgreMain/include/OgreProgressiveMeshGenerator.h
+@@ -215,7 +215,40 @@
+       void tuneContainerSize();
+       void addVertexData(VertexData* vertexData, bool useSharedVertexLookup);
+       template<typename IndexType>
+-      void addIndexDataImpl(IndexType* iPos, const IndexType* iEnd, VertexLookupList& lookup, unsigned short submeshID);
++      void addIndexDataImpl(IndexType* iPos, const IndexType* iEnd, VertexLookupList& lookup, unsigned short submeshID)
++      {
++
++              // Loop through all triangles and connect them to the vertices.
++              for (; iPos < iEnd; iPos += 3) {
++                      // It should never reallocate or every pointer will be invalid.
++                      OgreAssert(mTriangleList.capacity() > mTriangleList.size(), "");
++                      mTriangleList.push_back(PMTriangle());
++                      PMTriangle* tri = &mTriangleList.back();
++                      tri->isRemoved = false;
++                      tri->submeshID = submeshID;
++                      for (int i = 0; i < 3; i++) {
++                              // Invalid index: Index is bigger then vertex buffer size.
++                              OgreAssert(iPos[i] < lookup.size(), "");
++                              tri->vertexID[i] = iPos[i];
++                              tri->vertex[i] = lookup[iPos[i]];
++                      }
++                      if (tri->isMalformed()) {
++#if OGRE_DEBUG_MODE
++                              stringstream str;
++                              str << "In " << mMeshName << " malformed triangle found with ID: " << getTriangleID(tri) << ". " <<
++                              std::endl;
++                              printTriangle(tri, str);
++                              str << "It will be excluded from LOD level calculations.";
++                              LogManager::getSingleton().stream() << str.str();
++#endif
++                              tri->isRemoved = true;
++                              mIndexBufferInfoList[tri->submeshID].indexCount -= 3;
++                              continue;
++                      }
++                      tri->computeNormal();
++                      addTriangleToEdges(tri);
++              }
++      }
+       void addIndexData(IndexData* indexData, bool useSharedVertexLookup, unsigned short submeshID);
+       void computeCosts();
+--- a/OgreMain/src/OgreProgressiveMeshGenerator.cpp
++++ b/OgreMain/src/OgreProgressiveMeshGenerator.cpp
+@@ -219,6 +219,8 @@
+       }
+       vbuf->unlock();
+ }
++/// Called from OgreQueuedProgressiveMeshGenerator.cpp, so it can not be defined in here.
++#if 0
+ template<typename IndexType>
+ void ProgressiveMeshGenerator::addIndexDataImpl(IndexType* iPos, const IndexType* iEnd,
+                                                 VertexLookupList& lookup,
+@@ -256,6 +258,7 @@
+               addTriangleToEdges(tri);
+       }
+ }
++#endif // 0
+ void ProgressiveMeshGenerator::addIndexData(IndexData* indexData, bool useSharedVertexLookup, unsigned short submeshID)
+ {
index 9af7685c7d775e37b7df50bd993c4d8b5b3322ad..bb2ca551dbe4b73f9b0914ba444475ea0a29c8c6 100644 (file)
@@ -1,5 +1,5 @@
---- a/CMake/InstallResources.cmake     2014-10-29 12:43:49.000000000 +0100
-+++ b/CMake/InstallResources.cmake     2014-10-29 12:46:10.017611431 +0100
+--- a/CMake/InstallResources.cmake
++++ b/CMake/InstallResources.cmake
 @@ -178,10 +178,6 @@
  
  # CREATE CONFIG FILES - BUILD DIR VERSIONS
index d73762859081c97735ce60a72d8749ab8fd45f0d..a26aa3f447bde85d782fef1980201dfb35fa24b1 100644 (file)
@@ -1,5 +1,5 @@
---- a/CMake/InstallResources.cmake     2013-12-01 18:28:12.000000000 +0100
-+++ b/CMake/InstallResources.cmake     2014-10-29 12:38:29.963602465 +0100
+--- a/CMake/InstallResources.cmake
++++ b/CMake/InstallResources.cmake
 @@ -201,11 +201,6 @@
    set(OGRE_PLUGIN_DIR_DBG "")
    set(OGRE_SAMPLES_DIR_REL "")
index 059d63e167bab5fe9b4dbd17804440238aee67ff..9b79034fd6231d31fa0db9f01bee29dc5c916edc 100644 (file)
@@ -68,8 +68,10 @@ src_prepare() {
        rm -f Tools/XMLConverter/{include,src}/tiny*.*
 
        # Fix some path issues
-       epatch "${FILESDIR}/${P}-remove_resource_path_to_bindir.patch" \
-               "${FILESDIR}/${P}-remove_media_path_to_bindir.patch"
+       epatch \
+               "${FILESDIR}/${P}-remove_resource_path_to_bindir.patch" \
+               "${FILESDIR}/${P}-remove_media_path_to_bindir.patch" \
+               "${FILESDIR}/${P}-gcc52.patch"
 }
 
 src_configure() {