diff --git a/src/osgPlugins/txp/trpage_compat.cpp b/src/osgPlugins/txp/trpage_compat.cpp index d9d822277..2125eae86 100644 --- a/src/osgPlugins/txp/trpage_compat.cpp +++ b/src/osgPlugins/txp/trpage_compat.cpp @@ -50,7 +50,7 @@ bool trpgMatTable1_0::Read(trpgReadBuffer &buf) trpgToken matTok; int32 len; bool status; - int i,j,k; + unsigned int i,j,k; std::vector shortTable; std::vector baseMats; @@ -68,12 +68,12 @@ bool trpgMatTable1_0::Read(trpgReadBuffer &buf) if (matTok == TRPGSHORTMATTABLE) { int32 numTex,texId; buf.PushLimit(len); - for (i=0;i= texData.size())) + if ((n<0) || (n >= (int)texData.size())) return; trpgTexData *td = &texData[n]; @@ -337,7 +337,7 @@ bool trpgGeometry::GetNumMaterial(int &n) const bool trpgGeometry::GetMaterial(int id,int32 &m,bool &isLocal) const { isLocal = false; - if (!isValid() || id < 0 || id >= materials.size()) return false; + if (!isValid() || id < 0 || id >= (int)materials.size()) return false; m = materials[id]; if (m < 0) { m = -m - 1; @@ -356,7 +356,7 @@ bool trpgGeometry::GetNumVertex(int &v) const } bool trpgGeometry::GetVertices(float32 *v) const { - int i; + unsigned int i; if (!isValid()) return false; if (vertDataFloat.size() != 0) @@ -369,7 +369,7 @@ bool trpgGeometry::GetVertices(float32 *v) const } bool trpgGeometry::GetVertices(float64 *v) const { - int i; + unsigned int i; if (!isValid()) return false; if (vertDataFloat.size() != 0) @@ -384,7 +384,7 @@ bool trpgGeometry::GetVertex(int n,trpg3dPoint &pt) const { int id = 3*n; int idMax = 3*n+2; - if (id < 0 || (idMax >= vertDataFloat.size() && idMax >= vertDataDouble.size())) + if (id < 0 || (idMax >= (int)vertDataFloat.size() && idMax >= (int)vertDataDouble.size())) return false; if (vertDataFloat.size() > vertDataDouble.size()) { pt.x = vertDataFloat[id]; @@ -409,7 +409,7 @@ bool trpgGeometry::GetNumNormal(int32 &n) const } bool trpgGeometry::GetNormals(float32 *v) const { - int i; + unsigned int i; if (!isValid()) return false; if (normDataFloat.size() != 0) @@ -422,7 +422,7 @@ bool trpgGeometry::GetNormals(float32 *v) const } bool trpgGeometry::GetNormals(float64 *v) const { - int i; + unsigned int i; if (!isValid()) return false; if (normDataFloat.size() != 0) @@ -441,7 +441,7 @@ bool trpgGeometry::GetNumColorSets(int &n) const } bool trpgGeometry::GetColorSet(int id,trpgColorInfo *ci) const { - if (!isValid() || id < 0 || id >= colors.size()) return false; + if (!isValid() || id < 0 || id >= (int)colors.size()) return false; *ci = colors[id]; return true; } @@ -453,7 +453,7 @@ bool trpgGeometry::GetNumTexCoordSets(int &n) const } bool trpgGeometry::GetTexCoordSet(int id,trpgTexData *tx) const { - if (!isValid() || id < 0 || id >= texData.size()) return false; + if (!isValid() || id < 0 || id >= (int)texData.size()) return false; *tx = texData[id]; return true; } @@ -466,7 +466,7 @@ bool trpgGeometry::GetNumEdgeFlag(int &n) const bool trpgGeometry::GetEdgeFlags(char *e) const { if (!isValid()) return false; - for (int i=0;i= tileSize.size()) return; + if (id < 0 || id >= (int)tileSize.size()) return; tileSize[id] = pt; } void trpgHeader::SetOrigin(const trpg3dPoint &pt) @@ -212,7 +212,7 @@ bool trpgHeader::GetDbVersion(int32 &vmaj,int32 &vmin) const bool trpgHeader::GetTileSize(int id,trpg2dPoint &pt) const { if (!isValid()) return false; - if (id < 0 || id >= tileSize.size()) return false; + if (id < 0 || id >= (int)tileSize.size()) return false; pt = tileSize[id]; return true; } diff --git a/src/osgPlugins/txp/trpage_label.cpp b/src/osgPlugins/txp/trpage_label.cpp index 8bbf35412..f40099a77 100644 --- a/src/osgPlugins/txp/trpage_label.cpp +++ b/src/osgPlugins/txp/trpage_label.cpp @@ -231,7 +231,7 @@ void trpgTextStyleTable::Reset() bool trpgTextStyleTable::isValid() const { - for (int i=0;i= styles.size()) + if (id < 0 || id >= (int)styles.size()) return NULL; return &styles[id]; @@ -268,7 +268,6 @@ const trpgTextStyle *trpgTextStyleTable::GetStyleRef(int id) const bool trpgTextStyleTable::Write(trpgWriteBuffer &buf) { - int i; if (!isValid()) return false; @@ -279,7 +278,7 @@ bool trpgTextStyleTable::Write(trpgWriteBuffer &buf) buf.Add((int32)numStyle); // Write the styles - for (i=0;i= styles.size()) + if (id < 0 || id >= (int)styles.size()) return NULL; return &styles[id]; @@ -493,7 +492,6 @@ const trpgSupportStyle *trpgSupportStyleTable::GetStyleRef(int id) const bool trpgSupportStyleTable::Write(trpgWriteBuffer &buf) { - int i; if (!isValid()) return false; @@ -504,7 +502,7 @@ bool trpgSupportStyleTable::Write(trpgWriteBuffer &buf) buf.Add((int32)numStyle); // Write the styles - for (i=0;i= properties.size()) + if (id < 0 || id >= (int)properties.size()) return NULL; return &properties[id]; @@ -731,7 +728,6 @@ const trpgLabelProperty *trpgLabelPropertyTable::GetPropertyRef(int id) const bool trpgLabelPropertyTable::Write(trpgWriteBuffer &buf) { - int i; if (!isValid()) return false; @@ -742,7 +738,7 @@ bool trpgLabelPropertyTable::Write(trpgWriteBuffer &buf) buf.Add((int32)numProperty); // Write the properties - for (i=0;i *trpgLabel::GetSupports() const bool trpgLabel::Write(trpgWriteBuffer &buf) { - int i; - buf.Begin(TRPG_LABEL); buf.Add(propertyId); buf.Add(text); @@ -938,7 +931,7 @@ bool trpgLabel::Write(trpgWriteBuffer &buf) buf.Add(url); buf.Add(location); buf.Add((int)supports.size()); - for (i=0;i= lightList.size()) return NULL; + if (id < 0 || id >= (int)lightList.size()) return NULL; return &lightList[id]; } @@ -1005,7 +1004,7 @@ bool trpgLightTable::Read(trpgReadBuffer &buf) try { buf.Get(numLights); lightList.resize(numLights); - for (unsigned int i=0;i *matList; matList = tileHead.GetLocalMaterialList(); - if (id <0 || id >= matList->size()) + if (id <0 || id >= (int)matList->size()) return NULL; return &(*matList)[id]; @@ -120,7 +120,7 @@ void *trpgManagedTile::GetLocalData() const bool trpgManagedTile::SetMatData(int id,void *info) { - if (id < 0 || id >= localMatData.size()) + if (id < 0 || id >= (int)localMatData.size()) return false; localMatData[id] = info; @@ -130,7 +130,7 @@ bool trpgManagedTile::SetMatData(int id,void *info) void *trpgManagedTile::GetMatData(int id) const { - if (id < 0 || id >= localMatData.size()) + if (id < 0 || id >= (int)localMatData.size()) return NULL; return localMatData[id]; @@ -173,7 +173,7 @@ trpgPageManager::LodPageInfo::~LodPageInfo() void trpgPageManager::LodPageInfo::Clean() { // Clean up managed tile structures - int i; + unsigned int i; for (i=0;i *groupIDs = lastTile->GetGroupIDs(); - int i; - for (i=0;isize();i++) { + for (unsigned int i=0;isize();i++) { ManageGroupMap::iterator p = groupMap.find((*groupIDs)[i]); if (p != groupMap.end()) groupMap.erase(p); @@ -647,8 +646,7 @@ void trpgPageManager::AckUnload() bool trpgPageManager::Stop() { bool res=false; - int i; - for (i=0;i(this))->CalcMipLevelSizes(); int totSize = 0; - for (int i=0;i= texList.size()) return false; + if (id < 0 || id >= (int)texList.size()) return false; ret = texList[id]; return true; } const trpgTexture *trpgTexTable::GetTextureRef(int id) const { - if (id < 0 || id >= texList.size()) return NULL; + if (id < 0 || id >= (int)texList.size()) return NULL; return &texList[id]; } @@ -1718,7 +1720,7 @@ bool trpgTexTable::Read(trpgReadBuffer &buf) try { buf.Get(numTex); texList.resize(numTex); - for (unsigned int i=0;i= models.size()) + if (!isValid() || id < 0 || id >= (int)models.size()) return false; model = models[id]; return true; } trpgModel *trpgModelTable::GetModelRef(int id) { - if (id < 0 || id >= models.size()) + if (id < 0 || id >= (int)models.size()) return NULL; return &models[id]; } diff --git a/src/osgPlugins/txp/trpage_parse.cpp b/src/osgPlugins/txp/trpage_parse.cpp index e5ccb9f15..fd7d72ca1 100644 --- a/src/osgPlugins/txp/trpage_parse.cpp +++ b/src/osgPlugins/txp/trpage_parse.cpp @@ -211,7 +211,7 @@ bool trpgr_Parser::Parse(trpgReadBuffer &buf) class trpgSceneHelperPush : public trpgr_Callback { public: trpgSceneHelperPush(trpgSceneParser *in_parse) { parse = in_parse; }; - void *Parse(trpgToken tok,trpgReadBuffer &buf) { + void *Parse(trpgToken /*tok*/,trpgReadBuffer& /*buf*/) { // Call the start children callback parse->StartChildren(parse->lastObject); parse->parents.push_back(parse->lastObject); @@ -225,7 +225,7 @@ protected: class trpgSceneHelperPop : public trpgr_Callback { public: trpgSceneHelperPop(trpgSceneParser *in_parse) { parse = in_parse; }; - void *Parse(trpgToken tok,trpgReadBuffer &buf) { + void *Parse(trpgToken /*tok*/,trpgReadBuffer& /*buf*/) { // Make sure we don't have an extra pop if (parse->parents.size() == 0) // Note: let someone know about the extra pop @@ -246,7 +246,7 @@ protected: class trpgSceneHelperDefault : public trpgr_Callback { public: trpgSceneHelperDefault(trpgSceneParser *in_parse) { parse = in_parse; } - void *Parse(trpgToken tok,trpgReadBuffer &buf) { + void *Parse(trpgToken /*tok*/,trpgReadBuffer& /*buf*/) { // Absorb it quietly return (void *)1; } diff --git a/src/osgPlugins/txp/trpage_pparse.cpp b/src/osgPlugins/txp/trpage_pparse.cpp index 8f76d2da9..26c52ea8d 100644 --- a/src/osgPlugins/txp/trpage_pparse.cpp +++ b/src/osgPlugins/txp/trpage_pparse.cpp @@ -161,7 +161,7 @@ void *trpgPrintGraphParser::ReadHelper::Parse(trpgToken tok,trpgReadBuffer &buf) baseTex->GetIsMipmap(hasMipmap); numMipmap = hasMipmap ? baseTex->CalcNumMipmaps() : 0; for (int j=1;j(baseTex))->MipLevelOffset(j); + //int mipOffset = (const_cast(baseTex))->MipLevelOffset(j); int mipSize = (const_cast(baseTex))->MipLevelSize(j); if (mipSize) { char *pixels = new char[mipSize]; diff --git a/src/osgPlugins/txp/trpage_print.cpp b/src/osgPlugins/txp/trpage_print.cpp index 73c7c8282..78ac1555c 100644 --- a/src/osgPlugins/txp/trpage_print.cpp +++ b/src/osgPlugins/txp/trpage_print.cpp @@ -245,7 +245,7 @@ bool trpgTexTable::Print(trpgPrintBuffer &buf) const buf.prnLine("----Texture Table----"); buf.IncreaseIndent(); - for (int i=0;i (ex,ey) = (%d,%d) -> (%d,%d)",sx,sy,ex,ey); buf.prnLine(ls); sprintf(ls,"dest (width,height) = (%d,%d)",destWidth,destHeight); buf.prnLine(ls); - for (int i=0;i= rangeList.size()) + if (id < 0 || id >= (int)rangeList.size()) return false; ret = rangeList[id]; @@ -228,7 +229,7 @@ bool trpgRangeTable::SetRange(int id,trpgRange &inRange) if (!isValid()) return false; - if (id < 0 || id >= rangeList.size()) + if (id < 0 || id >= (int)rangeList.size()) return false; rangeList[id] = inRange; @@ -245,7 +246,7 @@ int trpgRangeTable::AddRange(trpgRange &range) int trpgRangeTable::FindAddRange(trpgRange &range) { - for (int i=0;i= numLods) return false; + if (lod >= (unsigned int)numLods) return false; trpg2iPoint lodSize; header.GetLodSize(lod,lodSize); - if (x >= lodSize.x || y >= lodSize.y) return false; + if (x >= (unsigned int)lodSize.x || y >= (unsigned int)lodSize.y) return false; trpgTileTable::TileMode tileMode; tileTable.GetMode(tileMode); @@ -291,7 +291,7 @@ bool trpgr_Archive::trpgGetTileMBR(uint32 x,uint32 y,uint32 lod,trpg3dPoint &ll, header.GetNumLods(numLod); trpg2iPoint maxXY; header.GetLodSize(lod,maxXY); - if (x >= maxXY.x || y>= maxXY.y) + if (x >= (unsigned int)maxXY.x || y>= (unsigned int)maxXY.y) return false; trpg3dPoint origin; @@ -518,7 +518,7 @@ bool trpgrImageHelper::GetImagePath(const trpgTexture *tex,char *fullPath,int pa tex->GetName(name,nameLen); nameLen = strlen(name); - if (strlen(dir) + nameLen + 2 > pathLen) + if ((int)strlen(dir) + nameLen + 2 > pathLen) return false; sprintf(fullPath,"%s" PATHSEPERATOR "%s",dir,name); diff --git a/src/osgPlugins/txp/trpage_readbuf.cpp b/src/osgPlugins/txp/trpage_readbuf.cpp index 5394b9d6a..dbb1ce694 100644 --- a/src/osgPlugins/txp/trpage_readbuf.cpp +++ b/src/osgPlugins/txp/trpage_readbuf.cpp @@ -318,7 +318,7 @@ bool trpgReadBuffer::SkipToLimit() // See if the next read is going to blow the limits bool trpgReadBuffer::TestLimit(int len) { - for (int i=0;i limits[i]) return false; @@ -329,7 +329,7 @@ bool trpgReadBuffer::TestLimit(int len) // We just read a few bytes. Update the limits void trpgReadBuffer::UpdateLimits(int len) { - for (int i=0;i= children.size()) + if (id < 0 || id >= (int)children.size()) return; children[id] = NULL; } @@ -167,7 +167,7 @@ void trpgReadGroupBase::unRefChild(int id) // Unref all the children (they've probably been moved elsewhere) void trpgReadGroupBase::unRefChildren() { - for (int i=0;i(&mbr); trpgMBR kmbr; // Ask the kids - for (int i=0;iGetMBR(); cmbr->Union(kmbr); } @@ -232,7 +232,7 @@ trpgMBR trpgReadGeometry::GetMBR() const class trpgReadGeometryHelper : public trpgr_Callback { public: trpgReadGeometryHelper(trpgSceneGraphParser *in_parse) { parse = in_parse;} - void *Parse(trpgToken tok,trpgReadBuffer &buf) { + void *Parse(trpgToken /*tok*/,trpgReadBuffer &buf) { trpgReadGeometry *geom = new trpgReadGeometry(); trpgGeometry *data = geom->GetData(); if (!data->Read(buf)) { @@ -261,7 +261,7 @@ protected: class trpgReadGroupHelper : public trpgr_Callback { public: trpgReadGroupHelper(trpgSceneGraphParser *in_parse) { parse = in_parse; } - void *Parse(trpgToken tok,trpgReadBuffer &buf) { + void *Parse(trpgToken /*tok*/,trpgReadBuffer &buf) { trpgReadGroup *group = new trpgReadGroup(); trpgGroup *data = group->GetData(); if (!data->Read(buf)) { @@ -286,7 +286,7 @@ protected: class trpgReadBillboardHelper : public trpgr_Callback { public: trpgReadBillboardHelper(trpgSceneGraphParser *in_parse) { parse = in_parse; } - void *Parse(trpgToken tok,trpgReadBuffer &buf) { + void *Parse(trpgToken /*tok*/,trpgReadBuffer &buf) { trpgReadBillboard *group = new trpgReadBillboard(); trpgBillboard *data = group->GetData(); if (!data->Read(buf)) { @@ -311,7 +311,7 @@ protected: class trpgReadAttachHelper : public trpgr_Callback { public: trpgReadAttachHelper(trpgSceneGraphParser *in_parse) { parse = in_parse; } - void *Parse(trpgToken tok,trpgReadBuffer &buf) { + void *Parse(trpgToken /*tok*/,trpgReadBuffer &buf) { trpgReadAttach *attach = new trpgReadAttach(); trpgAttach *data = attach->GetData(); if (!data->Read(buf)) { @@ -336,7 +336,7 @@ protected: class trpgReadLodHelper : public trpgr_Callback { public: trpgReadLodHelper(trpgSceneGraphParser *in_parse) { parse = in_parse; } - void *Parse(trpgToken tok,trpgReadBuffer &buf) { + void *Parse(trpgToken /*tok*/,trpgReadBuffer &buf) { trpgReadLod *lod = new trpgReadLod(); trpgLod *data = lod->GetData(); if (!data->Read(buf)) { @@ -361,7 +361,7 @@ protected: class trpgReadModelRefHelper : public trpgr_Callback { public: trpgReadModelRefHelper(trpgSceneGraphParser *in_parse) { parse = in_parse; } - void *Parse(trpgToken tok,trpgReadBuffer &buf) { + void *Parse(trpgToken /*tok*/,trpgReadBuffer &buf) { trpgReadModelRef *mod = new trpgReadModelRef(); trpgModelRef *data = mod->GetData(); if (!data->Read(buf)) { @@ -381,7 +381,7 @@ protected: class trpgReadTileHeaderHelper : public trpgr_Callback { public: trpgReadTileHeaderHelper(trpgSceneGraphParser *in_parse) { parse = in_parse; } - void *Parse(trpgToken tok,trpgReadBuffer &buf) { + void *Parse(trpgToken /*tok*/,trpgReadBuffer &buf) { trpgReadTileHeader *th = parse->GetTileHeaderRef(); trpgTileHeader *data = th->GetData(); if (!data->Read(buf)) @@ -488,12 +488,12 @@ bool trpgSceneGraphParser::StartChildren(void *in_node) for the parent above the current one. If there isn't one, we'll just stick things in our top group. */ -bool trpgSceneGraphParser::EndChildren(void *in_node) +bool trpgSceneGraphParser::EndChildren(void * /*in_node*/) { // We don't need it here, but this is the node we just // finished putting children under. If you need to close // it out in some way, do that here - trpgReadNode *node = (trpgReadNode *)in_node; + //trpgReadNode *node = (trpgReadNode *)in_node; // Get the parent above the current one int pos = parents.size()-2; diff --git a/src/osgPlugins/txp/trpage_tile.cpp b/src/osgPlugins/txp/trpage_tile.cpp index da7e553ba..d22ab9caf 100644 --- a/src/osgPlugins/txp/trpage_tile.cpp +++ b/src/osgPlugins/txp/trpage_tile.cpp @@ -66,7 +66,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 || lod >= (int)lodInfo.size()) return; // Got a table we need to maintain @@ -98,7 +98,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 || lod >= (int)lodInfo.size()) return; if (mode != Local) return; LodInfo &li = lodInfo[lod]; @@ -130,7 +130,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 || lod >= (int)lodInfo.size()) return false; if (mode != Local) return false; const LodInfo &li = lodInfo[lod]; @@ -163,7 +163,7 @@ bool trpgTileTable::Write(trpgWriteBuffer &buf) buf.Add(numLod); // Write each terrain LOD set - for (unsigned int i=0;i= matList.size()) + if (no < 0 || no >= (int)matList.size()) return; matList[no] = id; } void trpgTileHeader::SetModel(int no,int id) { - if (no < 0 || no >= modelList.size()) + if (no < 0 || no >= (int)modelList.size()) return; modelList[no] = id; } @@ -275,7 +275,7 @@ void trpgTileHeader::SetModel(int no,int id) void trpgTileHeader::AddMaterial(int id) { // Look for it first - for (int i=0;i= locMats.size()) + if (id < 0 || id >= (int)locMats.size()) return false; retMat = locMats[id]; @@ -334,7 +334,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 || id >= (int)matList.size()) return false; mat = matList[id]; return true; @@ -347,7 +347,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 || id >= (int)modelList.size()) return false; m = modelList[id]; return true; diff --git a/src/osgPlugins/txp/trpage_util.cpp b/src/osgPlugins/txp/trpage_util.cpp index 772679565..e4e43d3dd 100644 --- a/src/osgPlugins/txp/trpage_util.cpp +++ b/src/osgPlugins/txp/trpage_util.cpp @@ -25,3 +25,4 @@ Instead, there's a Windows specific program that merges TerraPage archives in the merge/ directory of this distribution. */ + diff --git a/src/osgPlugins/txp/trpage_util.h b/src/osgPlugins/txp/trpage_util.h index 55c6d2e13..bf1091f7b 100644 --- a/src/osgPlugins/txp/trpage_util.h +++ b/src/osgPlugins/txp/trpage_util.h @@ -29,4 +29,4 @@ public: enum {DoReport = 1<<0,DoCopy = 1<<1, DoTileOpt = 1<<2}; int merge(trpgr_Archive &inArch1,trpgr_Archive &inArch2,trpgwArchive &outArch, int flags = 0); }; -#endif \ No newline at end of file +#endif diff --git a/src/osgPlugins/txp/trpage_warchive.cpp b/src/osgPlugins/txp/trpage_warchive.cpp index 1ee77a7a2..c83f10232 100644 --- a/src/osgPlugins/txp/trpage_warchive.cpp +++ b/src/osgPlugins/txp/trpage_warchive.cpp @@ -96,8 +96,8 @@ trpgwArchive::trpgwArchive(char *inDir,char *inFile,trpg2dPoint &sw, trpg2dPoint inHeader->GetTileSize(0,blockSize); double dx = (oldSW.x - newSW.x)/blockSize.x + 10e-10; double dy = (oldSW.y - newSW.y)/blockSize.y + 10e-10; - addOffset.x = dx; - addOffset.y = dy; + addOffset.x = (int)dx; + addOffset.y = (int)dy; if (dx - addOffset.x > 10e-4 || dy - addOffset.y > 10e-4) { delete inArch; @@ -115,8 +115,8 @@ trpgwArchive::trpgwArchive(char *inDir,char *inFile,trpg2dPoint &sw, trpg2dPoint trpg2dPoint tileSize; inHeader->GetTileSize(i,tileSize); trpg2iPoint newTileExt; - newTileExt.x = (newNE.x - newSW.x)/tileSize.x + 10e-5; - newTileExt.y = (newNE.y - newSW.y)/tileSize.y + 10e-15; + newTileExt.x = (int)((newNE.x - newSW.x)/tileSize.x + 10e-5); + newTileExt.y = (int)((newNE.y - newSW.y)/tileSize.y + 10e-15); header.SetLodSize(i,newTileExt); } @@ -380,7 +380,7 @@ bool trpgwArchive::CheckpointHeader() int32 numLod; header.GetNumLods(numLod); tileTable.SetNumLod(numLod); - for (unsigned int i=0;igetData(); @@ -779,7 +779,7 @@ void trpgwGeomHelper::EndPolygon() // Turn the polygon into triangles // Note: Only dealing with convex here matTri = matPoly; - int numMats=matTri.size(); + unsigned int numMats=matTri.size(); switch (mode) { case trpgGeometry::Triangles: @@ -853,7 +853,7 @@ void trpgwGeomHelper::ResetPolygon() // Set the current color // Note: Required -void trpgwGeomHelper::SetColor(trpgColor &col) +void trpgwGeomHelper::SetColor(trpgColor& /*col*/) { // tmpColor = col; } @@ -954,8 +954,8 @@ void trpgwGeomHelper::FlushGeom() break; case trpgGeometry::Quads: { - int numVert = vert.size(); - int numMat = matTri.size(); + unsigned int numVert = vert.size(); + unsigned int numMat = matTri.size(); unsigned int loop; // Make sure we've got quads @@ -965,7 +965,7 @@ void trpgwGeomHelper::FlushGeom() trpgGeometry quads; quads.SetPrimType(trpgGeometry::Quads); for (loop=0;loop &iv, std::vector< v=iv[vid]; n=in[vid]; tex.resize(0); - for (unsigned int loop=0; loop < numMat; loop++) tex.push_back(itex[vid*numMat+loop]); + for (unsigned int loop=0; loop < (unsigned int)numMat; loop++) tex.push_back(itex[vid*numMat+loop]); } void trpgwGeomHelper::Optimize() { - bool isStrip = false; int dtype = (dataType == UseDouble ? trpgGeometry::DoubleData : trpgGeometry::FloatData); // Potentially writing to all of these strips.SetPrimType(trpgGeometry::TriStrips); fans.SetPrimType(trpgGeometry::TriFans); bags.SetPrimType(trpgGeometry::Triangles); - int numMat = matTri.size(); + unsigned int numMat = matTri.size(); for (unsigned int loop =0; loop < numMat; loop++ ) { strips.AddMaterial(matTri[loop]); strips.AddTexCoords(trpgGeometry::PerVertex); diff --git a/src/osgPlugins/txp/trpage_writebuf.cpp b/src/osgPlugins/txp/trpage_writebuf.cpp index 8feb21942..273e114a4 100644 --- a/src/osgPlugins/txp/trpage_writebuf.cpp +++ b/src/osgPlugins/txp/trpage_writebuf.cpp @@ -344,14 +344,14 @@ bool trpgwAppFile::Append(const trpgMemWriteBuffer *buf1,const trpgMemWriteBuffe // Write the data out const char *data = buf1->getData(); int len = buf1->length(); - if (fwrite(data,sizeof(char),len,fp) != len) { + if (fwrite(data,sizeof(char),len,fp) != (unsigned int)len) { valid = false; return false; } if (buf2) { data = buf2->getData(); len = buf2->length(); - if (fwrite(data,sizeof(char),len,fp) != len) { + if (fwrite(data,sizeof(char),len,fp) != (unsigned int)len) { valid = false; return false; } @@ -377,7 +377,7 @@ bool trpgwAppFile::Append(const char *data,int size) } // Write the data out - if (fwrite(data,sizeof(char),size,fp) != size) { + if (fwrite(data,sizeof(char),size,fp) != (unsigned int)size) { valid = false; return false; }