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:
@@ -182,20 +182,6 @@ void Tessellator::retessellatePolygons(osg::Geometry &geom)
|
||||
|
||||
if (!vertices || vertices->empty() || geom.getPrimitiveSetList().empty()) return;
|
||||
|
||||
|
||||
// we currently don't handle geometry which use indices...
|
||||
if (geom.getVertexIndices() ||
|
||||
geom.getNormalIndices() ||
|
||||
geom.getColorIndices() ||
|
||||
geom.getSecondaryColorIndices() ||
|
||||
geom.getFogCoordIndices()) return;
|
||||
|
||||
// not even text coord indices don't handle geometry which use indices...
|
||||
for(unsigned int unit=0;unit<geom.getNumTexCoordArrays();++unit)
|
||||
{
|
||||
if (geom.getTexCoordIndices(unit)) return;
|
||||
}
|
||||
|
||||
if (_ttype==TESS_TYPE_POLYGONS || _ttype==TESS_TYPE_DRAWABLE) _numberVerts=0; // 09.04.04 GWM reset Tessellator
|
||||
// the reset is needed by the flt loader which reuses a Tessellator for triangulating polygons.
|
||||
// as such it might be reset by other loaders/developers in future.
|
||||
@@ -470,14 +456,14 @@ void Tessellator::handleNewVertices(osg::Geometry& geom,VertexPtrToIndexMap &ver
|
||||
arrays.push_back(geom.getFogCoordArray());
|
||||
}
|
||||
|
||||
osg::Geometry::ArrayDataList& tcal = geom.getTexCoordArrayList();
|
||||
for(osg::Geometry::ArrayDataList::iterator tcalItr=tcal.begin();
|
||||
osg::Geometry::ArrayList& tcal = geom.getTexCoordArrayList();
|
||||
for(osg::Geometry::ArrayList::iterator tcalItr=tcal.begin();
|
||||
tcalItr!=tcal.end();
|
||||
++tcalItr)
|
||||
{
|
||||
if (tcalItr->array.valid())
|
||||
if (tcalItr->valid())
|
||||
{
|
||||
arrays.push_back(tcalItr->array.get());
|
||||
arrays.push_back(tcalItr->get());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user