Fixed warnings

This commit is contained in:
Robert Osfield
2006-07-05 09:52:03 +00:00
parent a0050bc8db
commit 9ae10af995
8 changed files with 96 additions and 70 deletions

View File

@@ -294,11 +294,12 @@ PolyLine::PolyLine( const PolyLine &p ):
numPoints(p.numPoints)
{
parts = new Integer[numParts];
for( Integer i = 0; i < numParts; i++ )
Integer i;
for(i = 0; i < numParts; i++ )
parts[i] = p.parts[i];
points = new Point[numPoints];
for( Integer i = 0; i < numPoints; i++ )
for(i = 0; i < numPoints; i++ )
points[i] = p.points[i];
}
@@ -331,14 +332,15 @@ bool PolyLine::read( int fd )
return false;
parts = new Integer[numParts];
for( int i = 0; i < numParts; i++ )
int i;
for( i = 0; i < numParts; i++ )
{
if( readVal<Integer>(fd, parts[i], LittleEndian ) == false )
return false;
}
points = new struct Point[numPoints];
for( int i = 0; i < numPoints; i++ )
for( i = 0; i < numPoints; i++ )
{
if( points[i].read(fd ) == false )
return false;
@@ -360,11 +362,12 @@ Polygon::Polygon():
numPoints(p.numPoints)
{
parts = new Integer[numParts];
for( Integer i = 0; i < numParts; i++ )
Integer i;
for( i = 0; i < numParts; i++ )
parts[i] = p.parts[i];
points = new Point[numPoints];
for( Integer i = 0; i < numPoints; i++ )
for( i = 0; i < numPoints; i++ )
points[i] = p.points[i];
}
@@ -398,13 +401,14 @@ bool Polygon::read( int fd )
return false;
parts = new Integer[numParts];
for( int i = 0; i < numParts; i++ )
int i;
for( i = 0; i < numParts; i++ )
{
if( readVal<Integer>(fd, parts[i], LittleEndian ) == false )
return false;
}
points = new struct Point[numPoints];
for( int i = 0; i < numPoints; i++ )
for( i = 0; i < numPoints; i++ )
{
if( points[i].read(fd ) == false )
return false;
@@ -509,7 +513,8 @@ bool MultiPointM::read( int fd )
return false;
points = new struct Point[numPoints];
for( Integer i = 0; i < numPoints; i++ )
Integer i;
for( i = 0; i < numPoints; i++ )
{
if( points[i].read(fd) == false )
return false;
@@ -522,7 +527,7 @@ bool MultiPointM::read( int fd )
return false;
mArray = new Double[numPoints];
for( Integer i = 0; i < numPoints; i++ )
for( i = 0; i < numPoints; i++ )
{
if( readVal<Double>(fd, mArray[i], LittleEndian ) == false )
return false;
@@ -557,12 +562,13 @@ PolyLineM::PolyLineM(const PolyLineM &p):
mArray(0L)
{
parts = new Integer[numParts];
for( Integer i = 0; i < numParts; i++ )
Integer i;
for( i = 0; i < numParts; i++ )
parts[i] = p.parts[i];
points = new Point[numPoints];
mArray = new Double[numPoints];
for( Integer i = 0; i < numPoints; i++ )
for( i = 0; i < numPoints; i++ )
{
points[i] = p.points[i];
mArray[i] = p.mArray[i];
@@ -599,14 +605,15 @@ bool PolyLineM::read( int fd )
return false;
parts = new Integer[numParts];
for( int i = 0; i < numParts; i++ )
int i;
for( i = 0; i < numParts; i++ )
{
if( readVal<Integer>(fd, parts[i], LittleEndian ) == false )
return false;
}
points = new struct Point[numPoints];
for( int i = 0; i < numPoints; i++ )
for( i = 0; i < numPoints; i++ )
{
if( points[i].read(fd ) == false )
return false;
@@ -619,7 +626,7 @@ bool PolyLineM::read( int fd )
{
mRange.read(fd);
mArray = new Double[numPoints];
for( int i = 0; i < numPoints; i++ )
for( i = 0; i < numPoints; i++ )
{
if( readVal<Double>(fd, mArray[i], LittleEndian ) == false )
return false;
@@ -648,12 +655,13 @@ PolygonM::PolygonM(const PolygonM &p):
mArray(0L)
{
parts = new Integer[numParts];
for( Integer i = 0; i < numParts; i++ )
Integer i;
for( i = 0; i < numParts; i++ )
parts[i] = p.parts[i];
points = new Point[numPoints];
mArray = new Double[numPoints];
for( Integer i = 0; i < numPoints; i++ )
for( i = 0; i < numPoints; i++ )
{
points[i] = p.points[i];
mArray[i] = p.mArray[i];
@@ -683,13 +691,14 @@ bool PolygonM::read( int fd )
return false;
parts = new Integer[numParts];
for( int i = 0; i < numParts; i++ )
int i;
for( i = 0; i < numParts; i++ )
{
if( readVal<Integer>(fd, parts[i], LittleEndian ) == false )
return false;
}
points = new struct Point[numPoints];
for( int i = 0; i < numPoints; i++ )
for( i = 0; i < numPoints; i++ )
{
if( points[i].read(fd ) == false )
return false;
@@ -704,7 +713,7 @@ bool PolygonM::read( int fd )
return false;
mArray = new Double[numPoints];
for( int i = 0; i < numPoints; i++ )
for( i = 0; i < numPoints; i++ )
{
if( readVal<Double>(fd, mArray[i], LittleEndian ) == false )
return false;
@@ -820,7 +829,8 @@ bool MultiPointZ::read( int fd )
return false;
points = new struct Point[numPoints];
for( Integer i = 0; i < numPoints; i++ )
Integer i;
for( i = 0; i < numPoints; i++ )
{
if( points[i].read(fd) == false )
return false;
@@ -830,7 +840,7 @@ bool MultiPointZ::read( int fd )
return false;
zArray = new Double[numPoints];
for( Integer i = 0; i < numPoints; i++ )
for( i = 0; i < numPoints; i++ )
{
if( readVal<Double>(fd, zArray[i], LittleEndian) == false )
return false;
@@ -844,7 +854,7 @@ bool MultiPointZ::read( int fd )
return false;
mArray = new Double[numPoints];
for( Integer i = 0; i < numPoints; i++ )
for( i = 0; i < numPoints; i++ )
{
if( readVal<Double>(fd, mArray[i], LittleEndian ) == false )
return false;
@@ -882,13 +892,14 @@ PolyLineZ::PolyLineZ(const PolyLineZ &p):
mArray(0L)
{
parts = new Integer[numParts];
for( Integer i = 0; i < numParts; i++ )
Integer i;
for( i = 0; i < numParts; i++ )
parts[i] = p.parts[i];
points = new Point[numPoints];
zArray = new Double[numPoints];
mArray = new Double[numPoints];
for( Integer i = 0; i < numPoints; i++ )
for( i = 0; i < numPoints; i++ )
{
points[i] = p.points[i];
zArray[i] = p.zArray[i];
@@ -928,14 +939,15 @@ bool PolyLineZ::read( int fd )
return false;
parts = new Integer[numParts];
for( int i = 0; i < numParts; i++ )
int i;
for( i = 0; i < numParts; i++ )
{
if( readVal<Integer>(fd, parts[i], LittleEndian ) == false )
return false;
}
points = new struct Point[numPoints];
for( int i = 0; i < numPoints; i++ )
for( i = 0; i < numPoints; i++ )
{
if( points[i].read(fd ) == false )
return false;
@@ -943,7 +955,7 @@ bool PolyLineZ::read( int fd )
zRange.read(fd);
zArray = new Double[numPoints];
for( int i = 0; i < numPoints; i++ )
for( i = 0; i < numPoints; i++ )
{
if( readVal<Double>(fd, zArray[i], LittleEndian ) == false )
return false;
@@ -957,7 +969,7 @@ bool PolyLineZ::read( int fd )
{
mRange.read(fd);
mArray = new Double[numPoints];
for( int i = 0; i < numPoints; i++ )
for( i = 0; i < numPoints; i++ )
{
if( readVal<Double>(fd, mArray[i], LittleEndian ) == false )
return false;
@@ -986,12 +998,13 @@ PolygonZ::PolygonZ(const PolygonZ &p):
mArray(0L)
{
parts = new Integer[numParts];
for( Integer i = 0; i < numParts; i++ )
Integer i;
for( i = 0; i < numParts; i++ )
parts[i] = p.parts[i];
points = new Point[numPoints];
mArray = new Double[numPoints];
for( Integer i = 0; i < numPoints; i++ )
for( i = 0; i < numPoints; i++ )
{
points[i] = p.points[i];
mArray[i] = p.mArray[i];
@@ -1030,13 +1043,14 @@ bool PolygonZ::read( int fd )
return false;
parts = new Integer[numParts];
for( int i = 0; i < numParts; i++ )
int i;
for( i = 0; i < numParts; i++ )
{
if( readVal<Integer>(fd, parts[i], LittleEndian ) == false )
return false;
}
points = new struct Point[numPoints];
for( int i = 0; i < numPoints; i++ )
for( i = 0; i < numPoints; i++ )
{
if( points[i].read(fd ) == false )
return false;
@@ -1046,7 +1060,7 @@ bool PolygonZ::read( int fd )
return false;
zArray = new Double[numPoints];
for( int i = 0; i < numPoints; i++ )
for( i = 0; i < numPoints; i++ )
{
if( readVal<Double>(fd, zArray[i], LittleEndian ) == false )
return false;
@@ -1061,7 +1075,7 @@ bool PolygonZ::read( int fd )
return false;
mArray = new Double[numPoints];
for( int i = 0; i < numPoints; i++ )
for( i = 0; i < numPoints; i++ )
{
if( readVal<Double>(fd, mArray[i], LittleEndian ) == false )
return false;
@@ -1114,7 +1128,8 @@ MultiPatch::MultiPatch( const MultiPatch &mp):
{
parts = new Integer[numParts];
partTypes = new Integer[numParts];
for( Integer i = 0; i < numParts; i++ )
Integer i;
for( i = 0; i < numParts; i++ )
{
parts[i] = mp.parts[i];
partTypes[i] = mp.partTypes[i];
@@ -1122,7 +1137,7 @@ MultiPatch::MultiPatch( const MultiPatch &mp):
points = new Point[numPoints];
zArray = new Double[numPoints];
mArray = new Double[numPoints];
for( Integer i = 0; i < numPoints; i++ )
for( i = 0; i < numPoints; i++ )
{
points[i] = mp.points[i];
zArray[i] = mp.zArray[i];
@@ -1164,21 +1179,22 @@ bool MultiPatch::read( int fd )
return false;
parts = new Integer[numParts];
for( int i = 0; i < numParts; i++ )
int i;
for( i = 0; i < numParts; i++ )
{
if( readVal<Integer>(fd, parts[i], LittleEndian ) == false )
return false;
}
partTypes = new Integer[numParts];
for( int i = 0; i < numParts; i++ )
for( i = 0; i < numParts; i++ )
{
if( readVal<Integer>(fd, partTypes[i], LittleEndian ) == false )
return false;
}
points = new struct Point[numPoints];
for( int i = 0; i < numPoints; i++ )
for( i = 0; i < numPoints; i++ )
{
if( points[i].read(fd ) == false )
return false;
@@ -1188,7 +1204,7 @@ bool MultiPatch::read( int fd )
return false;
zArray = new Double[numPoints];
for( int i = 0; i < numPoints; i++ )
for( i = 0; i < numPoints; i++ )
{
if( readVal<Double>(fd, zArray[i], LittleEndian ) == false )
return false;
@@ -1204,7 +1220,7 @@ bool MultiPatch::read( int fd )
return false;
mArray = new Double[numPoints];
for( int i = 0; i < numPoints; i++ )
for( i = 0; i < numPoints; i++ )
{
if( readVal<Double>(fd, mArray[i], LittleEndian ) == false )
return false;

View File

@@ -278,13 +278,14 @@ void ESRIShapeParser::_process(const std::vector<ESRIShape::PolyLine> &lines )
{
osg::ref_ptr<osg::Vec3Array> coords = new osg::Vec3Array;
for( int i = 0; i < p->numPoints; i++ )
int i;
for( i = 0; i < p->numPoints; i++ )
coords->push_back( osg::Vec3( p->points[i].x, p->points[i].y, 0.0 ));
osg::ref_ptr<osg::Geometry> geometry = new osg::Geometry;
geometry->setVertexArray(coords.get());
for( int i = 0; i < p->numParts; i++ )
for( i = 0; i < p->numParts; i++ )
{
int index = p->parts[i];
int len = i < p->numParts - 1 ?
@@ -306,13 +307,14 @@ void ESRIShapeParser::_process( const std::vector<ESRIShape::Polygon> &polys )
for( p = polys.begin(); p != polys.end(); p++ )
{
osg::ref_ptr<osg::Vec3Array> coords = new osg::Vec3Array;
for( int i = 0; i < p->numPoints; i++ )
int i;
for( i = 0; i < p->numPoints; i++ )
coords->push_back( osg::Vec3( p->points[i].x, p->points[i].y, 0.0 ));
osg::ref_ptr<osg::Geometry> geometry = new osg::Geometry;
geometry->setVertexArray(coords.get());
for( int i = 0; i < p->numParts; i++ )
for( i = 0; i < p->numParts; i++ )
{
int index = p->parts[i];
int len = i < p->numParts - 1 ?
@@ -374,13 +376,14 @@ void ESRIShapeParser::_process(const std::vector<ESRIShape::PolyLineM> &linems )
{
osg::ref_ptr<osg::Vec3Array> coords = new osg::Vec3Array;
for( int i = 0; i < p->numPoints; i++ )
int i;
for( i = 0; i < p->numPoints; i++ )
coords->push_back( osg::Vec3( p->points[i].x, p->points[i].y, 0.0 ));
osg::ref_ptr<osg::Geometry> geometry = new osg::Geometry;
geometry->setVertexArray(coords.get());
for( int i = 0; i < p->numParts; i++ )
for( i = 0; i < p->numParts; i++ )
{
int index = p->parts[i];
int len = i < p->numParts - 1 ?
@@ -402,13 +405,14 @@ void ESRIShapeParser::_process( const std::vector<ESRIShape::PolygonM> &polyms )
for( p = polyms.begin(); p != polyms.end(); p++ )
{
osg::ref_ptr<osg::Vec3Array> coords = new osg::Vec3Array;
for( int i = 0; i < p->numPoints; i++ )
int i;
for( i = 0; i < p->numPoints; i++ )
coords->push_back( osg::Vec3( p->points[i].x, p->points[i].y, 0.0 ));
osg::ref_ptr<osg::Geometry> geometry = new osg::Geometry;
geometry->setVertexArray(coords.get());
for( int i = 0; i < p->numParts; i++ )
for( i = 0; i < p->numParts; i++ )
{
int index = p->parts[i];
int len = i < p->numParts - 1 ?
@@ -470,13 +474,14 @@ void ESRIShapeParser::_process(const std::vector<ESRIShape::PolyLineZ> &linezs )
{
osg::ref_ptr<osg::Vec3Array> coords = new osg::Vec3Array;
for( int i = 0; i < p->numPoints; i++ )
int i;
for( i = 0; i < p->numPoints; i++ )
coords->push_back( osg::Vec3( p->points[i].x, p->points[i].y, p->zArray[i] ));
osg::ref_ptr<osg::Geometry> geometry = new osg::Geometry;
geometry->setVertexArray(coords.get());
for( int i = 0; i < p->numParts; i++ )
for( i = 0; i < p->numParts; i++ )
{
int index = p->parts[i];
int len = i < p->numParts - 1 ?
@@ -498,13 +503,15 @@ void ESRIShapeParser::_process( const std::vector<ESRIShape::PolygonZ> &polyzs )
for( p = polyzs.begin(); p != polyzs.end(); p++ )
{
osg::ref_ptr<osg::Vec3Array> coords = new osg::Vec3Array;
for( int i = 0; i < p->numPoints; i++ )
int i;
for( i = 0; i < p->numPoints; i++ )
coords->push_back( osg::Vec3( p->points[i].x, p->points[i].y, p->zArray[i] ));
osg::ref_ptr<osg::Geometry> geometry = new osg::Geometry;
geometry->setVertexArray(coords.get());
for( int i = 0; i < p->numParts; i++ )
for( i = 0; i < p->numParts; i++ )
{
int index = p->parts[i];
int len = i < p->numParts - 1 ?
@@ -526,7 +533,9 @@ void ESRIShapeParser::_process( const std::vector<ESRIShape::MultiPatch> &mpatch
for( p = mpatches.begin(); p != mpatches.end(); p++ )
{
osg::ref_ptr<osg::Vec3Array> coords = new osg::Vec3Array;
for( int i = 0; i < p->numPoints; i++ )
int i;
for( i = 0; i < p->numPoints; i++ )
coords->push_back( osg::Vec3( p->points[i].x, p->points[i].y, p->zArray[i] ));
osg::ref_ptr<osg::Geometry> geometry = new osg::Geometry;
@@ -537,7 +546,7 @@ void ESRIShapeParser::_process( const std::vector<ESRIShape::MultiPatch> &mpatch
geometry->setColorArray(colors.get());
geometry->setColorBinding(osg::Geometry::BIND_PER_VERTEX );
for( int i = 0; i < p->numParts; i++ )
for( i = 0; i < p->numParts; i++ )
{
int index = p->parts[i];
int len = i < p->numParts - 1 ?
@@ -580,7 +589,7 @@ void ESRIShapeParser::_process( const std::vector<ESRIShape::MultiPatch> &mpatch
p->partTypes[i] == FirstRing ? osg::Vec4(1.0,0.0,0.0,1.0) :
p->partTypes[i] == Ring ? osg::Vec4(1.0,0.0,0.0,1.0) :
osg::Vec4(1.0,0.0,0.0,1.0) ;
for( int i = 0; i < len; i++ )
for( int j = 0; j < len; j++ )
colors->push_back( color );
geometry->addPrimitiveSet( new osg::DrawArrays(mode, index, len ));

View File

@@ -618,7 +618,8 @@ bool BSP_BIQUADRATIC_PATCH::Tesselate(int newTesselation,osg::Geometry* aGeometr
m_trianglesPerRow.resize(m_tesselation);
m_rowIndexPointers.resize(m_tesselation);
for(int row=0; row<m_tesselation; ++row)
int row;
for(row=0; row<m_tesselation; ++row)
{
m_trianglesPerRow[row]=2*(m_tesselation+1);
m_rowIndexPointers[row]=&m_indices[row*2*(m_tesselation+1)];
@@ -650,7 +651,7 @@ bool BSP_BIQUADRATIC_PATCH::Tesselate(int newTesselation,osg::Geometry* aGeometr
aGeometry->setTexCoordArray(1,patch_lmapcoord_array);
for(int row=0; row<m_tesselation; ++row)
for(row=0; row<m_tesselation; ++row)
{
osg::DrawElementsUInt* face_indices = new osg::DrawElementsUInt(osg::PrimitiveSet::TRIANGLE_STRIP,
m_tesselation*(m_tesselation+1)*2,

View File

@@ -4,8 +4,7 @@ using namespace osg;
Normals::Normals( Node *node, float scale, Mode mode )
{
MakeNormalsVisitor mnv(scale);
mnv.setMode( mode );
MakeNormalsVisitor mnv(scale,mode);
node->accept( mnv );
ref_ptr<Vec3Array> coords = mnv.getCoords();
@@ -30,7 +29,7 @@ Normals::Normals( Node *node, float scale, Mode mode )
Normals::MakeNormalsVisitor::MakeNormalsVisitor( float normalScale, Normals::Mode mode):
Normals::MakeNormalsVisitor::MakeNormalsVisitor( float normalScale, Mode mode):
NodeVisitor(NodeVisitor::TRAVERSE_ALL_CHILDREN),
_normal_scale(normalScale),
_mode(mode)

View File

@@ -28,7 +28,7 @@ class Normals: public osg::Geode
class MakeNormalsVisitor : public osg::NodeVisitor
{
public:
MakeNormalsVisitor(float normalScale=1.0, Normals::Mode=Normals::SurfaceNormals );
MakeNormalsVisitor(float normalScale, Mode mode);
void setMode( Mode mode ) { _mode = mode; }
@@ -63,14 +63,14 @@ class Normals: public osg::Geode
class SurfaceNormals: public Normals
{
public:
SurfaceNormals( Node *node, float scale=1.0 ):
SurfaceNormals( osg::Node *node, float scale=1.0 ):
Normals( node, scale, Normals::SurfaceNormals ) {}
};
class VertexNormals: public Normals
{
public:
VertexNormals( Node *node, float scale=1.0 ):
VertexNormals( osg::Node *node, float scale=1.0 ):
Normals( node, scale, Normals::VertexNormals ) {}
};

View File

@@ -749,7 +749,7 @@ osg::Group* TXPArchive::getTileContent(
double realMaxRange,
double usedMaxRange,
osg::Vec3& tileCenter,
std::vector<TXPArchive::TileLocationInfo>& childInfoList)
std::vector<TileLocationInfo>& childInfoList)
{
if(_majorVersion == 2 && _minorVersion >= 1)
{

View File

@@ -179,7 +179,7 @@ namespace txp
double realMaxRange,
double usedMaxRange,
osg::Vec3& tileCenter,
std::vector<TXPArchive::TileLocationInfo>& childInfoList);
std::vector<TileLocationInfo>& childInfoList);
// To be used for Version 2.1 with lod > 0
osg::Group* getTileContent(
@@ -188,7 +188,7 @@ namespace txp
double realMaxRange,
double usedMaxRange,
osg::Vec3& tileCenter,
std::vector<TXPArchive::TileLocationInfo>& childInfoList);
std::vector<TileLocationInfo>& childInfoList);
// Get the number of tiles for given LOD
bool getLODSize(int lod, int& x, int& y);

View File

@@ -34,6 +34,9 @@ class trpgMaterial;
class trpgTextureEnv;
class trpgMatTable;
#define ISMASTER 1
#define ISLOCAL 2
/* This is the archive header structure. There is one per TerraPage archive.
You don't write it directly, but instead fill it out and pass it to
a trpgwArchive (if you're writing), or get it back from a trpgr_Archive
@@ -226,8 +229,6 @@ TX_EXDECL class TX_CLDECL trpgHeader : public trpgReadWriteable
std::vector<trpg2dPoint> tileSize;
std::vector<trpg2iPoint> lodSizes;
std::vector<float64> lodRanges;
const static int ISMASTER = 1;
const static int ISLOCAL = 2;
int32 flags;
int32 rows;
int32 cols;