Skip to content

Commit 7b6b8fa

Browse files
committed
Fix: compile error in OSG >= 3.1.8
1 parent 23d0c4c commit 7b6b8fa

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

src/osgEarthDrivers/engine_mp/MPGeometry.cpp

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -328,12 +328,18 @@ MPGeometry::renderPrimitiveSets(osg::State& state,
328328
}
329329
}
330330

331-
#if OSG_VERSION_GREATER_THAN(3,3,1)
331+
#if OSG_VERSION_GREATER_OR_EQUAL(3,3,2)
332332
# define COMPUTE_BOUND computeBoundingBox
333333
#else
334334
# define COMPUTE_BOUND computeBound
335335
#endif
336336

337+
#if OSG_VERSION_GREATER_OR_EQUAL(3,1,8)
338+
# define GET_ARRAY(a) (a)
339+
#else
340+
# define GET_ARRAY(a) (a).array
341+
#endif
342+
337343
osg::BoundingBox
338344
MPGeometry:: COMPUTE_BOUND() const
339345
{
@@ -468,10 +474,15 @@ MPGeometry::compileGLObjects( osg::RenderInfo& renderInfo ) const
468474
compileBufferObject(ncthis->getNormalArray(), contextID);
469475

470476
for(unsigned i=0; i<getVertexAttribArrayList().size(); ++i)
471-
compileBufferObject( getVertexAttribArrayList()[i].array.get(), contextID );
477+
{
478+
osg::Array* a = GET_ARRAY( getVertexAttribArrayList()[i] ).get();
479+
compileBufferObject( a, contextID );
480+
}
472481

473482
for(PrimitiveSetList::const_iterator i = _primitives.begin(); i != _primitives.end(); ++i )
483+
{
474484
compileBufferObject( i->get()->getBufferObject(), contextID );
485+
}
475486

476487
// compile the layer-specific things:
477488
for(unsigned i=0; i<_layers.size(); ++i)

0 commit comments

Comments
 (0)