Moved the set binding and normalize for VertexAttrib to after the VertexAttrib array assignment

This commit is contained in:
Robert Osfield
2013-06-18 15:03:26 +00:00
parent 635993038a
commit 55ae5b1c5f

View File

@@ -1,3 +1,5 @@
#define OSG_USE_DEPRECATED_GEOMETRY_METHODS 1
#include <osg/Geometry>
#include <osg/Notify>
#include <osg/io_utils>
@@ -322,25 +324,23 @@ bool Geometry_readLocalData(Object& obj, Input& fr)
{
int unit=0;
fr[1].getInt(unit);
geom.setVertexAttribBinding(unit,vertexAttribBinding);
fr+=3;
iteratorAdvanced = true;
}
bool vertexAttribNormalize = false;
if (fr.matchSequence("VertexAttribNormalize %i %w"))
{
int unit=0;
fr[1].getInt(unit);
if (fr[2].matchString("TRUE"))
geom.setVertexAttribNormalize(unit,GL_TRUE);
else
geom.setVertexAttribNormalize(unit,GL_FALSE);
vertexAttribNormalize = fr[2].matchString("TRUE");
fr+=3;
iteratorAdvanced = true;
}
if (fr.matchSequence("VertexAttribArray %i"))
{
int unit=0;
@@ -351,6 +351,8 @@ bool Geometry_readLocalData(Object& obj, Input& fr)
if (vertexattrib)
{
geom.setVertexAttribArray(unit,vertexattrib);
geom.setVertexAttribBinding(unit,vertexAttribBinding);
geom.setVertexAttribNormalize(unit,vertexAttribNormalize);
}
iteratorAdvanced = true;