]> git.pld-linux.org Git - packages/FlightGear.git/blame - OpenSceneGraph-3.3.2.patch
- fixes for OpenSceneGraph 3.3.2 API changes
[packages/FlightGear.git] / OpenSceneGraph-3.3.2.patch
CommitLineData
934b87b5
JR
1diff --git a/src/Canvas/canvas_mgr.cxx b/src/Canvas/canvas_mgr.cxx
2index 6646b77..820934e 100644
3--- a/src/Canvas/canvas_mgr.cxx
4+++ b/src/Canvas/canvas_mgr.cxx
5@@ -18,6 +18,8 @@
6
7 #include "canvas_mgr.hxx"
8
9+#include <osg/Version>
10+
11 #include <Cockpit/od_gauge.hxx>
12 #include <Main/fg_props.hxx>
13 #include <Scripting/NasalModelData.hxx>
14@@ -49,7 +51,11 @@ static sc::Placements addSceneObjectPlacement( SGPropertyNode* placement,
15 model_data->getNode(),
16 placement,
17 canvas->getTexture(),
18+#if OSG_VERSION_LESS_THAN(3,3,2)
19 canvas->getCullCallback(),
20+#else
21+ dynamic_cast<osg::NodeCallback*>(canvas->getCullCallback()),
22+#endif
23 canvas
24 );
25 }
26diff --git a/src/FDM/groundcache.cxx b/src/FDM/groundcache.cxx
27index 0b34115..379d70a 100644
28--- a/src/FDM/groundcache.cxx
29+++ b/src/FDM/groundcache.cxx
30@@ -36,6 +36,7 @@
31 #include <osg/MatrixTransform>
32 #include <osg/PositionAttitudeTransform>
33 #include <osg/CameraView>
34+#include <osg/Version>
35
36 #include <simgear/sg_inlines.h>
37 #include <simgear/constants.h>
38@@ -92,7 +93,11 @@ public:
39 }
40 virtual void apply(osg::Node& node)
41 {
42+#if OSG_VERSION_LESS_THAN(3,3,2)
43 if (!testBoundingSphere(node.getBound()))
44+#else
45+ if (!testBoundingSphere(node.getBoundingSphere()))
46+#endif
47 return;
48
49 addBoundingVolume(node);
50@@ -100,7 +105,11 @@ public:
51
52 virtual void apply(osg::Group& group)
53 {
54+#if OSG_VERSION_LESS_THAN(3,3,2)
55 if (!testBoundingSphere(group.getBound()))
56+#else
57+ if (!testBoundingSphere(group.getBoundingSphere()))
58+#endif
59 return;
60
61 simgear::BVHSubTreeCollector::NodeList parentNodeList;
62@@ -133,7 +142,11 @@ public:
63 if (transform.getReferenceFrame() != osg::Transform::RELATIVE_RF)
64 return;
65
66+#if OSG_VERSION_LESS_THAN(3,3,2)
67 if (!testBoundingSphere(transform.getBound()))
68+#else
69+ if (!testBoundingSphere(transform.getBoundingSphere()))
70+#endif
71 return;
72
73 osg::Matrix inverseMatrix;
74diff --git a/src/Scenery/scenery.cxx b/src/Scenery/scenery.cxx
75index 73d0b7f..d5fa933 100644
76--- a/src/Scenery/scenery.cxx
77+++ b/src/Scenery/scenery.cxx
78@@ -34,6 +34,7 @@
79 #include <osg/PositionAttitudeTransform>
80 #include <osg/CameraView>
81 #include <osg/LOD>
82+#include <osg/Version>
83
84 #include <osgViewer/Viewer>
85
86@@ -112,7 +113,11 @@ public:
87 {
88 if (&node == _skipNode)
89 return;
90+#if OSG_VERSION_LESS_THAN(3,3,2)
91 if (!testBoundingSphere(node.getBound()))
92+#else
93+ if (!testBoundingSphere(node.getBoundingSphere()))
94+#endif
95 return;
96
97 addBoundingVolume(node);
98@@ -122,7 +127,11 @@ public:
99 {
100 if (&group == _skipNode)
101 return;
102+#if OSG_VERSION_LESS_THAN(3,3,2)
103 if (!testBoundingSphere(group.getBound()))
104+#else
105+ if (!testBoundingSphere(group.getBoundingSphere()))
106+#endif
107 return;
108
109 traverse(group);
110@@ -153,7 +162,11 @@ private:
111 if (transform.getReferenceFrame() != osg::Transform::RELATIVE_RF)
112 return;
113
114+#if OSG_VERSION_LESS_THAN(3,3,2)
115 if (!testBoundingSphere(transform.getBound()))
116+#else
117+ if (!testBoundingSphere(transform.getBoundingSphere()))
118+#endif
119 return;
120
121 osg::Matrix inverseMatrix;
122diff --git a/src/Scenery/tileentry.cxx b/src/Scenery/tileentry.cxx
123index 31d14c7..d49c1b1 100644
124--- a/src/Scenery/tileentry.cxx
125+++ b/src/Scenery/tileentry.cxx
126@@ -29,6 +29,7 @@
127 #include <istream>
128
129 #include <osg/LOD>
130+#include <osg/Version>
131
132 #include <simgear/bucket/newbucket.hxx>
133 #include <simgear/debug/logstream.hxx>
134@@ -81,7 +82,11 @@ void TileEntry::prep_ssg_node(float vis) {
135 return;
136 // visibility can change from frame to frame so we update the
137 // range selector cutoff's each time.
138+#if OSG_VERSION_LESS_THAN(3,3,2)
139 float bounding_radius = _node->getChild(0)->getBound().radius();
140+#else
141+ float bounding_radius = _node->getChild(0)->getBoundingSphere().radius();
142+#endif
143 _node->setRange( 0, 0, vis + bounding_radius );
144 }
145
This page took 0.081335 seconds and 4 git commands to generate.