From ae08a5b261d25af836d05cefdcb84b838512e78a Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Sat, 20 Sep 2008 15:43:38 +0000 Subject: [PATCH] Change TileID::layer to TileID::level --- include/osgTerrain/TerrainTile | 18 +++++++++--------- src/osgPlugins/ive/TerrainTile.cpp | 6 +++--- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/include/osgTerrain/TerrainTile b/include/osgTerrain/TerrainTile index a91d80c98..217ab7cc1 100644 --- a/include/osgTerrain/TerrainTile +++ b/include/osgTerrain/TerrainTile @@ -32,37 +32,37 @@ class TileID public: TileID(): - layer(-1), + level(-1), x(-1), y(-1) {} - TileID(int in_layer, int in_x, int in_y): - layer(in_layer), + TileID(int in_level, int in_x, int in_y): + level(in_level), x(in_x), y(in_y) {} bool operator == (const TileID& rhs) const { - return (layer==rhs.layer) && (x==rhs.x) && (y==rhs.y); + return (level==rhs.level) && (x==rhs.x) && (y==rhs.y); } bool operator != (const TileID& rhs) const { - return (layer!=rhs.layer) || (x!=rhs.x) || (y!=rhs.y); + return (level!=rhs.level) || (x!=rhs.x) || (y!=rhs.y); } bool operator < (const TileID& rhs) const { - if (layerrhs.layer) return false; + if (levelrhs.level) return false; if (xrhs.x) return false; return y=0; } + bool valid() const { return level>=0; } - int layer; + int level; int x; int y; }; diff --git a/src/osgPlugins/ive/TerrainTile.cpp b/src/osgPlugins/ive/TerrainTile.cpp index 7cdf7b15e..88ae76eb0 100644 --- a/src/osgPlugins/ive/TerrainTile.cpp +++ b/src/osgPlugins/ive/TerrainTile.cpp @@ -33,7 +33,7 @@ void TerrainTile::write(DataOutputStream* out) if (out->getVersion() >= VERSION_0026) { - out->writeInt(getTileID().layer); + out->writeInt(getTileID().level); out->writeInt(getTileID().x); out->writeInt(getTileID().y); } @@ -86,10 +86,10 @@ void TerrainTile::read(DataInputStream* in) if (in->getVersion() >= VERSION_0026) { - int layer = in->readInt(); + int level = in->readInt(); int x = in->readInt(); int y = in->readInt(); - setTileID(osgTerrain::TileID(layer,x,y)); + setTileID(osgTerrain::TileID(level,x,y)); } if (in->getVersion() >= VERSION_0023)