Fixed unititialized memory variables and improved readability by adding spacing where appropriate

This commit is contained in:
Robert Osfield 2017-10-31 17:55:59 +00:00
parent 6a2bd1f898
commit c242ad4497

View File

@ -415,31 +415,48 @@ class OSG_EXPORT MultiDrawElementsIndirectUShort : public DrawElementsIndirectUS
{ {
public: public:
MultiDrawElementsIndirectUShort(GLenum mode = 0/*,unsigned int firstCommand = 0, GLsizei stride = 0*/) : MultiDrawElementsIndirectUShort(GLenum mode = 0/*,unsigned int firstCommand = 0, GLsizei stride = 0*/) :
DrawElementsIndirectUShort(mode),_count(0) { _primitiveType=(Type(MultiDrawElementsUShortIndirectPrimitiveType)); } DrawElementsIndirectUShort(mode),
_count(0)
{
_primitiveType=(Type(MultiDrawElementsUShortIndirectPrimitiveType));
}
MultiDrawElementsIndirectUShort(const MultiDrawElementsIndirectUShort& mdi,const CopyOp& copyop=CopyOp::SHALLOW_COPY) : MultiDrawElementsIndirectUShort(const MultiDrawElementsIndirectUShort& mdi,const CopyOp& copyop=CopyOp::SHALLOW_COPY) :
DrawElementsIndirectUShort(mdi,copyop),_count(mdi._count) {} DrawElementsIndirectUShort(mdi,copyop),
_count(mdi._count)
{
}
/** /**
* \param mode One of osg::PrimitiveSet::Mode. Determines the type of primitives used. * \param mode One of osg::PrimitiveSet::Mode. Determines the type of primitives used.
* \param no Number of intended elements. This will be the size of the underlying vector. * \param no Number of intended elements. This will be the size of the underlying vector.
* \param ptr Pointer to a GLunsigned int to copy index data from. * \param ptr Pointer to a GLunsigned int to copy index data from.
*/ */
MultiDrawElementsIndirectUShort(GLenum mode, unsigned int no, const GLushort* ptr) : MultiDrawElementsIndirectUShort(GLenum mode, unsigned int no, const GLushort* ptr) :
DrawElementsIndirectUShort(mode,no,ptr) DrawElementsIndirectUShort(mode,no,ptr),
{_primitiveType=(Type(MultiDrawElementsUShortIndirectPrimitiveType));} _count(0)
{
_primitiveType=(Type(MultiDrawElementsUShortIndirectPrimitiveType));
}
/** /**
* \param mode One of osg::PrimitiveSet::Mode. Determines the type of primitives used. * \param mode One of osg::PrimitiveSet::Mode. Determines the type of primitives used.
* \param no Number of intended elements. This will be the size of the underlying vector. * \param no Number of intended elements. This will be the size of the underlying vector.
*/ */
MultiDrawElementsIndirectUShort(GLenum mode, unsigned int no) : MultiDrawElementsIndirectUShort(GLenum mode, unsigned int no) :
DrawElementsIndirectUShort(mode,no) DrawElementsIndirectUShort(mode,no),
{_primitiveType=(Type(MultiDrawElementsUShortIndirectPrimitiveType));} _count(0)
{
_primitiveType=(Type(MultiDrawElementsUShortIndirectPrimitiveType));
}
template <class InputIterator> template <class InputIterator>
MultiDrawElementsIndirectUShort(GLenum mode, InputIterator first,InputIterator last) : MultiDrawElementsIndirectUShort(GLenum mode, InputIterator first,InputIterator last) :
DrawElementsIndirectUShort(mode,first,last) DrawElementsIndirectUShort(mode,first,last),
{_primitiveType=(Type(MultiDrawElementsUShortIndirectPrimitiveType));} _count(0)
{
_primitiveType=(Type(MultiDrawElementsUShortIndirectPrimitiveType));
}
virtual osg::Object* cloneType() const { return new MultiDrawElementsIndirectUShort(); } virtual osg::Object* cloneType() const { return new MultiDrawElementsIndirectUShort(); }
virtual osg::Object* clone(const osg::CopyOp& copyop) const { return new MultiDrawElementsIndirectUShort(*this,copyop); } virtual osg::Object* clone(const osg::CopyOp& copyop) const { return new MultiDrawElementsIndirectUShort(*this,copyop); }
@ -467,31 +484,49 @@ class OSG_EXPORT MultiDrawElementsIndirectUByte : public DrawElementsIndirectUBy
{ {
public: public:
MultiDrawElementsIndirectUByte(GLenum mode = 0) : MultiDrawElementsIndirectUByte(GLenum mode = 0) :
DrawElementsIndirectUByte(mode),_count(0) { _primitiveType=(Type(MultiDrawElementsUByteIndirectPrimitiveType)); } DrawElementsIndirectUByte(mode),
_count(0)
{
_primitiveType=(Type(MultiDrawElementsUByteIndirectPrimitiveType));
}
MultiDrawElementsIndirectUByte(const MultiDrawElementsIndirectUByte& mdi,const CopyOp& copyop=CopyOp::SHALLOW_COPY) : MultiDrawElementsIndirectUByte(const MultiDrawElementsIndirectUByte& mdi,const CopyOp& copyop=CopyOp::SHALLOW_COPY) :
DrawElementsIndirectUByte(mdi,copyop),_count(mdi._count) {} DrawElementsIndirectUByte(mdi,copyop),
_count(mdi._count)
{
}
/** /**
* \param mode One of osg::PrimitiveSet::Mode. Determines the type of primitives used. * \param mode One of osg::PrimitiveSet::Mode. Determines the type of primitives used.
* \param no Number of intended elements. This will be the size of the underlying vector. * \param no Number of intended elements. This will be the size of the underlying vector.
* \param ptr Pointer to a GLunsigned int to copy index data from. * \param ptr Pointer to a GLunsigned int to copy index data from.
*/ */
MultiDrawElementsIndirectUByte(GLenum mode, unsigned int no, const GLubyte* ptr) : MultiDrawElementsIndirectUByte(GLenum mode, unsigned int no, const GLubyte* ptr) :
DrawElementsIndirectUByte(mode,no,ptr) DrawElementsIndirectUByte(mode,no,ptr),
{_primitiveType=(Type(MultiDrawElementsUByteIndirectPrimitiveType));} _count(0)
{
_primitiveType=(Type(MultiDrawElementsUByteIndirectPrimitiveType));
}
/** /**
* \param mode One of osg::PrimitiveSet::Mode. Determines the type of primitives used. * \param mode One of osg::PrimitiveSet::Mode. Determines the type of primitives used.
* \param no Number of intended elements. This will be the size of the underlying vector. * \param no Number of intended elements. This will be the size of the underlying vector.
*/ */
MultiDrawElementsIndirectUByte(GLenum mode, unsigned int no) : MultiDrawElementsIndirectUByte(GLenum mode, unsigned int no) :
DrawElementsIndirectUByte(mode,no) DrawElementsIndirectUByte(mode,no),
{_primitiveType=(Type(MultiDrawElementsUByteIndirectPrimitiveType));} _count(0)
{
_primitiveType=(Type(MultiDrawElementsUByteIndirectPrimitiveType));
}
template <class InputIterator> template <class InputIterator>
MultiDrawElementsIndirectUByte(GLenum mode, InputIterator first,InputIterator last) : MultiDrawElementsIndirectUByte(GLenum mode, InputIterator first,InputIterator last) :
DrawElementsIndirectUByte(mode,first,last) DrawElementsIndirectUByte(mode,first,last),
{_primitiveType=(Type(MultiDrawElementsUByteIndirectPrimitiveType));} _count(0)
{
_primitiveType=(Type(MultiDrawElementsUByteIndirectPrimitiveType));
}
virtual osg::Object* cloneType() const { return new MultiDrawElementsIndirectUByte(); } virtual osg::Object* cloneType() const { return new MultiDrawElementsIndirectUByte(); }
virtual osg::Object* clone(const osg::CopyOp& copyop) const { return new MultiDrawElementsIndirectUByte(*this,copyop); } virtual osg::Object* clone(const osg::CopyOp& copyop) const { return new MultiDrawElementsIndirectUByte(*this,copyop); }
@ -517,31 +552,47 @@ class OSG_EXPORT MultiDrawElementsIndirectUInt : public DrawElementsIndirectUInt
{ {
public: public:
MultiDrawElementsIndirectUInt(GLenum mode = 0) : MultiDrawElementsIndirectUInt(GLenum mode = 0) :
DrawElementsIndirectUInt(mode),_count(0) { _primitiveType=(Type(MultiDrawElementsUIntIndirectPrimitiveType)); } DrawElementsIndirectUInt(mode),
_count(0)
{
_primitiveType=(Type(MultiDrawElementsUIntIndirectPrimitiveType));
}
MultiDrawElementsIndirectUInt(const MultiDrawElementsIndirectUInt& mdi,const CopyOp& copyop=CopyOp::SHALLOW_COPY) : MultiDrawElementsIndirectUInt(const MultiDrawElementsIndirectUInt& mdi,const CopyOp& copyop=CopyOp::SHALLOW_COPY) :
DrawElementsIndirectUInt(mdi,copyop),_count(mdi._count) {} DrawElementsIndirectUInt(mdi,copyop),
_count(mdi._count)
{}
/** /**
* \param mode One of osg::PrimitiveSet::Mode. Determines the type of primitives used. * \param mode One of osg::PrimitiveSet::Mode. Determines the type of primitives used.
* \param no Number of intended elements. This will be the size of the underlying vector. * \param no Number of intended elements. This will be the size of the underlying vector.
* \param ptr Pointer to a GLunsigned int to copy index data from. * \param ptr Pointer to a GLunsigned int to copy index data from.
*/ */
MultiDrawElementsIndirectUInt(GLenum mode, unsigned int no, const GLuint* ptr) : MultiDrawElementsIndirectUInt(GLenum mode, unsigned int no, const GLuint* ptr) :
DrawElementsIndirectUInt(mode,no,ptr) DrawElementsIndirectUInt(mode,no,ptr),
{_primitiveType=(Type(MultiDrawElementsUIntIndirectPrimitiveType));} _count(0)
{
_primitiveType=(Type(MultiDrawElementsUIntIndirectPrimitiveType));
}
/** /**
* \param mode One of osg::PrimitiveSet::Mode. Determines the type of primitives used. * \param mode One of osg::PrimitiveSet::Mode. Determines the type of primitives used.
* \param no Number of intended elements. This will be the size of the underlying vector. * \param no Number of intended elements. This will be the size of the underlying vector.
*/ */
MultiDrawElementsIndirectUInt(GLenum mode, unsigned int no) : MultiDrawElementsIndirectUInt(GLenum mode, unsigned int no) :
DrawElementsIndirectUInt(mode,no) DrawElementsIndirectUInt(mode,no),
{_primitiveType=(Type(MultiDrawElementsUIntIndirectPrimitiveType));} _count(0)
{
_primitiveType=(Type(MultiDrawElementsUIntIndirectPrimitiveType));
}
template <class InputIterator> template <class InputIterator>
MultiDrawElementsIndirectUInt(GLenum mode, InputIterator first,InputIterator last) : MultiDrawElementsIndirectUInt(GLenum mode, InputIterator first,InputIterator last) :
DrawElementsIndirectUInt(mode,first,last) DrawElementsIndirectUInt(mode,first,last),
{_primitiveType=(Type(MultiDrawElementsUIntIndirectPrimitiveType));} _count(0)
{
_primitiveType=(Type(MultiDrawElementsUIntIndirectPrimitiveType));
}
virtual osg::Object* cloneType() const { return new MultiDrawElementsIndirectUInt(); } virtual osg::Object* cloneType() const { return new MultiDrawElementsIndirectUInt(); }
virtual osg::Object* clone(const osg::CopyOp& copyop) const { return new MultiDrawElementsIndirectUInt(*this,copyop); } virtual osg::Object* clone(const osg::CopyOp& copyop) const { return new MultiDrawElementsIndirectUInt(*this,copyop); }
@ -572,13 +623,19 @@ public:
DrawArraysIndirect(GLenum mode=0, unsigned int firstcommand = 0, GLsizei stride = 0) : DrawArraysIndirect(GLenum mode=0, unsigned int firstcommand = 0, GLsizei stride = 0) :
osg::PrimitiveSet(Type(DrawArraysIndirectPrimitiveType), mode), osg::PrimitiveSet(Type(DrawArraysIndirectPrimitiveType), mode),
_firstCommand(firstcommand), _stride(stride) { setIndirectCommandArray(new DefaultIndirectCommandDrawArrays); } _firstCommand(firstcommand),
_stride(stride)
{
setIndirectCommandArray(new DefaultIndirectCommandDrawArrays);
}
DrawArraysIndirect(const DrawArraysIndirect& dal,const CopyOp& copyop=CopyOp::SHALLOW_COPY) : DrawArraysIndirect(const DrawArraysIndirect& dal,const CopyOp& copyop=CopyOp::SHALLOW_COPY) :
osg::PrimitiveSet(dal,copyop), osg::PrimitiveSet(dal,copyop),
_firstCommand(dal._firstCommand), _firstCommand(dal._firstCommand),
_stride(dal._stride), _stride(dal._stride),
_indirectCommandArray((DefaultIndirectCommandDrawArrays*)copyop( dal._indirectCommandArray.get())) {} _indirectCommandArray((DefaultIndirectCommandDrawArrays*)copyop( dal._indirectCommandArray.get()))
{
}
virtual osg::Object* cloneType() const { return new DrawArraysIndirect(); } virtual osg::Object* cloneType() const { return new DrawArraysIndirect(); }
virtual osg::Object* clone(const osg::CopyOp& copyop) const { return new DrawArraysIndirect(*this,copyop); } virtual osg::Object* clone(const osg::CopyOp& copyop) const { return new DrawArraysIndirect(*this,copyop); }
@ -635,10 +692,16 @@ class OSG_EXPORT MultiDrawArraysIndirect : public DrawArraysIndirect
public: public:
MultiDrawArraysIndirect(GLenum mode=0, unsigned int firstcommand = 0, unsigned int count = 0, GLsizei stride = 0) : MultiDrawArraysIndirect(GLenum mode=0, unsigned int firstcommand = 0, unsigned int count = 0, GLsizei stride = 0) :
osg::DrawArraysIndirect(mode, firstcommand, stride), _count(count) { _primitiveType=Type(MultiDrawArraysIndirectPrimitiveType); } osg::DrawArraysIndirect(mode, firstcommand, stride),
_count(count)
{
_primitiveType=Type(MultiDrawArraysIndirectPrimitiveType);
}
MultiDrawArraysIndirect(const MultiDrawArraysIndirect& dal,const CopyOp& copyop=CopyOp::SHALLOW_COPY) : MultiDrawArraysIndirect(const MultiDrawArraysIndirect& dal,const CopyOp& copyop=CopyOp::SHALLOW_COPY) :
osg::DrawArraysIndirect(dal,copyop), _count(dal._count) {} osg::DrawArraysIndirect(dal,copyop),
_count(dal._count)
{}
virtual osg::Object* cloneType() const { return new MultiDrawArraysIndirect(); } virtual osg::Object* cloneType() const { return new MultiDrawArraysIndirect(); }
virtual osg::Object* clone(const osg::CopyOp& copyop) const { return new MultiDrawArraysIndirect(*this,copyop); } virtual osg::Object* clone(const osg::CopyOp& copyop) const { return new MultiDrawArraysIndirect(*this,copyop); }