diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2020-04-12 03:41:30 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2020-04-12 03:41:30 +0100 |
commit | 623ee73d661e5ed8475cb264511f683407d87365 (patch) | |
tree | 993eb27c93ec7a2d2d19550300d888fc1fed9e69 /games-engines/openmw/files/openmw-0.45.0-osg-3.6.5-1.patch | |
parent | ceeeb463cc1eef97fd62eaee8bf2196ba04bc384 (diff) |
gentoo Easter resync : 12.04.2020
Diffstat (limited to 'games-engines/openmw/files/openmw-0.45.0-osg-3.6.5-1.patch')
-rw-r--r-- | games-engines/openmw/files/openmw-0.45.0-osg-3.6.5-1.patch | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/games-engines/openmw/files/openmw-0.45.0-osg-3.6.5-1.patch b/games-engines/openmw/files/openmw-0.45.0-osg-3.6.5-1.patch new file mode 100644 index 000000000000..b47fab28d122 --- /dev/null +++ b/games-engines/openmw/files/openmw-0.45.0-osg-3.6.5-1.patch @@ -0,0 +1,51 @@ +From 807f550386a1eac6f7306589a4e4a01e783e65df Mon Sep 17 00:00:00 2001 +From: Alexander Olofsson <ace@haxalot.com> +Date: Thu, 13 Feb 2020 19:15:33 +0100 +Subject: [PATCH] Fix building mwrender/sky with OSG 3.6.5 + +OSG commit aff574b completely replaces the method of doing user-defined +query geometry, removing support for modifying the default geometry. +--- + apps/openmw/mwrender/sky.cpp | 14 ++++++++++++-- + 1 file changed, 12 insertions(+), 2 deletions(-) + +diff --git a/apps/openmw/mwrender/sky.cpp b/apps/openmw/mwrender/sky.cpp +index 3996f472c2..e13f5a7b65 100644 +--- a/apps/openmw/mwrender/sky.cpp ++++ b/apps/openmw/mwrender/sky.cpp +@@ -558,16 +558,22 @@ class Sun : public CelestialBody + osg::ref_ptr<osg::OcclusionQueryNode> oqn = new osg::OcclusionQueryNode; + oqn->setQueriesEnabled(true); + ++#if OSG_VERSION_GREATER_OR_EQUAL(3, 6, 5) ++ // With OSG 3.6.5, the method of providing user defined query geometry has been completely replaced ++ osg::ref_ptr<osg::QueryGeometry> queryGeom = new osg::QueryGeometry(oqn->getName()); ++#else ++ auto* queryGeom = oqn->getQueryGeometry(); ++#endif ++ + // Make it fast! A DYNAMIC query geometry means we can't break frame until the flare is rendered (which is rendered after all the other geometry, + // so that would be pretty bad). STATIC should be safe, since our node's local bounds are static, thus computeBounds() which modifies the queryGeometry + // is only called once. + // Note the debug geometry setDebugDisplay(true) is always DYNAMIC and that can't be changed, not a big deal. +- oqn->getQueryGeometry()->setDataVariance(osg::Object::STATIC); ++ queryGeom->setDataVariance(osg::Object::STATIC); + + // Set up the query geometry to match the actual sun's rendering shape. osg::OcclusionQueryNode wasn't originally intended to allow this, + // normally it would automatically adjust the query geometry to match the sub graph's bounding box. The below hack is needed to + // circumvent this. +- osg::Geometry* queryGeom = oqn->getQueryGeometry(); + queryGeom->setVertexArray(mGeom->getVertexArray()); + queryGeom->setTexCoordArray(0, mGeom->getTexCoordArray(0), osg::Array::BIND_PER_VERTEX); + queryGeom->removePrimitiveSet(0, oqn->getQueryGeometry()->getNumPrimitiveSets()); +@@ -578,6 +584,10 @@ class Sun : public CelestialBody + // Still need a proper bounding sphere. + oqn->setInitialBound(queryGeom->getBound()); + ++#if OSG_VERSION_GREATER_OR_EQUAL(3, 6, 5) ++ oqn->setQueryGeometry(queryGeom.release()); ++#endif ++ + osg::StateSet* queryStateSet = new osg::StateSet; + if (queryVisible) + { |