fix some errors during renaming and cleanup code

This commit is contained in:
mp3butcher
2017-07-27 01:08:37 +02:00
parent b26fa74e7e
commit 8742ad8da6
2 changed files with 187 additions and 159 deletions

View File

@@ -141,17 +141,19 @@ public:
DrawElementsIndirect(const DrawElementsIndirect& rhs,const CopyOp& copyop=CopyOp::SHALLOW_COPY):
DrawElements(rhs,copyop),_firstCommand(rhs._firstCommand), _stride(rhs._stride) {
_IndirectCommandDrawArrays=(DefaultIndirectCommandDrawElements*)copyop(rhs._IndirectCommandDrawArrays.get());
_indirectCommandArray=(DefaultIndirectCommandDrawElements*)copyop(rhs._indirectCommandArray.get());
}
/// set command array of this indirect primitive set
inline void setIndirectCommandArray(IndirectCommandDrawElements*idc) {
_IndirectCommandDrawArrays = idc;
if(!_IndirectCommandDrawArrays->getBufferObject())
_IndirectCommandDrawArrays->setBufferObject(new osg::VertexBufferObject());
_indirectCommandArray = idc;
if(!_indirectCommandArray->getBufferObject())
_indirectCommandArray->setBufferObject(new osg::VertexBufferObject());
}
/// get command array of this indirect primitive set
inline IndirectCommandDrawElements* getIndirectCommandArray() { return _IndirectCommandDrawArrays; }
inline const IndirectCommandDrawElements* getIndirectCommandArray() const { return _IndirectCommandDrawArrays; }
inline IndirectCommandDrawElements* getIndirectCommandArray() { return _indirectCommandArray; }
inline const IndirectCommandDrawElements* getIndirectCommandArray() const { return _indirectCommandArray; }
///Further methods are for advanced DI when you plan to use your own IndirectCommandElement (stride)
///or if you want to draw a particular command index of the IndirectCommandElement(FirstCommandToDraw)
@@ -159,6 +161,7 @@ public:
inline void setFirstCommandToDraw( unsigned int i) { _firstCommand = i; }
/// get offset of the first command in the IndirectCommandDrawArrays
inline unsigned int getFirstCommandToDraw() const { return _firstCommand; }
/// stride (to set if you use custom CommandArray)
inline void setStride( GLsizei i) {
_stride=i;
@@ -174,7 +177,7 @@ protected:
unsigned int _firstCommand;
GLsizei _stride;
ref_ptr<IndirectCommandDrawElements> _IndirectCommandDrawArrays;
ref_ptr<IndirectCommandDrawElements> _indirectCommandArray;
};
///////////////////////////////////////////////////////////////////////////////////////
@@ -603,7 +606,7 @@ public:
osg::PrimitiveSet(dal,copyop),
_firstCommand(dal._firstCommand),
_stride(dal._stride),
_IndirectCommandDrawArrays((DefaultIndirectCommandDrawArrays*)copyop( dal._IndirectCommandDrawArrays.get()))
_indirectCommandArray((DefaultIndirectCommandDrawArrays*)copyop( dal._indirectCommandArray.get()))
{}
virtual osg::Object* cloneType() const {
@@ -651,22 +654,22 @@ public:
}
inline void setIndirectCommandArray(IndirectCommandDrawArrays*idc) {
_IndirectCommandDrawArrays = idc;
if(!_IndirectCommandDrawArrays->getBufferObject())
_IndirectCommandDrawArrays->setBufferObject(new osg::VertexBufferObject());
_indirectCommandArray = idc;
if(!_indirectCommandArray->getBufferObject())
_indirectCommandArray->setBufferObject(new osg::VertexBufferObject());
}
inline const IndirectCommandDrawArrays* getIndirectCommandArray() const {
return _IndirectCommandDrawArrays;
return _indirectCommandArray;
}
inline IndirectCommandDrawArrays* getIndirectCommandArray(){
return _IndirectCommandDrawArrays;
return _indirectCommandArray;
}
protected:
unsigned int _firstCommand;
GLsizei _stride;
ref_ptr<IndirectCommandDrawArrays> _IndirectCommandDrawArrays;
ref_ptr<IndirectCommandDrawArrays> _indirectCommandArray;
};