Warning fixes.

This commit is contained in:
Robert Osfield
2002-11-22 09:46:25 +00:00
parent bcf9d08c2b
commit 22c313cf3e
5 changed files with 21 additions and 36 deletions

View File

@@ -944,7 +944,7 @@ class AttrbuteFunctorArrayVisitor : public ArrayVisitor
virtual void apply(Vec4Array& array) { if (!array.empty()) _af.apply(_type,array.size(),&(array.front())); }
inline void apply(Drawable::AttributeType type,Array* array)
inline void applyArray(Drawable::AttributeType type,Array* array)
{
if (array)
{
@@ -961,13 +961,13 @@ void Geometry::accept(AttributeFunctor& af)
{
AttrbuteFunctorArrayVisitor afav(af);
afav.apply(VERTICES,_vertexArray.get());
afav.apply(NORMALS,_normalArray.get());
afav.apply(COLORS,_colorArray.get());
afav.applyArray(VERTICES,_vertexArray.get());
afav.applyArray(NORMALS,_normalArray.get());
afav.applyArray(COLORS,_colorArray.get());
for(unsigned unit=0;unit<_texCoordList.size();++unit)
{
afav.apply((AttributeType)(TEXTURE_COORDS_0+unit),_texCoordList[unit].first.get());
afav.applyArray((AttributeType)(TEXTURE_COORDS_0+unit),_texCoordList[unit].first.get());
}
}
@@ -993,7 +993,7 @@ class ConstAttrbuteFunctorArrayVisitor : public ConstArrayVisitor
virtual void apply(const Vec4Array& array) { if (!array.empty()) _af.apply(_type,array.size(),&(array.front())); }
inline void apply(Drawable::AttributeType type,const Array* array)
inline void applyArray(Drawable::AttributeType type,const Array* array)
{
if (array)
{
@@ -1010,13 +1010,13 @@ void Geometry::accept(ConstAttributeFunctor& af) const
{
ConstAttrbuteFunctorArrayVisitor afav(af);
afav.apply(VERTICES,_vertexArray.get());
afav.apply(NORMALS,_normalArray.get());
afav.apply(COLORS,_colorArray.get());
afav.applyArray(VERTICES,_vertexArray.get());
afav.applyArray(NORMALS,_normalArray.get());
afav.applyArray(COLORS,_colorArray.get());
for(unsigned unit=0;unit<_texCoordList.size();++unit)
{
afav.apply((AttributeType)(TEXTURE_COORDS_0+unit),_texCoordList[unit].first.get());
afav.applyArray((AttributeType)(TEXTURE_COORDS_0+unit),_texCoordList[unit].first.get());
}
}

View File

@@ -845,8 +845,6 @@ void PrimitiveShapeVisitor::apply(const Sphere& sphere)
float rBase=0.0f;
float zBase=-sphere.getRadius();
float vBase=0.0f;
float nzBase=-1.0f;
float nRatioBase=0.0f;
for(unsigned int rowi=0;
rowi<numRows;
@@ -888,8 +886,6 @@ void PrimitiveShapeVisitor::apply(const Sphere& sphere)
rBase=rTop;
zBase=zTop;
vBase=vTop;
nzBase=nzTop;
nRatioBase=nRatioTop;
}
}

View File

@@ -381,23 +381,13 @@ float Viewer::app(unsigned int viewport)
osg::ref_ptr<GLUTEventAdapter> ea = osgNew GLUTEventAdapter;
ea->adaptFrame(_frameStamp->getReferenceTime());
bool handled = false;
for (EventHandlerList::iterator eh = _viewportList[viewport]._eventHandlerList.begin();
eh != _viewportList[viewport]._eventHandlerList.end();
eh++ )
{
if ( eh->valid() )
{
if ( (*eh)->handle(*ea,*this) )
{
handled = true;
break;
}
}
if (eh->valid()) (*eh)->handle(*ea,*this);
}
// if ( !handled ) {
_viewportList[viewport]._cameraManipulator->handle(*ea,*this);
// }
_viewportList[viewport]._cameraManipulator->handle(*ea,*this);
if (getRecordingAnimationPath() && getAnimationPath())

View File

@@ -217,10 +217,10 @@ static void read_surf(FILE *f, gint nbytes, lwObject *lwo)
break;
case ID_TFAL:
if (tex) {
float vx,vy,vz;
vx = read_float(f);
vy = read_float(f);
vz = read_float(f);
//float vx,vy,vz;
/*vx =*/ read_float(f);
/*vy =*/ read_float(f);
/*vz =*/ read_float(f);
//printf("fal %.2f %.2f %.2f\n", vx,vy,vz);
}
else
@@ -228,10 +228,10 @@ static void read_surf(FILE *f, gint nbytes, lwObject *lwo)
break;
case ID_TVEL:
if (tex) {
float vx,vy,vz;
vx = read_float(f);
vy = read_float(f);
vz = read_float(f);
//float vx,vy,vz;
/*vx =*/ read_float(f);
/*vy =*/ read_float(f);
/*vz =*/ read_float(f);
//printf("vel %.2f %.2f %.2f\n", vx,vy,vz);
}
else

View File

@@ -38,8 +38,7 @@ bool Geometry_readLocalData(Object& obj, Input& fr)
Geometry& geom = static_cast<Geometry&>(obj);
bool matchedFirst = false;
if ((matchedFirst=fr.matchSequence("Primitives %i {")) || fr.matchSequence("PrimitiveSets %i {") )
if (fr.matchSequence("Primitives %i {") || fr.matchSequence("PrimitiveSets %i {") )
{
int entry = fr[1].getNoNestedBrackets();