From b28612bce21f293c9a92761eb0f62bf4c910a523 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Mon, 27 Oct 2008 13:09:43 +0000 Subject: [PATCH] Various warning fixes --- include/osg/FrameBufferObject | 1 - include/osg/Texture2DArray | 2 +- include/osgShadow/ParallelSplitShadowMap | 8 +-- .../osgShadow/ViewDependentShadowTechnique | 9 ++-- src/osg/ApplicationUsage.cpp | 2 + src/osg/FrameBufferObject.cpp | 9 ++-- src/osg/ImageSequence.cpp | 24 ++++----- src/osg/KdTree.cpp | 6 +-- src/osg/ShapeDrawable.cpp | 10 ---- src/osg/Texture.cpp | 10 ++-- src/osg/Texture2DArray.cpp | 6 ++- src/osg/Texture3D.cpp | 1 - src/osgDB/DatabasePager.cpp | 13 ++--- src/osgShadow/MinimalShadowMap.cpp | 2 +- src/osgShadow/ParallelSplitShadowMap.cpp | 43 ++++++++-------- src/osgShadow/ShadowMap.cpp | 10 ++-- src/osgShadow/StandardShadowMap.cpp | 2 +- src/osgUtil/RenderStage.cpp | 4 +- src/osgUtil/SceneGraphBuilder.cpp | 4 +- src/osgUtil/SceneView.cpp | 4 -- src/osgUtil/Tessellator.cpp | 50 ------------------- 21 files changed, 77 insertions(+), 143 deletions(-) diff --git a/include/osg/FrameBufferObject b/include/osg/FrameBufferObject index dc5e66d55..8691a7a0d 100644 --- a/include/osg/FrameBufferObject +++ b/include/osg/FrameBufferObject @@ -169,7 +169,6 @@ namespace osg protected: FBOExtensions(unsigned int contextID); - private: bool _supported; }; diff --git a/include/osg/Texture2DArray b/include/osg/Texture2DArray index 4feb52360..7400c024d 100644 --- a/include/osg/Texture2DArray +++ b/include/osg/Texture2DArray @@ -206,7 +206,7 @@ class OSG_EXPORT Texture2DArray : public Texture virtual void computeInternalFormat() const; void allocateMipmap(State& state) const; - void applyTexImage2DArray_subload(State& state, Image* image, GLsizei inwidth, GLsizei inheight, GLsizei indepth, GLenum inInternalFormat, GLsizei& numMipmapLevels) const; + void applyTexImage2DArray_subload(State& state, Image* image, GLsizei inwidth, GLsizei inheight, GLsizei indepth, GLint inInternalFormat, GLsizei& numMipmapLevels) const; /** * Use std::vector to encapsulate referenced pointers to images of different layers. diff --git a/include/osgShadow/ParallelSplitShadowMap b/include/osgShadow/ParallelSplitShadowMap index a079ce118..9a5d95226 100644 --- a/include/osgShadow/ParallelSplitShadowMap +++ b/include/osgShadow/ParallelSplitShadowMap @@ -184,11 +184,11 @@ class OSGSHADOW_EXPORT ParallelSplitShadowMap : public ShadowTechnique osg::ref_ptr _userLight; osg::ref_ptr _FragmentShaderGenerator; - bool _GLSL_shadow_filtered; - SplitCalcMode _SplitCalcMode; + bool _GLSL_shadow_filtered; + SplitCalcMode _SplitCalcMode; - osg::Uniform* _ambientBiasUniform; - osg::Vec2d _ambientBias; + osg::Uniform* _ambientBiasUniform; + osg::Vec2d _ambientBias; }; } diff --git a/include/osgShadow/ViewDependentShadowTechnique b/include/osgShadow/ViewDependentShadowTechnique index 55f53980c..d3890f6ed 100644 --- a/include/osgShadow/ViewDependentShadowTechnique +++ b/include/osgShadow/ViewDependentShadowTechnique @@ -179,6 +179,11 @@ class OSGSHADOW_EXPORT ViewDependentShadowTechnique */ OpenThreads::Mutex _mutex; + /** + Dirty flag tells this instance to update its resources + */ + bool _dirty; + /** View's CullVisitor associated with this ViewData instance */ @@ -189,10 +194,6 @@ class OSGSHADOW_EXPORT ViewDependentShadowTechnique */ osg::observer_ptr< ViewDependentShadowTechnique > _st; - /** - Dirty flag tells this instance to update its resources - */ - bool _dirty; }; /** diff --git a/src/osg/ApplicationUsage.cpp b/src/osg/ApplicationUsage.cpp index eb889cd81..0cb8e9664 100644 --- a/src/osg/ApplicationUsage.cpp +++ b/src/osg/ApplicationUsage.cpp @@ -44,6 +44,8 @@ void ApplicationUsage::addUsageExplanation(Type type,const std::string& option,c case(KEYBOARD_MOUSE_BINDING): addKeyboardMouseBinding(option,explanation); break; + default: + break; } } diff --git a/src/osg/FrameBufferObject.cpp b/src/osg/FrameBufferObject.cpp index d30a7e94a..c7766b843 100644 --- a/src/osg/FrameBufferObject.cpp +++ b/src/osg/FrameBufferObject.cpp @@ -41,8 +41,7 @@ FBOExtensions* FBOExtensions::instance(unsigned contextID, bool createIfNotInita #define LOAD_FBO_EXT(name) setGLExtensionFuncPtr(name, (#name)) FBOExtensions::FBOExtensions(unsigned int contextID) -: _supported(false), - glBindRenderbufferEXT(0), +: glBindRenderbufferEXT(0), glGenRenderbuffersEXT(0), glDeleteRenderbuffersEXT(0), glRenderbufferStorageEXT(0), @@ -58,7 +57,8 @@ FBOExtensions::FBOExtensions(unsigned int contextID) glFramebufferTextureLayerEXT(0), glFramebufferRenderbufferEXT(0), glGenerateMipmapEXT(0), - glBlitFramebufferEXT(0) + glBlitFramebufferEXT(0), + _supported(false) { if (!isGLExtensionSupported(contextID, "GL_EXT_framebuffer_object")) return; @@ -661,7 +661,6 @@ FrameBufferObject::~FrameBufferObject() void FrameBufferObject::setAttachment(BufferComponent attachment_point, const FrameBufferAttachment &attachment) { - GLenum gl_attachment = convertBufferComponentToGLenum(attachment_point); _attachments[attachment_point] = attachment; updateDrawBuffers(); @@ -687,8 +686,6 @@ void FrameBufferObject::updateDrawBuffers() // create textures and mipmaps before we bind the frame buffer object for (AttachmentMap::const_iterator i=_attachments.begin(); i!=_attachments.end(); ++i) { - const FrameBufferAttachment &fa = i->second; - // setup draw buffers based on the attachment definition if (i->first >= Camera::COLOR_BUFFER0 && i->first <= Camera::COLOR_BUFFER15) _drawBuffers.push_back(convertBufferComponentToGLenum(i->first)); diff --git a/src/osg/ImageSequence.cpp b/src/osg/ImageSequence.cpp index 6ef10da87..6f0601e09 100644 --- a/src/osg/ImageSequence.cpp +++ b/src/osg/ImageSequence.cpp @@ -211,7 +211,7 @@ int ImageSequence::imageIndex(double time) if (time<0.0) return 0; int index = int(time/_timePerImage); - if (index>=_images.size()) return _images.size()-1; + if (index>=int(_images.size())) return int(_images.size())-1; return index; } @@ -296,9 +296,9 @@ void ImageSequence::update(osg::NodeVisitor* nv) int index = int(time/_timePerImage); // osg::notify(osg::NOTICE)<<"time= "<bind(); diff --git a/src/osgDB/DatabasePager.cpp b/src/osgDB/DatabasePager.cpp index a3299b779..1382e0d48 100644 --- a/src/osgDB/DatabasePager.cpp +++ b/src/osgDB/DatabasePager.cpp @@ -1470,7 +1470,7 @@ public: } std::string _marker; - unsigned int _numPagedLODsMarked; + int _numPagedLODsMarked; }; void DatabasePager::removeExpiredSubgraphs(const osg::FrameStamp& frameStamp) @@ -1550,8 +1550,7 @@ void DatabasePager::capped_removeExpiredSubgraphs(const osg::FrameStamp& frameSt } } - unsigned int inactivePLOD = _inactivePagedLODList.size(); - unsigned int activePLOD = _activePagedLODList.size(); + int inactivePLOD = _inactivePagedLODList.size(); PagedLODList& pagedLODList = _inactivePagedLODList; @@ -1632,8 +1631,8 @@ void DatabasePager::capped_removeExpiredSubgraphs(const osg::FrameStamp& frameSt } - unsigned int numRemoved = 0; - unsigned int numToRemove = markerVistor._numPagedLODsMarked; + int numRemoved = 0; + int numToRemove = markerVistor._numPagedLODsMarked; // osg::notify(osg::NOTICE)<<"Children to remove "<getType()) - { - case(PrimitiveSet::DrawArrayLengthsPrimitiveType): - { - - const DrawArrayLengths* drawArrayLengths = static_cast(primitiveset); - for(DrawArrayLengths::const_iterator primItr=drawArrayLengths->begin(); - primItr!=drawArrayLengths->end(); - ++primItr) - { - if (primLength==0) totalNumberOfPrimitives += 1; - else totalNumberOfPrimitives += *primItr/primLength; // Dec 2003 - increment not set - } - break; - } - default: - { - if (primLength==0) totalNumberOfPrimitives += 1; - else totalNumberOfPrimitives += primitiveset->getNumIndices()/primLength; - } - } - } - - return totalNumberOfPrimitives; -} -// void Tessellator::collectTessellation(osg::Geometry &geom, unsigned int originalIndex) { osg::Vec3Array* vertices = dynamic_cast(geom.getVertexArray());