From 3723dcda1d6d8118a9f74053e2f12515b96e8c5a Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Mon, 20 Jan 2003 09:09:46 +0000 Subject: [PATCH] From Ruben, updates to the IV/VRML1 loader to handler large datasets. --- src/osgPlugins/iv/osgvisitor.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/osgPlugins/iv/osgvisitor.cpp b/src/osgPlugins/iv/osgvisitor.cpp index 797a51cac..ee78dc64d 100644 --- a/src/osgPlugins/iv/osgvisitor.cpp +++ b/src/osgPlugins/iv/osgvisitor.cpp @@ -163,7 +163,7 @@ void OSGVisitor::applySeparator(Separator *sep) } } -osg::PrimitiveSet *generatePrimitive(PolygonList &polys, unsigned primsize) { +osg::PrimitiveSet *generatePrimitive(PolygonList &polys, unsigned primsize, unsigned numvertices) { unsigned i,j; osg::PrimitiveSet *p=0; // Fisrt of all count the number of polygons @@ -186,7 +186,7 @@ osg::PrimitiveSet *generatePrimitive(PolygonList &polys, unsigned primsize) { default: mode=osg::PrimitiveSet::QUADS; } // Now will generate the indices and the primitive - if (count < 65536) { + if (numvertices < 65536) { unsigned short *indices=new unsigned short[count*primsize]; unsigned count2=0; for (i=0;igetPolygons(); for (i=1;i<=4;i++) { - osg::PrimitiveSet *p=generatePrimitive(polys,i); + osg::PrimitiveSet *p=generatePrimitive(polys,i,vertices.size()); if (p!=0) { geometry->addPrimitiveSet(p); }