Fixed unused parameter warning.

This commit is contained in:
Robert Osfield
2016-06-08 11:18:20 +01:00
parent 54aa65f496
commit 772368ed1f
4 changed files with 43 additions and 43 deletions

View File

@@ -1,14 +1,14 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2014 Robert Osfield
* Copyright (C) 2014 Pawel Ksiezopolski
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*
*/
@@ -25,14 +25,14 @@
// with data matching users needs
struct ConvertTrianglesOperator : public osg::Referenced
{
ConvertTrianglesOperator()
ConvertTrianglesOperator()
: osg::Referenced()
{
}
virtual void initGeometry( osg::Geometry* outputGeometry ) = 0;
virtual bool pushNode( osg::Node* node )
{
return false;
virtual bool pushNode( osg::Node* /*node*/ )
{
return false;
}
virtual void popNode() = 0;
virtual void setGeometryData( const osg::Matrix &matrix, osg::Geometry *inputGeometry, osg::Geometry* outputGeometry, float typeID, float lodNumber ) = 0;
@@ -47,7 +47,7 @@ public:
}
void apply( GLfloat& value )
{
out = osg::Vec2( value, 0.0 );
out = osg::Vec2( value, 0.0 );
}
void apply( osg::Vec2& value )
{
@@ -83,7 +83,7 @@ public:
// texCoord1 holds additional information about vertex ( typeID, lodNumber, boneIndex )
struct ConvertTrianglesOperatorClassic : public ConvertTrianglesOperator
{
ConvertTrianglesOperatorClassic()
ConvertTrianglesOperatorClassic()
: ConvertTrianglesOperator(), _typeID(0.0f), _lodNumber(0.0f)
{
@@ -113,18 +113,18 @@ struct ConvertTrianglesOperatorClassic : public ConvertTrianglesOperator
virtual void setGeometryData( const osg::Matrix &matrix, osg::Geometry *inputGeometry, osg::Geometry* outputGeometry, float typeID, float lodNumber )
{
_matrix = matrix;
_inputVertices = dynamic_cast<osg::Vec3Array *>( inputGeometry->getVertexArray() );
_inputColors = dynamic_cast<osg::Vec4Array *>( inputGeometry->getColorArray() );
_inputNormals = dynamic_cast<osg::Vec3Array *>( inputGeometry->getNormalArray() );
_inputTexCoord0 = inputGeometry->getTexCoordArray(0);
_outputVertices = dynamic_cast<osg::Vec3Array *>( outputGeometry->getVertexArray() );
_outputColors = dynamic_cast<osg::Vec4Array *>( outputGeometry->getColorArray() );
_outputNormals = dynamic_cast<osg::Vec3Array *>( outputGeometry->getNormalArray() );
_outputTexCoord0 = dynamic_cast<osg::Vec2Array *>( outputGeometry->getTexCoordArray(0) );
_outputTexCoord1 = dynamic_cast<osg::Vec3Array *>( outputGeometry->getTexCoordArray(1) );
_typeID = typeID;
_lodNumber = lodNumber;
}
@@ -147,7 +147,7 @@ struct ConvertTrianglesOperatorClassic : public ConvertTrianglesOperator
_outputVertices->push_back( _inputVertices->at( i1 ) * _matrix );
_outputVertices->push_back( _inputVertices->at( i2 ) * _matrix );
_outputVertices->push_back( _inputVertices->at( i3 ) * _matrix );
if( _inputColors != NULL )
{
_outputColors->push_back( _inputColors->at( ic1 ) );
@@ -159,7 +159,7 @@ struct ConvertTrianglesOperatorClassic : public ConvertTrianglesOperator
for(unsigned int i=0; i<3; ++i)
_outputColors->push_back( osg::Vec4(1.0,1.0,1.0,1.0) );
}
if( _inputNormals != NULL )
{
_outputNormals->push_back( osg::Matrix::transform3x3( _inputNormals->at( in1 ), _matrix ) );
@@ -185,7 +185,7 @@ struct ConvertTrianglesOperatorClassic : public ConvertTrianglesOperator
for(unsigned int i=0; i<3; ++i)
_outputTexCoord0->push_back( osg::Vec2(0.0,0.0) );
}
for(unsigned int i=0; i<3; ++i)
_outputTexCoord1->push_back( osg::Vec3( _typeID, _lodNumber, _boneIndices.back() ) );
}
@@ -195,24 +195,24 @@ struct ConvertTrianglesOperatorClassic : public ConvertTrianglesOperator
}
osg::Matrix _matrix;
osg::Vec3Array* _inputVertices;
osg::Vec4Array* _inputColors;
osg::Vec3Array* _inputNormals;
osg::Array* _inputTexCoord0;
osg::Vec3Array* _outputVertices;
osg::Vec4Array* _outputColors;
osg::Vec3Array* _outputNormals;
osg::Vec2Array* _outputTexCoord0;
osg::Vec3Array* _outputTexCoord1;
float _typeID;
float _lodNumber;
std::vector<float> _boneIndices;
std::map<std::string,float> _boneNames;
GetVec2FromArrayVisitor _inputTexCoord0Visitor;
};
@@ -220,10 +220,10 @@ struct ConvertTrianglesOperatorClassic : public ConvertTrianglesOperator
class AggregateGeometryVisitor : public osg::NodeVisitor
{
public:
public:
AggregateGeometryVisitor( ConvertTrianglesOperator* ctOperator );
void init();
// osg::TriangleIndexFunctor uses its template parameter as a base class, so we must use an adapter pattern to hack it
struct ConvertTrianglesBridge
{
@@ -251,10 +251,10 @@ public:
{
_converter->operator()(i1,i2,i3);
}
osg::ref_ptr<ConvertTrianglesOperator> _converter;
};
// struct returning information about added object ( first vertex, vertex count, primitiveset index )
// used later to create indirect command texture buffers
@@ -269,11 +269,11 @@ public:
unsigned int index;
};
AddObjectResult addObject( osg::Node* object, unsigned int typeID, unsigned int lodNumber );
void apply( osg::Node& node );
void apply( osg::Transform& transform );
void apply( osg::Geode& geode );
inline osg::Geometry* getAggregatedGeometry()
{
return _aggregatedGeometry.get();
@@ -282,7 +282,7 @@ protected:
osg::ref_ptr<osg::Geometry> _aggregatedGeometry;
osg::TriangleIndexFunctor<ConvertTrianglesBridge> _ctOperator;
std::vector<osg::Matrix> _matrixStack;
unsigned int _currentTypeID;
unsigned int _currentLodNumber;
};

View File

@@ -1,14 +1,14 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2014 Robert Osfield
* Copyright (C) 2014 Pawel Ksiezopolski
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*
*/
@@ -19,32 +19,32 @@
#include <osg/GLExtensions>
#include <osg/Drawable>
void DrawArraysIndirect::draw(osg::State& state, bool useVertexBufferObjects) const
void DrawArraysIndirect::draw(osg::State& state, bool /*useVertexBufferObjects*/) const
{
if( !_buffer.valid() )
return;
_buffer->bindBufferAs( state.getContextID(), GL_DRAW_INDIRECT_BUFFER );
// if you want to see how many primitives were rendered - uncomment code below, but
// if you want to see how many primitives were rendered - uncomment code below, but
// be warned : it is a serious performance killer ( because of GPU->CPU roundtrip )
// osg::Drawable::Extensions *dext = osg::Drawable::getExtensions( state.getContextID(),true );
// int* tab = (int*)dext->glMapBuffer(GL_DRAW_INDIRECT_BUFFER,GL_READ_ONLY);
// int val = _indirect/sizeof(int);
// OSG_WARN<<"DrawArraysIndirect ("<<val<<"): "<< tab[val] << " " << tab[val+1] << " " << tab[val+2] << " " << tab[val+3] << std::endl;
// dext->glUnmapBuffer(GL_DRAW_INDIRECT_BUFFER);
DrawIndirectGLExtensions *ext = DrawIndirectGLExtensions::getExtensions( state.getContextID(),true );
ext->glDrawArraysIndirect( _mode, reinterpret_cast<const void*>(_indirect) );
_buffer->unbindBufferAs( state.getContextID(), GL_DRAW_INDIRECT_BUFFER );
}
void MultiDrawArraysIndirect::draw(osg::State& state, bool useVertexBufferObjects) const
void MultiDrawArraysIndirect::draw(osg::State& state, bool /*useVertexBufferObjects*/) const
{
if( !_buffer.valid() )
return;
_buffer->bindBufferAs( state.getContextID(), GL_DRAW_INDIRECT_BUFFER );
DrawIndirectGLExtensions *ext = DrawIndirectGLExtensions::getExtensions( state.getContextID(),true );
ext->glMultiDrawArraysIndirect( _mode, reinterpret_cast<const void*>(_indirect), _drawcount, _stride );
_buffer->unbindBufferAs( state.getContextID(), GL_DRAW_INDIRECT_BUFFER );
@@ -80,7 +80,7 @@ void DrawIndirectGLExtensions::lowestCommonDenominator( const DrawIndirectGLExte
}
}
void DrawIndirectGLExtensions::setupGLExtensions( unsigned int contextID )
void DrawIndirectGLExtensions::setupGLExtensions( unsigned int /*contextID*/ )
{
_glDrawArraysIndirect = 0;
_glMultiDrawArraysIndirect = 0;
@@ -110,7 +110,7 @@ void DrawIndirectGLExtensions::glMultiDrawArraysIndirect(GLenum mode, const void
else
{
OSG_WARN<<"Error: glMultiDrawArraysIndirect not supported by OpenGL driver"<<std::endl;
}
}
}
void DrawIndirectGLExtensions::glMemoryBarrier(GLbitfield barriers)

View File

@@ -38,7 +38,7 @@ public:
{
}
virtual osg::Object* cloneType() const { return new DrawArraysIndirect(); }
virtual osg::Object* clone(const osg::CopyOp& copyop) const { return NULL; }
virtual osg::Object* clone(const osg::CopyOp& /*copyop*/) const { return NULL; }
virtual bool isSameKindAs(const osg::Object* obj) const { return dynamic_cast<const DrawArraysIndirect*>(obj)!=NULL; }
virtual const char* libraryName() const { return "osg"; }
virtual const char* className() const { return "DrawArraysIndirect"; }
@@ -57,7 +57,7 @@ public:
{
}
virtual osg::Object* cloneType() const { return new MultiDrawArraysIndirect(); }
virtual osg::Object* clone(const osg::CopyOp& copyop) const { return NULL; }
virtual osg::Object* clone(const osg::CopyOp& /*copyop*/) const { return NULL; }
virtual bool isSameKindAs(const osg::Object* obj) const { return dynamic_cast<const MultiDrawArraysIndirect*>(obj)!=NULL; }
virtual const char* libraryName() const { return "osg"; }
virtual const char* className() const { return "MultiDrawArraysIndirect"; }

View File

@@ -692,7 +692,7 @@ struct ResetTexturesCallback : public osg::StateSet::Callback
texUnitsDirtyParams.push_back(texUnit);
}
virtual void operator() (osg::StateSet* stateset, osg::NodeVisitor* nv)
virtual void operator() (osg::StateSet* stateset, osg::NodeVisitor* /*nv*/)
{
std::vector<unsigned int>::iterator it,eit;
for(it=texUnitsDirty.begin(), eit=texUnitsDirty.end(); it!=eit; ++it)