Removed the template versions of the PrimitiveSet constructors as this was

causing problem under VisualStudio6.0.
This commit is contained in:
Robert Osfield
2003-01-15 11:29:30 +00:00
parent 64efc8ecbb
commit d542a2165d
3 changed files with 23 additions and 15 deletions

View File

@@ -1176,7 +1176,9 @@ Geometry* GeoSet::convertToGeometry()
if (_needprimlen)
{
geom->addPrimitiveSet(new DrawArrayLengths((GLenum)_oglprimtype,0, _primLengths, _primLengths+_numprims ));
DrawArrayLengths* primitives = new DrawArrayLengths((GLenum)_oglprimtype);
primitives->insert(primitives->end(), _primLengths, _primLengths+_numprims );
geom->addPrimitiveSet(primitives);
}
else
{

View File

@@ -37,6 +37,21 @@ struct TriangleAcumulatorFunctor
void TriStripVisitor::stripify(Geometry& geom)
{
if (geom.getNormalBinding()==osg::Geometry::BIND_PER_PRIMITIVE ||
geom.getNormalBinding()==osg::Geometry::BIND_PER_PRIMITIVE_SET) return;
if (geom.getColorBinding()==osg::Geometry::BIND_PER_PRIMITIVE ||
geom.getColorBinding()==osg::Geometry::BIND_PER_PRIMITIVE_SET) return;
if (geom.getSecondaryColorBinding()==osg::Geometry::BIND_PER_PRIMITIVE ||
geom.getSecondaryColorBinding()==osg::Geometry::BIND_PER_PRIMITIVE_SET) return;
if (geom.getFogCoordBinding()==osg::Geometry::BIND_PER_PRIMITIVE ||
geom.getFogCoordBinding()==osg::Geometry::BIND_PER_PRIMITIVE_SET) return;
unsigned int numSurfacePrimitives = 0;
unsigned int numNonSurfacePrimitives = 0;
@@ -118,7 +133,8 @@ void TriStripVisitor::stripify(Geometry& geom)
itr!=outPrimitives.end();
++itr)
{
osg::DrawElementsUShort* elements = new osg::DrawElementsUShort(itr->m_Type,itr->m_Indices.begin(),itr->m_Indices.end());
osg::DrawElementsUShort* elements = new osg::DrawElementsUShort(itr->m_Type);
elements->insert(elements->end(),itr->m_Indices.begin(),itr->m_Indices.end());
new_primitives.push_back(elements);
}