From e9d45521960bde6d055f055b521bbc89d1c3b441 Mon Sep 17 00:00:00 2001 From: Dmitry Marakasov Date: Fri, 14 Feb 2020 23:12:10 +0000 Subject: [PATCH] - Bump revision after graphics/osg update, add patches to fix build with newer mygui and osg --- games/openmw/Makefile | 2 +- ...patch-components_esm_custommarkerstate.hpp | 11 ++++ games/openmw/files/patch-osg3.6.5 | 62 +++++++++++++++++++ 3 files changed, 74 insertions(+), 1 deletion(-) create mode 100644 games/openmw/files/patch-components_esm_custommarkerstate.hpp create mode 100644 games/openmw/files/patch-osg3.6.5 diff --git a/games/openmw/Makefile b/games/openmw/Makefile index 1439c906cb4b..4e57c175ec8e 100644 --- a/games/openmw/Makefile +++ b/games/openmw/Makefile @@ -4,7 +4,7 @@ PORTNAME= openmw DISTVERSIONPREFIX= openmw- DISTVERSION= 0.45.0 -PORTREVISION= 8 +PORTREVISION= 9 CATEGORIES= games PATCH_SITES= https://github.com/${GH_ACCOUNT}/${GH_PROJECT}/commit/ diff --git a/games/openmw/files/patch-components_esm_custommarkerstate.hpp b/games/openmw/files/patch-components_esm_custommarkerstate.hpp new file mode 100644 index 000000000000..8f7ca816c389 --- /dev/null +++ b/games/openmw/files/patch-components_esm_custommarkerstate.hpp @@ -0,0 +1,11 @@ +--- components/esm/custommarkerstate.hpp.orig 2019-03-10 10:50:29 UTC ++++ components/esm/custommarkerstate.hpp +@@ -16,7 +16,7 @@ struct CustomMarker + + std::string mNote; + +- bool operator == (const CustomMarker& other) ++ bool operator == (const CustomMarker& other) const + { + return mNote == other.mNote && mCell == other.mCell && mWorldX == other.mWorldX && mWorldY == other.mWorldY; + } diff --git a/games/openmw/files/patch-osg3.6.5 b/games/openmw/files/patch-osg3.6.5 new file mode 100644 index 000000000000..d97ca8efa7d4 --- /dev/null +++ b/games/openmw/files/patch-osg3.6.5 @@ -0,0 +1,62 @@ +See https://github.com/OpenMW/openmw/pull/2676 + +From 4eb330b4ed794fd6201f7954a517dec29678c285 Mon Sep 17 00:00:00 2001 +From: Julien Valentin +Date: Mon, 27 Jan 2020 23:44:22 +0100 +Subject: [PATCH] comply with new OQN API + +--- + apps/openmw/mwrender/sky.cpp | 17 ++++++++++++----- + 1 file changed, 12 insertions(+), 5 deletions(-) + +diff --git a/apps/openmw/mwrender/sky.cpp b/apps/openmw/mwrender/sky.cpp +index 3996f472c2..009b9d935f 100644 +--- apps/openmw/mwrender/sky.cpp ++++ apps/openmw/mwrender/sky.cpp +@@ -2,6 +2,7 @@ + + #include + ++#include + #include + #include + #include +@@ -557,27 +558,33 @@ class Sun : public CelestialBody + { + osg::ref_ptr oqn = new osg::OcclusionQueryNode; + oqn->setQueriesEnabled(true); +- ++#if OSG_VERSION_LESS_THAN(3,6,5) ++ osg::Geometry* queryGeom = oqn->getQueryGeometry(); ++#else ++ osg::ref_ptr queryGeom(new osg::QueryGeometry()); ++#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()); ++ queryGeom->removePrimitiveSet(0, queryGeom->getNumPrimitiveSets()); + queryGeom->addPrimitiveSet(mGeom->getPrimitiveSet(0)); + ++#if OSG_VERSION_LESS_THAN(3,6,5) + // Hack to disable unwanted awful code inside OcclusionQueryNode::computeBound. + oqn->setComputeBoundingSphereCallback(new DummyComputeBoundCallback); + // Still need a proper bounding sphere. + oqn->setInitialBound(queryGeom->getBound()); +- ++#else ++ oqn->setQueryGeometry(queryGeom); ++#endif + osg::StateSet* queryStateSet = new osg::StateSet; + if (queryVisible) + {