Fixed the seveal hunderd warnings in TerraPage loader!

This commit is contained in:
Robert Osfield
2002-04-16 21:08:46 +00:00
parent 3f249fcb57
commit b02cc80533
15 changed files with 152 additions and 152 deletions

View File

@@ -65,7 +65,7 @@ void trpgTileTable::SetNumLod(int numLod)
void trpgTileTable::SetNumTiles(int nx,int ny,int lod)
{
if (nx <= 0 || ny <= 0 || lod < 0 || lod >= lodInfo.size())
if (nx <= 0 || ny <= 0 || lod < 0 || static_cast<unsigned int>(lod) >= lodInfo.size())
return;
// Got a table we need to maintain
@@ -97,7 +97,7 @@ void trpgTileTable::SetNumTiles(int nx,int ny,int lod)
}
void trpgTileTable::SetTile(int x,int y,int lod,trpgwAppAddress &ref,float32 zmin,float32 zmax)
{
if (lod < 0 || lod >= lodInfo.size()) return;
if (lod < 0 || static_cast<unsigned int>(lod) >= lodInfo.size()) return;
if (mode != Local)
return;
LodInfo &li = lodInfo[lod];
@@ -129,7 +129,7 @@ bool trpgTileTable::GetTile(int x,int y,int lod,trpgwAppAddress &ref,float32 &zm
{
if (!isValid()) return false;
if (lod < 0 || lod >= lodInfo.size()) return false;
if (lod < 0 || static_cast<unsigned int>(lod) >= lodInfo.size()) return false;
if (mode != Local)
return false;
const LodInfo &li = lodInfo[lod];
@@ -162,7 +162,7 @@ bool trpgTileTable::Write(trpgWriteBuffer &buf)
buf.Add(numLod);
// Write each terrain LOD set
for (unsigned int i=0;i<numLod;i++) {
for (int i=0;i<numLod;i++) {
LodInfo &li = lodInfo[i];
buf.Add(li.numX);
buf.Add(li.numY);
@@ -205,7 +205,7 @@ bool trpgTileTable::Read(trpgReadBuffer &buf)
if (numLod <= 0) throw 1;
lodInfo.resize(numLod);
for (unsigned int i=0;i<numLod;i++) {
for (int i=0;i<numLod;i++) {
LodInfo &li = lodInfo[i];
buf.Get(li.numX);
buf.Get(li.numY);
@@ -214,7 +214,7 @@ bool trpgTileTable::Read(trpgReadBuffer &buf)
li.addr.resize(numTile);
li.elev_min.resize(numTile);
li.elev_max.resize(numTile);
unsigned int j;
int j;
for (j=0;j<numTile;j++) {
trpgwAppAddress &ref = li.addr[j];
buf.Get(ref.file);
@@ -259,13 +259,13 @@ void trpgTileHeader::Reset()
// Set functions
void trpgTileHeader::SetMaterial(int no,int id)
{
if (no < 0 || no >= matList.size())
if (no < 0 || static_cast<unsigned int>(no) >= matList.size())
return;
matList[no] = id;
}
void trpgTileHeader::SetModel(int no,int id)
{
if (no < 0 || no >= modelList.size())
if (no < 0 || static_cast<unsigned int>(no) >= modelList.size())
return;
modelList[no] = id;
}
@@ -274,7 +274,7 @@ void trpgTileHeader::SetModel(int no,int id)
void trpgTileHeader::AddMaterial(int id)
{
// Look for it first
for (int i=0;i<matList.size();i++)
for (unsigned int i=0;i<matList.size();i++)
if (matList[i] == id)
return;
// Didn't find it, add it.
@@ -282,7 +282,7 @@ void trpgTileHeader::AddMaterial(int id)
}
void trpgTileHeader::AddModel(int id)
{
for (int i=0;i<modelList.size();i++)
for (unsigned int i=0;i<modelList.size();i++)
if (modelList[i] == id)
return;
modelList.push_back(id);
@@ -309,7 +309,7 @@ bool trpgTileHeader::GetNumLocalMaterial(int32 &retNum) const
bool trpgTileHeader::GetLocalMaterial(int32 id,trpgLocalMaterial &retMat) const
{
if (id < 0 || id >= locMats.size())
if (id < 0 || static_cast<unsigned int>(id) >= locMats.size())
return false;
retMat = locMats[id];
@@ -333,7 +333,7 @@ bool trpgTileHeader::GetNumMaterial(int32 &no) const
}
bool trpgTileHeader::GetMaterial(int32 id,int32 &mat) const
{
if (!isValid() || id < 0 || id >= matList.size())
if (!isValid() || id < 0 || static_cast<unsigned int>(id) >= matList.size())
return false;
mat = matList[id];
return true;
@@ -346,7 +346,7 @@ bool trpgTileHeader::GetNumModel(int32 &no) const
}
bool trpgTileHeader::GetModel(int32 id,int32 &m) const
{
if (!isValid() || id < 0 || id >= modelList.size())
if (!isValid() || id < 0 || static_cast<unsigned int>(id) >= modelList.size())
return false;
m = modelList[id];
return true;