From Simon Carmody, "Patches for compare and copy of Programs and related state

-Added copying of shaders and attributes in osg::Program copy constructor.
-Changed StateSet::compare function to compare Uniforms and their
override values.  Previously it compared a RefUniformPair."
This commit is contained in:
Robert Osfield
2009-04-08 12:32:52 +00:00
parent 009ddf1b1e
commit 6e780bfa62
2 changed files with 21 additions and 3 deletions

View File

@@ -425,8 +425,10 @@ int StateSet::compare(const StateSet& rhs,bool compareAttributeContents) const
{
if (lhs_uniform_itr->first<rhs_uniform_itr->first) return -1;
else if (rhs_uniform_itr->first<lhs_uniform_itr->first) return 1;
if (lhs_uniform_itr->second<rhs_uniform_itr->second) return -1;
else if (rhs_uniform_itr->second<lhs_uniform_itr->second) return 1;
if (*lhs_uniform_itr->second.first<*rhs_uniform_itr->second.first) return -1;
else if (*rhs_uniform_itr->second.first<*lhs_uniform_itr->second.first) return 1;
if (lhs_uniform_itr->second.second<rhs_uniform_itr->second.second) return -1;
else if (rhs_uniform_itr->second.second<lhs_uniform_itr->second.second) return 1;
++lhs_uniform_itr;
++rhs_uniform_itr;
}