From 26d34ed6d68c891cd9ceb8731f8ef1ac7aa56f1f Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Fri, 26 Apr 2002 08:16:14 +0000 Subject: [PATCH] Qarning fixes, and updated the date in NEWS to reflect todays release of 0.8.45 --- NEWS | 2 +- include/osg/Drawable | 6 +++--- include/osg/Group | 6 +++--- include/osg/LOD | 2 +- include/osg/Node | 4 ++-- src/Demos/hangglide/hangglide.cpp | 4 ++-- src/osgPlugins/osg/Group.cpp | 2 +- src/osgPlugins/osg/LOD.cpp | 2 +- src/osgUtil/InsertImpostorsVisitor.cpp | 4 ++-- src/osgUtil/Optimizer.cpp | 15 +++++++-------- 10 files changed, 23 insertions(+), 24 deletions(-) diff --git a/NEWS b/NEWS index 23a533627..2d0e1b08d 100644 --- a/NEWS +++ b/NEWS @@ -3,7 +3,7 @@ OSG News (most significant items from ChangeLog) ================================================ -22nd April 2002 - osg-0.8.45.tar.gz +26th April 2002 - osg-0.8.45.tar.gz >>> Support added for Solaris, texture cube mapping & muliple projections. diff --git a/include/osg/Drawable b/include/osg/Drawable index 9cfe6e8c1..e4a61ecfc 100644 --- a/include/osg/Drawable +++ b/include/osg/Drawable @@ -78,18 +78,18 @@ class SG_EXPORT Drawable : public Object * @param i index of the parent to get. * @return the parent i. */ - inline Node* getParent(const int i) { return _parents[i]; } + inline Node* getParent(const unsigned int i) { return _parents[i]; } /** Get a single const parent of Drawable. * @param i index of the parent to get. * @return the parent i. */ - inline const Node* getParent(const int i) const { return _parents[i]; } + inline const Node* getParent(const unsigned int i) const { return _parents[i]; } /** * Get the number of parents of node. * @return the number of parents of this node. */ - inline const int getNumParents() const { return _parents.size(); } + inline const unsigned int getNumParents() const { return _parents.size(); } diff --git a/include/osg/Group b/include/osg/Group index a5fcda718..1cbb03c5a 100644 --- a/include/osg/Group +++ b/include/osg/Group @@ -57,13 +57,13 @@ class SG_EXPORT Group : public Node virtual bool replaceChild( Node *origChild, Node* newChild ); /** return the number of chilren nodes.*/ - inline const int getNumChildren() const { return _children.size(); } + inline const unsigned int getNumChildren() const { return _children.size(); } /** return child node at position i.*/ - inline Node *getChild( const int i ) { return _children[i].get(); } + inline Node *getChild( const unsigned int i ) { return _children[i].get(); } /** return child node at position i.*/ - inline const Node *getChild( const int i ) const { return _children[i].get(); } + inline const Node *getChild( const unsigned int i ) const { return _children[i].get(); } /** return true if node is contained within Group.*/ inline bool containsNode( const Node* node ) const diff --git a/include/osg/LOD b/include/osg/LOD index ea1feb5fd..68863899c 100644 --- a/include/osg/LOD +++ b/include/osg/LOD @@ -46,7 +46,7 @@ class SG_EXPORT LOD : public Group inline const float getRange(const unsigned int index) const { return _rangeList[index]; } /** returns the number of ranges currently set.*/ - inline const int getNumRanges() const { return _rangeList.size(); } + inline const unsigned int getNumRanges() const { return _rangeList.size(); } /** Sets the object-space point which defines the center of the osg::LOD. center is affected by any transforms in the hierarchy above the osg::LOD.*/ diff --git a/include/osg/Node b/include/osg/Node index 5a8986d1c..bda039fbd 100644 --- a/include/osg/Node +++ b/include/osg/Node @@ -83,13 +83,13 @@ class SG_EXPORT Node : public Object * prevent modification of the parent list.*/ inline ParentList getParents() { return _parents; } - inline Group* getParent(const int i) { return _parents[i]; } + inline Group* getParent(const unsigned int i) { return _parents[i]; } /** * Get a single const parent of node. * @param i index of the parent to get. * @return the parent i. */ - inline const Group* getParent(const int i) const { return _parents[i]; } + inline const Group* getParent(const unsigned int i) const { return _parents[i]; } /** * Get the number of parents of node. diff --git a/src/Demos/hangglide/hangglide.cpp b/src/Demos/hangglide/hangglide.cpp index 4f23f0485..7e19f8f36 100644 --- a/src/Demos/hangglide/hangglide.cpp +++ b/src/Demos/hangglide/hangglide.cpp @@ -28,7 +28,7 @@ extern osg::Node *makeClouds( void ); struct MoveEarthySkyWithEyePointCallback : public osg::Transform::ComputeTransformCallback { /** Get the transformation matrix which moves from local coords to world coords.*/ - virtual const bool computeLocalToWorldMatrix(osg::Matrix& matrix,const osg::Transform* transform, osg::NodeVisitor* nv) const + virtual const bool computeLocalToWorldMatrix(osg::Matrix& matrix,const osg::Transform*, osg::NodeVisitor* nv) const { osgUtil::CullVisitor* cv = dynamic_cast(nv); if (cv) @@ -40,7 +40,7 @@ struct MoveEarthySkyWithEyePointCallback : public osg::Transform::ComputeTransfo } /** Get the transformation matrix which moves from world coords to local coords.*/ - virtual const bool computeWorldToLocalMatrix(osg::Matrix& matrix,const osg::Transform* transform, osg::NodeVisitor* nv) const + virtual const bool computeWorldToLocalMatrix(osg::Matrix& matrix,const osg::Transform*, osg::NodeVisitor* nv) const { osgUtil::CullVisitor* cv = dynamic_cast(nv); if (cv) diff --git a/src/osgPlugins/osg/Group.cpp b/src/osgPlugins/osg/Group.cpp index 21111607e..17891e4b4 100644 --- a/src/osgPlugins/osg/Group.cpp +++ b/src/osgPlugins/osg/Group.cpp @@ -52,7 +52,7 @@ bool Group_writeLocalData(const Object& obj, Output& fw) const Group& group = static_cast(obj); fw.indent() << "num_children " << group.getNumChildren() << std::endl; - for(int i=0;igetNumChildren();++ci) + for(unsigned int ci=0;cigetNumChildren();++ci) { impostor->addChild(lod->getChild(ci)); } - for(int ri=0;rigetNumRanges();++ri) + for(unsigned int ri=0;rigetNumRanges();++ri) { impostor->setRange(ri,lod->getRange(ri)); } diff --git a/src/osgUtil/Optimizer.cpp b/src/osgUtil/Optimizer.cpp index 04a56e0d5..da5a025a8 100644 --- a/src/osgUtil/Optimizer.cpp +++ b/src/osgUtil/Optimizer.cpp @@ -380,7 +380,7 @@ void Optimizer::FlattenStaticTransformsVisitor::doTransform(osg::Object* obj,osg lod->setCenter(lod->getCenter()*matrix); // adjust ranges to new scale. - for(int i=0;igetNumRanges();++i) + for(unsigned int i=0;igetNumRanges();++i) { lod->setRange(i,lod->getRange(i)*ratio); } @@ -528,16 +528,15 @@ void Optimizer::FlattenStaticTransformsVisitor::removeTransforms() osg::ref_ptr transform = titr->first; osg::ref_ptr group = osgNew osg::Group; - int i; - for(i=0;igetNumChildren();++i) + for(unsigned int i=0;igetNumChildren();++i) { - for(int j=0;jgetNumParents();++j) + for(unsigned int j=0;jgetNumParents();++j) { group->addChild(transform->getChild(i)); } } - for(i=transform->getNumParents()-1;i>=0;--i) + for(int i=transform->getNumParents()-1;i>=0;--i) { transform->getParent(i)->replaceChild(transform.get(),group.get()); } @@ -623,7 +622,7 @@ void Optimizer::RemoveRedundentNodesVisitor::removeRedundentNodes() //////////////////////////////////////////////////////////////////////////// void Optimizer::CombineLODsVisitor::apply(osg::LOD& lod) { - for(int i=0;igetNumChildren();++i) + for(unsigned int i=0;igetNumChildren();++i) { osg::Node* child = group->getChild(i); osg::LOD* lod = dynamic_cast(child); @@ -686,7 +685,7 @@ void Optimizer::CombineLODsVisitor::combineLODs() { osg::LOD* lod = *lod_itr; - for(int i=0;igetNumRanges()-1;++i) + for(unsigned int i=0;igetNumRanges()-1;++i) { if (maxRangegetRange(i+1)) maxRange = lod->getRange(i+1); rangeMap.insert(RangeMap::value_type(RangePair(lod->getRange(i),lod->getRange(i+1)),lod->getChild(i)));