From 80e318ce15397150bbef4bc695d91e53116bc8b9 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 26 May 2016 10:35:33 +0100 Subject: [PATCH] Fixed shadows warnigns --- examples/osgdepthpeeling/DePee.cpp | 6 +++--- examples/osgdistortion/osgdistortion.cpp | 14 ++++++-------- examples/osgforest/osgforest.cpp | 4 ++-- examples/osghangglide/hat.cpp | 6 +++--- 4 files changed, 14 insertions(+), 16 deletions(-) diff --git a/examples/osgdepthpeeling/DePee.cpp b/examples/osgdepthpeeling/DePee.cpp index 4b352d4ea..6121ed6a6 100644 --- a/examples/osgdepthpeeling/DePee.cpp +++ b/examples/osgdepthpeeling/DePee.cpp @@ -326,10 +326,10 @@ bool DePee::createHUD() geom->addPrimitiveSet(new osg::DrawArrays(GL_QUADS,0,4)); - osg::StateSet* stateset = geom->getOrCreateStateSet(); - stateset->setMode(GL_BLEND,osg::StateAttribute::ON); + osg::StateSet* ss = geom->getOrCreateStateSet(); + ss->setMode(GL_BLEND,osg::StateAttribute::ON); - stateset->setRenderingHint(osg::StateSet::TRANSPARENT_BIN); + ss->setRenderingHint(osg::StateSet::TRANSPARENT_BIN); //geode->addDrawable(geom); } diff --git a/examples/osgdistortion/osgdistortion.cpp b/examples/osgdistortion/osgdistortion.cpp index 40da27ed0..7af13d564 100644 --- a/examples/osgdistortion/osgdistortion.cpp +++ b/examples/osgdistortion/osgdistortion.cpp @@ -79,9 +79,7 @@ struct CommandLineOptions return; } - unsigned int width, height; wsi->getScreenResolution(osg::GraphicsContext::ScreenIdentifier(0), width, height); - distance = sqrt(sphere_radius*sphere_radius - collar_radius*collar_radius); } @@ -558,9 +556,9 @@ void setDomeCorrection(osgViewer::Viewer& viewer, CommandLineOptions& options) camera->setName("Top face camera"); camera->setGraphicsContext(gc.get()); camera->setViewport(new osg::Viewport(0,0,camera_width, camera_height)); - GLenum buffer = traits->doubleBuffer ? GL_BACK : GL_FRONT; - camera->setDrawBuffer(buffer); - camera->setReadBuffer(buffer); + GLenum cbuffer = traits->doubleBuffer ? GL_BACK : GL_FRONT; + camera->setDrawBuffer(cbuffer); + camera->setReadBuffer(cbuffer); camera->setAllowEventFocus(false); // tell the camera to use OpenGL frame buffer object where supported. @@ -668,9 +666,9 @@ void setDomeCorrection(osgViewer::Viewer& viewer, CommandLineOptions& options) camera->setClearMask(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT ); camera->setClearColor( osg::Vec4(0.1,0.1,1.0,1.0) ); camera->setViewport(new osg::Viewport(0, 0, options.width, options.height)); - GLenum buffer = traits->doubleBuffer ? GL_BACK : GL_FRONT; - camera->setDrawBuffer(buffer); - camera->setReadBuffer(buffer); + GLenum cbuffer = traits->doubleBuffer ? GL_BACK : GL_FRONT; + camera->setDrawBuffer(cbuffer); + camera->setReadBuffer(cbuffer); camera->setReferenceFrame(osg::Camera::ABSOLUTE_RF); camera->setAllowEventFocus(false); //camera->setInheritanceMask(camera->getInheritanceMask() & ~osg::CullSettings::CLEAR_COLOR & ~osg::CullSettings::COMPUTE_NEAR_FAR_MODE); diff --git a/examples/osgforest/osgforest.cpp b/examples/osgforest/osgforest.cpp index 5acada741..5d8433141 100644 --- a/examples/osgforest/osgforest.cpp +++ b/examples/osgforest/osgforest.cpp @@ -794,8 +794,8 @@ class ShaderGeometry : public osg::Drawable ShaderGeometry() { setUseDisplayList(false); } /** Copy constructor using CopyOp to manage deep vs shallow copy.*/ - ShaderGeometry(const ShaderGeometry& ShaderGeometry,const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY): - osg::Drawable(ShaderGeometry,copyop) {} + ShaderGeometry(const ShaderGeometry& sg,const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY): + osg::Drawable(sg,copyop) {} META_Object(osg,ShaderGeometry) diff --git a/examples/osghangglide/hat.cpp b/examples/osghangglide/hat.cpp index 4ef9e7942..3f4f49e3e 100644 --- a/examples/osghangglide/hat.cpp +++ b/examples/osghangglide/hat.cpp @@ -33,7 +33,7 @@ static int inited = 0; static float dbcenter[3]; static float dbradius; -static void getDatabaseCenterRadius( float dbcenter[3], float *dbradius ) +static void computeDatabaseCenterRadius() { int i; double n=0.0; @@ -68,7 +68,7 @@ static void getDatabaseCenterRadius( float dbcenter[3], float *dbradius ) } - *dbradius = r; + dbradius = r; dbcenter[0] = (float)center[0]; dbcenter[1] = (float)center[1]; dbcenter[2] = (float)center[2]; @@ -82,7 +82,7 @@ static void getDatabaseCenterRadius( float dbcenter[3], float *dbradius ) static void init( void ) { - getDatabaseCenterRadius( dbcenter, &dbradius ); + computeDatabaseCenterRadius(); inited = 1; }