osgocean-git: Update to latest from git. Build with osg 3.6.2

This commit is contained in:
Alexey Pavlov
2018-08-08 16:30:02 +03:00
parent c695648089
commit 4c8b959ee8
3 changed files with 43 additions and 176 deletions

View File

@@ -0,0 +1,19 @@
diff -Naur osgocean/include/osgOcean/Cylinder osgocean-patched/include/osgOcean/Cylinder
--- a/include/osgOcean/Cylinder 2014-05-25 20:39:33.715800000 +0400
+++ b/include/osgOcean/Cylinder 2014-06-07 20:49:58.658400000 +0400
@@ -16,13 +16,14 @@
*/
#pragma once
+#include <osgOcean/Export>
#include <osg/Geometry>
#include <osg/Math>
namespace osgOcean
{
-class Cylinder : public osg::Geometry
+class OSGOCEAN_EXPORT Cylinder : public osg::Geometry
{
protected:
osg::ref_ptr<osg::Vec4Array> _colorArray;

View File

@@ -1,154 +0,0 @@
From effbe9b328a401643a04f555d1a6f7e21a97ab1b Mon Sep 17 00:00:00 2001
From: fltsim <fltsim@dutmms1.hmilab>
Date: Thu, 28 Jul 2016 15:18:38 +0200
Subject: [PATCH] partial fixes for OSG 3.5.x
---
include/osgOcean/Cylinder | 3 ++-
include/osgOcean/MipmapGeometryVBO | 13 +++++++++++--
src/osgOcean/GodRays.cpp | 2 +-
src/osgOcean/MipmapGeometryVBO.cpp | 6 +++++-
src/osgOcean/OceanScene.cpp | 6 +++++-
src/osgOcean/SiltEffect.cpp | 7 ++++++-
6 files changed, 30 insertions(+), 7 deletions(-)
diff -Naur osgocean/include/osgOcean/Cylinder osgocean-patched/include/osgOcean/Cylinder
--- a/include/osgOcean/Cylinder 2014-05-25 20:39:33.715800000 +0400
+++ b/include/osgOcean/Cylinder 2014-06-07 20:49:58.658400000 +0400
@@ -16,13 +16,14 @@
*/
#pragma once
+#include <osgOcean/Export>
#include <osg/Geometry>
#include <osg/Math>
namespace osgOcean
{
-class Cylinder : public osg::Geometry
+class OSGOCEAN_EXPORT Cylinder : public osg::Geometry
{
protected:
osg::ref_ptr<osg::Vec4Array> _colorArray;
diff --git a/include/osgOcean/MipmapGeometryVBO b/include/osgOcean/MipmapGeometryVBO
index beb4615..c26ee0d 100644
--- a/include/osgOcean/MipmapGeometryVBO
+++ b/include/osgOcean/MipmapGeometryVBO
@@ -17,6 +17,7 @@
#pragma once
#include <osg/Geometry>
+#include <osg/Version>
#include <assert.h>
namespace osgOcean
@@ -144,8 +145,11 @@ namespace osgOcean
* Rather than use standard computeBound() this computes the bounding box
* using the offset and the worldSize.
*/
- osg::BoundingBox computeBound( void ) const;
-
+#if OSG_VERSION_LESS_THAN(3,3,2)
+ osg::BoundingBox computeBound( void ) const;
+#else
+ osg::BoundingBox computeBoundingBox( void ) const;
+#endif
/**
* Set the tile offset for shader positioning.
* Calls dirtyBound() on its parents and recomputes recomputes
@@ -164,7 +168,12 @@ namespace osgOcean
}
dirtyBound();
+#if (OPENSCENEGRAPH_MAJOR_VERSION == 3 && OPENSCENEGRAPH_MINOR_VERSION >=4) \
+ || OPENSCENEGRAPH_MAJOR_VERSION > 3
+ setBound(computeBoundingBox( ) );
+#else
setBound( computeBound() );
+#endif
}
/**
diff --git a/src/osgOcean/MipmapGeometryVBO.cpp b/src/osgOcean/MipmapGeometryVBO.cpp
index 6faa71f..344c406 100644
--- a/src/osgOcean/MipmapGeometryVBO.cpp
+++ b/src/osgOcean/MipmapGeometryVBO.cpp
@@ -83,7 +83,11 @@ namespace osgOcean
{
}
- osg::BoundingBox MipmapGeometryVBO::computeBound( void ) const
+#if OSG_VERSION_LESS_THAN(3,3,2)
+ osg::BoundingBox MipmapGeometryVBO::computeBound( void ) const
+#else
+ osg::BoundingBox MipmapGeometryVBO::computeBoundingBox( void ) const
+#endif
{
osg::BoundingBox bb;
diff --git a/src/osgOcean/OceanScene.cpp b/src/osgOcean/OceanScene.cpp
index 8bfaa9d..41d1a4a 100644
--- a/src/osgOcean/OceanScene.cpp
+++ b/src/osgOcean/OceanScene.cpp
@@ -20,6 +20,7 @@
#include <osgOcean/FFTOceanTechnique>
#include <osg/Depth>
+#include <osg/Version>
using namespace osgOcean;
@@ -876,9 +876,12 @@ void OceanScene::traverse( osg::NodeVisitor& nv )
}
bool surfaceVisible = _oceanSurface->isVisible(*cv, eyeAboveWater);
+#if OSG_VERSION_LESS_THAN(3,3,2)
(*_oceanSurface->getCullCallback())(_oceanSurface.get(), &nv);
-
+#else
+ (*_oceanSurface->getCullCallback()).run(_oceanSurface.get(), &nv);
+#endif
preRenderCull(*cv, eyeAboveWater, surfaceVisible); // reflections/refractions
// Above water
diff --git a/src/osgOcean/SiltEffect.cpp b/src/osgOcean/SiltEffect.cpp
index 6ad4b6c..1005dae 100644
--- a/src/osgOcean/SiltEffect.cpp
+++ b/src/osgOcean/SiltEffect.cpp
@@ -26,6 +26,7 @@
#include <osg/io_utils>
#include <osg/Timer>
#include <osg/Version>
+#include <osg/GLExtensions>
using namespace osgOcean;
@@ -648,8 +649,12 @@ void SiltEffect::SiltDrawable::drawImplementation(osg::RenderInfo& renderInfo) c
{
if (!_geometry) return;
+#if OSG_VERSION_LESS_THAN(3,3,4)
const osg::Geometry::Extensions* extensions = osg::Geometry::getExtensions(renderInfo.getContextID(),true);
-
+#else
+ osg::GLExtensions *extensions = renderInfo.getState()->get<osg::GLExtensions>();
+#endif
+
glPushMatrix();
typedef std::vector<const CellMatrixMap::value_type*> DepthMatrixStartTimeVector;
diff --git a/src/osgOcean/GodRays.cpp b/src/osgOcean/GodRays.cpp
index 7ab41cd..2623d89 100644
--- a/src/osgOcean/GodRays.cpp
+++ b/src/osgOcean/GodRays.cpp
@@ -302,7 +302,7 @@
// If the eye isn't contained withing the god ray volume,
// we need to recompute the bounds or they get clipped.
- if(!getDrawable(0)->getBound().contains( eye )){
+ if(!getDrawable(0)->getBoundingBox().contains( eye )){
getDrawable(0)->dirtyBound();
getDrawable(1)->dirtyBound();
}

View File

@@ -4,8 +4,8 @@ _realname=osgocean
pkgbase=mingw-w64-${_realname}-git
pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}-git" "${MINGW_PACKAGE_PREFIX}-${_realname}-debug-git")
_ver_base=1.0.1
pkgver=1.0.1.r147
pkgrel=2
pkgver=1.0.1.r161
pkgrel=1
pkgdesc="An ocean rendering nodekit for OpenSceneGraph (mingw-w64)"
arch=('any')
license=('LGPL')
@@ -18,13 +18,13 @@ source=("${_realname}"::"git+https://github.com/kbale/osgocean.git"
"000-mingw-w64-cmake.patch"
"001-posix-layout.patch"
"002-pkgconfig.patch"
"010-osg-3.5.patch")
"003-exports.patch")
sha256sums=('SKIP'
'b3093a48259c3df5af99841934be0468691e506cfbb82eae76eadba4ab71faaf'
'6d87aae193bbd49c696aa3e78cf8f98c1df6a5459ffd100acb2db748f6f602f7'
'7aa8298607b760848a30088ca5e8f1df3446c3a690758351d759924342f62c62'
'7edc108c3a74233d9f3abe0e7022c60de4e8ffc74a7e7b3139a7ce8a09d5bbb5'
'78d292f3e79f74a9d84a873a70189f56bf4bbbd5779a98576924bb727bf3cdac')
'6a35d93047da6da41adf951d0f992a5f1d532db5c3c4a0d061591780d5604e0e')
noextract=( 'osgOcean-Resources-1.0.1.rar' )
pkgver() {
@@ -39,18 +39,10 @@ prepare() {
patch -p1 -i ${srcdir}/000-mingw-w64-cmake.patch
patch -p1 -i ${srcdir}/001-posix-layout.patch
patch -p1 -i ${srcdir}/002-pkgconfig.patch
patch -p1 -i ${srcdir}/010-osg-3.5.patch
patch -p1 -i ${srcdir}/003-exports.patch
}
build() {
plain "No build step"
}
package_release() {
provides=("${MINGW_PACKAGE_PREFIX}-${_realname}")
conflicts=("${MINGW_PACKAGE_PREFIX}-${_realname}" "${MINGW_PACKAGE_PREFIX}-${_realname}-svn")
replaces=(${MINGW_PACKAGE_PREFIX}-${_realname}-svn)
[[ -d ${srcdir}/build-release ]] && rm -rf ${srcdir}/build-release
mkdir -p ${srcdir}/build-release && cd ${srcdir}/build-release
@@ -62,16 +54,7 @@ package_release() {
-DUSE_FFTW3=ON \
-DUSE_FFTSS=OFF \
../${_realname}
make
make DESTDIR=${pkgdir} install
}
package_debug() {
depends=("${MINGW_PACKAGE_PREFIX}-${_realname}-git=${pkgver}" "${MINGW_PACKAGE_PREFIX}-OpenSceneGraph-debug")
provides=("${MINGW_PACKAGE_PREFIX}-${_realname}-debug")
conflicts=("${MINGW_PACKAGE_PREFIX}-${_realname}-debug" "${MINGW_PACKAGE_PREFIX}-${_realname}-debug-svn")
replaces=(${MINGW_PACKAGE_PREFIX}-${_realname}-debug-svn)
[[ -d ${srcdir}/build-debug ]] && rm -rf ${srcdir}/build-debug
mkdir -p ${srcdir}/build-debug && cd ${srcdir}/build-debug
@@ -86,6 +69,25 @@ package_debug() {
../${_realname}
make
}
package_release() {
provides=("${MINGW_PACKAGE_PREFIX}-${_realname}")
conflicts=("${MINGW_PACKAGE_PREFIX}-${_realname}" "${MINGW_PACKAGE_PREFIX}-${_realname}-svn")
replaces=(${MINGW_PACKAGE_PREFIX}-${_realname}-svn)
cd ${srcdir}/build-release
make DESTDIR=${pkgdir} install
}
package_debug() {
depends=("${MINGW_PACKAGE_PREFIX}-${_realname}-git=${pkgver}" "${MINGW_PACKAGE_PREFIX}-OpenSceneGraph-debug")
provides=("${MINGW_PACKAGE_PREFIX}-${_realname}-debug")
conflicts=("${MINGW_PACKAGE_PREFIX}-${_realname}-debug" "${MINGW_PACKAGE_PREFIX}-${_realname}-debug-svn")
replaces=(${MINGW_PACKAGE_PREFIX}-${_realname}-debug-svn)
cd ${srcdir}/build-debug
make DESTDIR=${pkgdir} install
rm -rf ${pkgdir}${MINGW_PREFIX}/bin/*.exe