From fe1536ebd6910398d01364f86f6aad8e9609f367 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Mon, 24 Oct 2005 13:46:31 +0000 Subject: [PATCH] Fixed compile warnings. --- .../osgdepthpartition/DepthPartitionNode.cpp | 3 ++- .../osgdepthpartition/DistanceAccumulator.cpp | 2 +- examples/osgpbuffer/osgpbuffer.cpp | 2 +- examples/osgpoints/osgpoints.cpp | 21 +++++++++++-------- .../osgshaderterrain/osgshaderterrain.cpp | 2 +- examples/osgvolume/osgvolume.cpp | 8 +++---- src/osgDB/FileUtils.cpp | 3 +-- src/osgParticle/ConnectedParticleSystem.cpp | 4 ++-- src/osgPlugins/jpeg/ReaderWriterJPEG.cpp | 2 +- 9 files changed, 25 insertions(+), 22 deletions(-) diff --git a/examples/osgdepthpartition/DepthPartitionNode.cpp b/examples/osgdepthpartition/DepthPartitionNode.cpp index 460d06d08..a0136d56c 100644 --- a/examples/osgdepthpartition/DepthPartitionNode.cpp +++ b/examples/osgdepthpartition/DepthPartitionNode.cpp @@ -10,7 +10,8 @@ CURRENT_CLASS::CURRENT_CLASS() } CURRENT_CLASS::CURRENT_CLASS(const CURRENT_CLASS& dpn, const osg::CopyOp& copyop) - : _active(dpn._active), + : osg::Group(dpn,copyop), + _active(dpn._active), _renderOrder(dpn._renderOrder), _clearColorBuffer(dpn._clearColorBuffer) { diff --git a/examples/osgdepthpartition/DistanceAccumulator.cpp b/examples/osgdepthpartition/DistanceAccumulator.cpp index fdc00a3fd..ac9387158 100644 --- a/examples/osgdepthpartition/DistanceAccumulator.cpp +++ b/examples/osgdepthpartition/DistanceAccumulator.cpp @@ -53,7 +53,7 @@ void CURRENT_CLASS::pushLocalFrustum() _bbCorners.push_back(corner); } -void CURRENT_CLASS::apply(osg::CameraNode &camera) +void CURRENT_CLASS::apply(osg::CameraNode& /*camera*/) { // We don't support scenes with CameraNodes in them return; diff --git a/examples/osgpbuffer/osgpbuffer.cpp b/examples/osgpbuffer/osgpbuffer.cpp index ee2e8a4fe..66a52e950 100644 --- a/examples/osgpbuffer/osgpbuffer.cpp +++ b/examples/osgpbuffer/osgpbuffer.cpp @@ -443,7 +443,7 @@ int main( int argc, char **argv ) } } - printf( "PBuffer window: 0x%x\n", pbuffer->getWindow() ); + // printf( "PBuffer window: 0x%x\n", pbuffer->getWindow() ); viewer.getCamera(0)->setClearColor( 0.1f,0.9f,0.3f,1.0f ); diff --git a/examples/osgpoints/osgpoints.cpp b/examples/osgpoints/osgpoints.cpp index 151518d9d..040cdba51 100644 --- a/examples/osgpoints/osgpoints.cpp +++ b/examples/osgpoints/osgpoints.cpp @@ -213,6 +213,15 @@ int main( int argc, char **argv ) " gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;\n" "}\n"; + + + osg::Program* program = new osg::Program; + stateset->setAttribute(program); + + osg::Shader* vertex_shader = new osg::Shader(osg::Shader::VERTEX, vertexShaderSource); + program->addShader(vertex_shader); + +#if 0 ////////////////////////////////////////////////////////////////// // fragment shader // @@ -222,15 +231,9 @@ int main( int argc, char **argv ) " gl_FragColor = gl_Color; \n" "}\n"; - - osg::Program* program = new osg::Program; - stateset->setAttribute(program); - - osg::Shader* vertex_shader = new osg::Shader(osg::Shader::VERTEX, vertexShaderSource); - program->addShader(vertex_shader); - - //osg::Shader* fragment_shader = new osg::Shader(osg::Shader::FRAGMENT, fragmentShaderSource); - //program->addShader(fragment_shader); + osg::Shader* fragment_shader = new osg::Shader(osg::Shader::FRAGMENT, fragmentShaderSource); + program->addShader(fragment_shader); +#endif } diff --git a/examples/osgshaderterrain/osgshaderterrain.cpp b/examples/osgshaderterrain/osgshaderterrain.cpp index e3394a75d..f4c383812 100644 --- a/examples/osgshaderterrain/osgshaderterrain.cpp +++ b/examples/osgshaderterrain/osgshaderterrain.cpp @@ -462,7 +462,7 @@ osg::Node* ForestTechniqueManager::createShaderGraph(Cell* cell,osg::StateSet* s else return geode; } -osg::Node* ForestTechniqueManager::createScene(unsigned int numTreesToCreates) +osg::Node* ForestTechniqueManager::createScene(unsigned int /*numTreesToCreates*/) { osg::Group* scene = new osg::Group; diff --git a/examples/osgvolume/osgvolume.cpp b/examples/osgvolume/osgvolume.cpp index 9b12b9099..9de92d1d4 100644 --- a/examples/osgvolume/osgvolume.cpp +++ b/examples/osgvolume/osgvolume.cpp @@ -724,11 +724,11 @@ class FollowMouseCallback : public osgGA::GUIEventHandler, public osg::StateSet: }; -osg::Node* createShaderModel(osg::ref_ptr& image_3d, osg::ref_ptr& normalmap_3d, +osg::Node* createShaderModel(osg::ref_ptr& image_3d, osg::ref_ptr& /*normalmap_3d*/, osg::Texture::InternalFormatMode internalFormatMode, - float xSize, float ySize, float zSize, - float xMultiplier, float yMultiplier, float zMultiplier, - unsigned int numSlices=500, float sliceEnd=1.0f, float alphaFuncValue=0.02f) + float /*xSize*/, float /*ySize*/, float /*zSize*/, + float /*xMultiplier*/, float /*yMultiplier*/, float /*zMultiplier*/, + unsigned int /*numSlices*/=500, float /*sliceEnd*/=1.0f, float alphaFuncValue=0.02f) { osg::Geode* geode = new osg::Geode; osg::StateSet* stateset = geode->getOrCreateStateSet(); diff --git a/src/osgDB/FileUtils.cpp b/src/osgDB/FileUtils.cpp index 38f8015f7..375c301a3 100644 --- a/src/osgDB/FileUtils.cpp +++ b/src/osgDB/FileUtils.cpp @@ -801,9 +801,8 @@ std::string osgDB::findFileInDirectory(const std::string& fileName,const std::st } } #else - void osgDB::appendPlatformSpecificResourceFilePaths(FilePathList& filepath) + void osgDB::appendPlatformSpecificResourceFilePaths(FilePathList& /*filepath*/) { - } #endif diff --git a/src/osgParticle/ConnectedParticleSystem.cpp b/src/osgParticle/ConnectedParticleSystem.cpp index 94c3f98f7..5ed6177c3 100644 --- a/src/osgParticle/ConnectedParticleSystem.cpp +++ b/src/osgParticle/ConnectedParticleSystem.cpp @@ -117,8 +117,8 @@ void ConnectedParticleSystem::drawImplementation(osg::State& state) const osg::Vec4 pixelSizeVector = osg::CullingSet::computePixelSizeVector(*state.getCurrentViewport(),state.getProjectionMatrix(),state.getModelViewMatrix()); float unitPixelSize = fabs(1.0/(particle->getPosition()*pixelSizeVector)); float pixelSizeOfFirstParticle = unitPixelSize * particle->getCurrentSize(); - float desiredGapBetweenDrawnParticles = 50.0f/unitPixelSize; - float desiredGapBetweenDrawnParticles2 = desiredGapBetweenDrawnParticles*desiredGapBetweenDrawnParticles; + //float desiredGapBetweenDrawnParticles = 50.0f/unitPixelSize; + //float desiredGapBetweenDrawnParticles2 = desiredGapBetweenDrawnParticles*desiredGapBetweenDrawnParticles; unsigned int maxNumParticlesToSkip = 200; float maxPixelError2 = osg::square(1.0f/unitPixelSize); diff --git a/src/osgPlugins/jpeg/ReaderWriterJPEG.cpp b/src/osgPlugins/jpeg/ReaderWriterJPEG.cpp index 1f4be0559..cbce21000 100644 --- a/src/osgPlugins/jpeg/ReaderWriterJPEG.cpp +++ b/src/osgPlugins/jpeg/ReaderWriterJPEG.cpp @@ -208,7 +208,7 @@ void skip_input_data (j_decompress_ptr cinfo, long num_bytes) * application must deal with any cleanup that should happen even * for error exit. */ -void term_source (j_decompress_ptr cinfo) +void term_source (j_decompress_ptr /*cinfo*/) { /* no work necessary here */ }