Fixes for .osg output of UByte4 values, and added missing template contructor
to DrawElementsUShort.
This commit is contained in:
@@ -392,6 +392,11 @@ class SG_EXPORT DrawElementsUInt : public PrimitiveSet, public VectorUInt
|
||||
PrimitiveSet(DrawElementsUIntPrimitiveType,mode),
|
||||
VectorUInt(no) {}
|
||||
|
||||
template <class InputIterator>
|
||||
DrawElementsUInt(GLenum mode, InputIterator first,InputIterator last) :
|
||||
PrimitiveSet(DrawElementsUIntPrimitiveType,mode),
|
||||
VectorUInt(first,last) {}
|
||||
|
||||
virtual Object* cloneType() const { return new DrawElementsUInt(); }
|
||||
virtual Object* clone(const CopyOp& copyop) const { return new DrawElementsUInt(*this,copyop); }
|
||||
virtual bool isSameKindAs(const Object* obj) const { return dynamic_cast<const DrawElementsUInt*>(obj)!=NULL; }
|
||||
|
||||
@@ -148,10 +148,10 @@ class UByte4
|
||||
|
||||
friend inline std::ostream& operator << (std::ostream& output, const UByte4& vec)
|
||||
{
|
||||
output << vec._v[0] << " "
|
||||
<< vec._v[1] << " "
|
||||
<< vec._v[2] << " "
|
||||
<< vec._v[3];
|
||||
output << (int)vec._v[0] << " "
|
||||
<< (int)vec._v[1] << " "
|
||||
<< (int)vec._v[2] << " "
|
||||
<< (int)vec._v[3];
|
||||
return output; // to enable cascading
|
||||
}
|
||||
|
||||
|
||||
@@ -524,7 +524,7 @@ Array* Array_readLocalData(Input& fr)
|
||||
fr[2].getUInt(b) &&
|
||||
fr[3].getUInt(a))
|
||||
{
|
||||
++fr;
|
||||
fr+=4;
|
||||
array->push_back(osg::UByte4(r,g,b,a));
|
||||
}
|
||||
else ++fr;
|
||||
|
||||
Reference in New Issue
Block a user