Clean up up osg::Geometry, removing long deprecated support for array indices and BIND_PER_PRIMITIVE binding that forced OpenGL slow paths. osg::Geometry is now smaller and only supports OpenGL fasts paths.
New methods osg::Geometry::containsDeprecatedData() and osg::Geometry::fixDeprecatedData() provide a means for converting geometries that still use the array indices and BIND_PER_PRIMITIVE across to complient versions. Cleaned up the rest of the OSG where use of array indices and BIND_PER_PRIMITIVE were accessed or used.
This commit is contained in:
@@ -153,28 +153,28 @@ void RigGeometry::copyFrom(osg::Geometry& from)
|
||||
if (!copyToSelf) target.setVertexArray(from.getVertexArray());
|
||||
}
|
||||
|
||||
target.setNormalBinding(from.getNormalBinding());
|
||||
if (from.getNormalArray())
|
||||
{
|
||||
if (!copyToSelf) target.setNormalArray(from.getNormalArray());
|
||||
target.setNormalBinding(from.getNormalBinding());
|
||||
}
|
||||
|
||||
target.setColorBinding(from.getColorBinding());
|
||||
if (from.getColorArray())
|
||||
{
|
||||
if (!copyToSelf) target.setColorArray(from.getColorArray());
|
||||
target.setColorBinding(from.getColorBinding());
|
||||
}
|
||||
|
||||
target.setSecondaryColorBinding(from.getSecondaryColorBinding());
|
||||
if (from.getSecondaryColorArray())
|
||||
{
|
||||
if (!copyToSelf) target.setSecondaryColorArray(from.getSecondaryColorArray());
|
||||
target.setSecondaryColorBinding(from.getSecondaryColorBinding());
|
||||
}
|
||||
|
||||
target.setFogCoordBinding(from.getFogCoordBinding());
|
||||
if (from.getFogCoordArray())
|
||||
{
|
||||
if (!copyToSelf) target.setFogCoordArray(from.getFogCoordArray());
|
||||
target.setFogCoordBinding(from.getFogCoordBinding());
|
||||
}
|
||||
|
||||
for(unsigned int ti=0;ti<from.getNumTexCoordArrays();++ti)
|
||||
@@ -185,13 +185,13 @@ void RigGeometry::copyFrom(osg::Geometry& from)
|
||||
}
|
||||
}
|
||||
|
||||
ArrayDataList& arrayList = from.getVertexAttribArrayList();
|
||||
osg::Geometry::ArrayList& arrayList = from.getVertexAttribArrayList();
|
||||
for(unsigned int vi=0;vi< arrayList.size();++vi)
|
||||
{
|
||||
ArrayData& arrayData = arrayList[vi];
|
||||
if (arrayData.array.valid())
|
||||
osg::Array* array = arrayList[vi].get();
|
||||
if (array)
|
||||
{
|
||||
if (!copyToSelf) target.setVertexAttribData(vi,arrayData);
|
||||
if (!copyToSelf) target.setVertexAttribArray(vi,array);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user