Moved the Geometry::set*Binding to after the set*Array() to prevent problems when using the deprecated functionality.

This commit is contained in:
Robert Osfield
2013-06-18 17:48:43 +00:00
parent 1d1cfda1d7
commit de1eb14f8d

View File

@@ -1,5 +1,7 @@
// -*-c++-*-
#define OSG_USE_DEPRECATED_GEOMETRY_METHODS 1
#include "ConvertFromPerformer.h"
#include <osg/Group>
@@ -715,8 +717,6 @@ osg::Drawable* ConvertFromPerformer::visitGeoSet(osg::Geode* osgGeode,pfGeoSet*
// handle flat shaded skip of normals.
int nn = nv-flat_shaded_skip_all_primitives;
// set the normal binding type.
geom->setNormalBinding(_gsetBindMap[bind]);
if (ilist)
{
@@ -736,6 +736,9 @@ osg::Drawable* ConvertFromPerformer::visitGeoSet(osg::Geode* osgGeode,pfGeoSet*
}
geom->setNormalArray(osg_norms);
// set the normal binding type.
geom->setNormalBinding(_gsetBindMap[bind]);
osg::UShortArray* osg_indices = new osg::UShortArray;
osg_indices->reserve(nv);
@@ -791,9 +794,6 @@ osg::Drawable* ConvertFromPerformer::visitGeoSet(osg::Geode* osgGeode,pfGeoSet*
bind == PFGS_PER_PRIM ? geoset->getNumPrims() :
bind == PFGS_PER_VERTEX ? nv : 0;
// set the normal binding type.
geom->setNormalBinding(_gsetBindMap[bind]);
// calc the maximum num of vertex from the index list.
int cc;
if (ilist)
@@ -815,6 +815,9 @@ osg::Drawable* ConvertFromPerformer::visitGeoSet(osg::Geode* osgGeode,pfGeoSet*
}
geom->setNormalArray(osg_norms);
// set the normal binding type.
geom->setNormalBinding(_gsetBindMap[bind]);
if(ilist)
{
geom->setNormalIndices(new osg::UShortArray(nn,ilist));
@@ -836,9 +839,6 @@ osg::Drawable* ConvertFromPerformer::visitGeoSet(osg::Geode* osgGeode,pfGeoSet*
// handle flat shaded skip of normals.
int nn = nv-flat_shaded_skip_all_primitives;
// set the normal binding type.
geom->setColorBinding(_gsetBindMap[bind]);
if (ilist)
{
// calc the maximum num of vertex from the index list.
@@ -858,6 +858,10 @@ osg::Drawable* ConvertFromPerformer::visitGeoSet(osg::Geode* osgGeode,pfGeoSet*
}
geom->setColorArray(osg_colors);
// set the color binding type.
geom->setColorBinding(_gsetBindMap[bind]);
osg::UShortArray* osg_indices = new osg::UShortArray;
osg_indices->reserve(nv);