Merge pull request #398 from marchelbling/sharedarrayoptimizer-fix

Improve SharedArrayOptimizer
This commit is contained in:
OpenSceneGraph git repository 2017-12-03 11:12:20 +00:00 committed by GitHub
commit 92cccff866
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1207,8 +1207,8 @@ void SharedArrayOptimizer::findDuplicatedUVs(const osg::Geometry& geometry)
for(unsigned int id = 0 ; id != geometry.getNumTexCoordArrays() ; ++ id)
{
const osg::Array* channel = geometry.getTexCoordArray(id);
// test if array is shared outside the geometry
if(channel && static_cast<unsigned int>(channel->referenceCount()) == arrayPointerCounter[channel])
// test if array is shared inside the geometry
if(channel && arrayPointerCounter[channel] > 1)
{
std::map<const osg::Array*, unsigned int>::const_iterator reference = references.find(channel);
if(reference == references.end())