Raise minimum OSG version to 3.4.1

This commit is contained in:
James Turner
2020-06-18 17:22:55 +01:00
parent 720f681e0f
commit 9ccbf539c1
31 changed files with 24 additions and 350 deletions
-5
View File
@@ -45,7 +45,6 @@
#include <osg/ShadeModel>
#include <osg/StateSet>
#include <osg/FrameBufferObject> // for GL_DEPTH_STENCIL_EXT on Windows
#include <osg/Version>
#include <osgUtil/RenderBin>
#include <cassert>
@@ -276,11 +275,7 @@ namespace canvas
{
osg::NodeCallback* cull_callback =
camera
#if OSG_VERSION_LESS_THAN(3,3,2)
? camera->getCullCallback()
#else
? dynamic_cast<osg::NodeCallback*>(camera->getCullCallback())
#endif
: 0;
clear();
+2 -18
View File
@@ -30,7 +30,6 @@
#include <osg/Drawable>
#include <osg/Geode>
#include <osg/StateAttribute>
#include <osg/Version>
#include <cassert>
#include <cmath>
@@ -365,13 +364,7 @@ namespace canvas
// Drawables have a bounding box...
if( _drawable )
return _drawable->
#if OSG_VERSION_LESS_THAN(3,3,2)
getBound()
#else
getBoundingBox()
#endif
.contains(osg::Vec3f(local_pos, 0));
return _drawable->getBoundingBox().contains(osg::Vec3f(local_pos, 0));
else if( _scene_group.valid() )
// ... for other elements, i.e. groups only a bounding sphere is available
return _scene_group->getBound().contains(osg::Vec3f(parent_pos, 0));
@@ -643,11 +636,7 @@ namespace canvas
osg::BoundingBox Element::getBoundingBox() const
{
if( _drawable )
#if OSG_VERSION_LESS_THAN(3,3,2)
return _drawable->getBound();
#else
return _drawable->getBoundingBox();
#endif
osg::BoundingBox bb;
@@ -670,12 +659,7 @@ namespace canvas
return osg::BoundingBox();
osg::BoundingBox transformed;
const osg::BoundingBox& bb =
#if OSG_VERSION_LESS_THAN(3,3,2)
_drawable->getBound();
#else
_drawable->getBoundingBox();
#endif
const osg::BoundingBox& bb = _drawable->getBoundingBox();
for(int i = 0; i < 4; ++i)
transformed.expandBy( bb.corner(i) * m );
+1 -7
View File
@@ -179,13 +179,7 @@ namespace canvas
&& child->getNameString() == "visible"
&& child->getBoolValue() )
{
CullCallback* cb =
#if OSG_VERSION_LESS_THAN(3,3,2)
static_cast<CullCallback*>
#else
dynamic_cast<CullCallback*>
#endif
( _geom->getCullCallback() );
CullCallback* cb = dynamic_cast<CullCallback*>( _geom->getCullCallback() );
if( cb )
cb->cullNextFrame();
+2 -7
View File
@@ -24,7 +24,6 @@
#include <simgear/misc/strutils.hxx>
#include <osg/Drawable>
#include <osg/Version>
#include <vg/openvg.h>
#include <cassert>
@@ -559,12 +558,8 @@ namespace canvas
/**
* Compute the bounding box
*/
osg::BoundingBox
#if OSG_VERSION_LESS_THAN(3,3,2)
computeBound()
#else
computeBoundingBox()
#endif
osg::BoundingBox computeBoundingBox()
const override
{
if( _path == VG_INVALID_HANDLE || (_attributes_dirty & PATH) )
+1 -36
View File
@@ -61,11 +61,7 @@ namespace canvas
SGVec2i sizeForWidth(int w);
#endif
#if OSG_VERSION_LESS_THAN(3,3,2)
osg::BoundingBox computeBound() const override;
#else
osg::BoundingBox computeBoundingBox() const override;
#endif
protected:
friend class TextLine;
@@ -173,13 +169,9 @@ namespace canvas
#if OSG_VERSION_GREATER_OR_EQUAL(3,5,6)
// TODO: need 3.5.6 version of this.
#else
#if OSG_VERSION_LESS_THAN(3,3,5)
GlyphQuads::Coords2 const& coords = _quads->_coords;
#else
GlyphQuads::Coords2 refCoords = _quads->_coords;
GlyphQuads::Coords2::element_type &coords = *refCoords.get();
#endif
size_t global_i = _begin + i;
@@ -217,13 +209,9 @@ namespace canvas
#if OSG_VERSION_GREATER_OR_EQUAL(3,5,6)
// TODO: need 3.5.7 version of this.
return cursorPos(0);
#else
#if OSG_VERSION_LESS_THAN(3,3,5)
GlyphQuads::Coords2 const& coords = _quads->_coords;
#else
GlyphQuads::Coords2 refCoords = _quads->_coords;
GlyphQuads::Coords2::element_type &coords = *refCoords.get();
#endif
GlyphQuads::Glyphs const& glyphs = _quads->_glyphs;
@@ -649,28 +637,9 @@ namespace canvas
}
//----------------------------------------------------------------------------
#if OSG_VERSION_LESS_THAN(3,3,2)
osg::BoundingBox Text::TextOSG::computeBound() const
#else
osg::BoundingBox Text::TextOSG::computeBoundingBox() const
#endif
{
#if OSG_VERSION_LESS_THAN(3,3,2)
osg::BoundingBox bb = osgText::Text::computeBound();
#else
osg::BoundingBox bb = osgText::Text::computeBoundingBox();
#endif
#if OSG_VERSION_LESS_THAN(3,1,0)
if( bb.valid() )
{
// TODO bounding box still doesn't seem always right (eg. with center
// horizontal alignment not completely accurate)
bb._min.y() += _offset.y();
bb._max.y() += _offset.y();
}
#endif
osg::BoundingBox bb = osgText::Text::computeBoundingBox();
return bb;
}
@@ -685,12 +654,8 @@ namespace canvas
const GlyphQuads& quads = _textureGlyphQuadMap.begin()->second;
const GlyphQuads::Glyphs& glyphs = quads._glyphs;
#if OSG_VERSION_LESS_THAN(3,3,5)
GlyphQuads::Coords2 const& coords = quads._coords;
#else
GlyphQuads::Coords2 refCoords = quads._coords;
GlyphQuads::Coords2::element_type &coords = *refCoords.get();
#endif
const GlyphQuads::LineNumbers& line_numbers = quads._lineNumbers;