Renamed chanels to array to be consistent with the rest of the usage
This commit is contained in:
@@ -1183,21 +1183,21 @@ void SharedArrayOptimizer::findDuplicatedUVs(const osg::Geometry& geometry)
|
||||
{
|
||||
_deduplicateUvs.clear();
|
||||
|
||||
// look for all channels that are shared only *within* the geometry
|
||||
// look for all arrays that are shared only *within* the geometry
|
||||
std::map<const osg::Array*, unsigned int> arrayPointerCounter;
|
||||
|
||||
for(unsigned int id = 0 ; id < geometry.getNumTexCoordArrays() ; ++ id)
|
||||
{
|
||||
const osg::Array* channel = geometry.getTexCoordArray(id);
|
||||
if(channel && channel->getNumElements())
|
||||
const osg::Array* array = geometry.getTexCoordArray(id);
|
||||
if(array && array->getNumElements())
|
||||
{
|
||||
if(arrayPointerCounter.find(channel) == arrayPointerCounter.end())
|
||||
if(arrayPointerCounter.find(array) == arrayPointerCounter.end())
|
||||
{
|
||||
arrayPointerCounter[channel] = 1;
|
||||
arrayPointerCounter[array] = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
arrayPointerCounter[channel] += 1;
|
||||
arrayPointerCounter[array] += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1206,14 +1206,14 @@ void SharedArrayOptimizer::findDuplicatedUVs(const osg::Geometry& geometry)
|
||||
|
||||
for(unsigned int id = 0 ; id != geometry.getNumTexCoordArrays() ; ++ id)
|
||||
{
|
||||
const osg::Array* channel = geometry.getTexCoordArray(id);
|
||||
const osg::Array* array = geometry.getTexCoordArray(id);
|
||||
// test if array is shared inside the geometry
|
||||
if(channel && arrayPointerCounter[channel] > 1)
|
||||
if(array && arrayPointerCounter[array] > 1)
|
||||
{
|
||||
std::map<const osg::Array*, unsigned int>::const_iterator reference = references.find(channel);
|
||||
std::map<const osg::Array*, unsigned int>::const_iterator reference = references.find(array);
|
||||
if(reference == references.end())
|
||||
{
|
||||
references[channel] = id;
|
||||
references[array] = id;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user