Fixed shadows warnings - txp plugin was a mess w.r.t shadowing member variables.

This commit is contained in:
Robert Osfield
2016-05-25 17:08:51 +01:00
parent e8aa106184
commit 3a77520d22
11 changed files with 97 additions and 97 deletions

View File

@@ -122,13 +122,13 @@ bool TXPArchive::openFile(const std::string& archiveName)
return false;
}
const trpgHeader *header = GetHeader();
if (header)
const trpgHeader* trpgheader = GetHeader();
if (trpgheader)
{
header->GetNumLods(_numLODs);
header->GetExtents(_swExtents,_neExtents);
header->GetVersion(_majorVersion, _minorVersion);
_isMaster = header->GetIsMaster();
trpgheader->GetNumLods(_numLODs);
trpgheader->GetExtents(_swExtents,_neExtents);
trpgheader->GetVersion(_majorVersion, _minorVersion);
_isMaster = trpgheader->GetIsMaster();
}
int numTextures;
@@ -589,10 +589,10 @@ void trim(std::string& str)
}
bool TXPArchive::loadTextStyles()
{
const trpgTextStyleTable *textStyleTable = GetTextStyleTable();
if ( !textStyleTable )
const trpgTextStyleTable* textStyleTablePtr = GetTextStyleTable();
if ( !textStyleTablePtr )
return false;
if ( textStyleTable->GetNumStyle() < 1 )
if ( textStyleTablePtr->GetNumStyle() < 1 )
return true;
// try fontmap.txt
@@ -629,7 +629,7 @@ bool TXPArchive::loadTextStyles()
OSG_NOTICE << "txp:: All fonts defaulted to arial.ttf" << std::endl;
}
const trpgTextStyleTable::StyleMapType *smap = textStyleTable->getStyleMap();
const trpgTextStyleTable::StyleMapType *smap = textStyleTablePtr->getStyleMap();
trpgTextStyleTable::StyleMapType::const_iterator itr = smap->begin();
for ( ; itr != smap->end(); itr++)
{
@@ -668,13 +668,13 @@ bool TXPArchive::loadTextStyles()
return true;
}
void TXPArchive::addLightAttribute(osgSim::LightPointNode* lpn, osg::StateSet* fallback, const osg::Vec3& att,int handle)
void TXPArchive::addLightAttribute(osgSim::LightPointNode* lpn, osg::StateSet* fallback, const osg::Vec3& att,int light_handle)
{
DeferredLightAttribute la;
la.lightPoint = lpn;
la.fallback = fallback;
la.attitude = att;
_lights[handle] = la;
_lights[light_handle] = la;
}
bool TXPArchive::getTileInfo(const TileLocationInfo& loc, TileInfo& info)
@@ -797,13 +797,13 @@ public:
offset[0] -= bbox._min[0];
offset[1] -= bbox._min[1];
trpg2dPoint offsetXY, tileID(_tileInfo.x,_tileInfo.y);
trpg2dPoint offsetXY, local_tileID(_tileInfo.x,_tileInfo.y);
int divider = (0x01 << _tileInfo.lod);
// calculate which tile model is located in
tileExtents.x /= divider;
tileExtents.y /= divider;
offset[0] -= tileID.x*tileExtents.x;
offset[1] -= tileID.y*tileExtents.y;
offset[0] -= local_tileID.x*tileExtents.x;
offset[1] -= local_tileID.y*tileExtents.y;
osg::Matrix mat(xform.getMatrix());
mat.setTrans(offset);
@@ -868,11 +868,11 @@ osg::Group* TXPArchive::getTileContent(
if(childRef)
{
TileLocationInfo loc;
childRef->GetTileLoc(loc.x, loc.y, loc.lod);
childRef->GetTileZValue(loc.zmin, loc.zmax);
childRef->GetTileAddress(loc.addr);
childInfoList.push_back(loc);
TileLocationInfo child_loc;
childRef->GetTileLoc(child_loc.x, child_loc.y, child_loc.lod);
childRef->GetTileZValue(child_loc.zmin, child_loc.zmax);
childRef->GetTileAddress(child_loc.addr);
childInfoList.push_back(child_loc);
}
}

View File

@@ -313,10 +313,10 @@ void TXPParser::removeEmptyGroups()
osg::Node* node = nl[i].get();
if (node == NULL) continue;
osg::Node::ParentList parents = node->getParents();
for (unsigned int j = 0; j < parents.size(); j++)
osg::Node::ParentList node_parents = node->getParents();
for (unsigned int j = 0; j < node_parents.size(); j++)
{
parents[j]->removeChild(node);
node_parents[j]->removeChild(node);
}
}
}

View File

@@ -207,15 +207,15 @@ public:
{
return ((flags & ISLOCAL)==ISLOCAL);
}
void SetBlocks(int rows,int cols)
void SetBlocks(int r,int c)
{
this->rows = rows;
this->cols = cols;
rows = r;
cols = c;
}
void GetBlocks(int &rows,int &cols)
void GetBlocks(int &r,int &c)
{
rows = this->rows;
cols = this->cols;
r = rows;
c = cols;
}
protected:
int verMinor,verMajor;
@@ -1960,15 +1960,15 @@ public:
bool Read(trpgReadBuffer &);
// Prints this class to a print buffer
bool Print(trpgPrintBuffer &) const;
void SetBlockNo(int row, int col)
void SetBlockNo(int r, int c)
{
this->row = row;
this->col = col;
row = r;
col = c;
}
void GetBlockNo(int &row, int &col)
void GetBlockNo(int &r, int &c)
{
row = this->row;
col = this->col;
r = row;
c = col;
}
protected:
std::vector<int> matList;

View File

@@ -247,12 +247,12 @@ bool trpgTextStyleTable::isValid() const
int trpgTextStyleTable::AddStyle(const trpgTextStyle &style)
{
int handle = style.GetHandle();
if(handle==-1) {
handle = styleMap.size();
int texthandle = style.GetHandle();
if(texthandle==-1) {
texthandle = styleMap.size();
}
styleMap[handle] = style;
return handle;
styleMap[texthandle] = style;
return texthandle;
}
int trpgTextStyleTable::FindAddStyle(const trpgTextStyle &style)
@@ -492,12 +492,12 @@ bool trpgSupportStyleTable::isValid() const
int trpgSupportStyleTable::AddStyle(const trpgSupportStyle &style)
{
int handle = style.GetHandle();
if(handle==-1)
int stylehandle = style.GetHandle();
if(stylehandle==-1)
{
handle = supportStyleMap.size();
stylehandle = supportStyleMap.size();
}
supportStyleMap[handle] = style;
supportStyleMap[stylehandle] = style;
return handle;
}
@@ -748,12 +748,12 @@ bool trpgLabelPropertyTable::isValid() const
int trpgLabelPropertyTable::AddProperty(const trpgLabelProperty &property)
{
int handle = property.GetHandle();
if(handle==-1)
int label_handle = property.GetHandle();
if(label_handle==-1)
{
handle = labelPropertyMap.size();
label_handle = labelPropertyMap.size();
}
labelPropertyMap[handle] = property;
labelPropertyMap[label_handle] = property;
return handle;
}

View File

@@ -960,12 +960,12 @@ bool trpgLightTable::isValid() const
// Set functions
int trpgLightTable::AddLightAttr(const trpgLightAttr& inLight)
{
int handle = inLight.GetHandle();
if(handle==-1) {
handle = lightMap.size();
int light_handle = inLight.GetHandle();
if(light_handle==-1) {
light_handle = lightMap.size();
}
lightMap[handle] = inLight;
return handle;
lightMap[light_handle] = inLight;
return light_handle;
}
int trpgLightTable::FindAddLightAttr(const trpgLightAttr& inLight)
{

View File

@@ -724,27 +724,27 @@ void trpgAttach::Reset()
}
// Parent ID is the node this one gets attached to
void trpgAttach::SetParentID(int id)
void trpgAttach::SetParentID(int pid)
{
parentID = id;
parentID = pid;
}
bool trpgAttach::GetParentID(int &id) const
bool trpgAttach::GetParentID(int &pid) const
{
if (!isValid()) return false;
id = parentID;
pid = parentID;
return true;
}
// Child Position is a unique number of parent
// It could be used as an array index, for example
void trpgAttach::SetChildPos(int id)
void trpgAttach::SetChildPos(int cid)
{
childPos = id;
childPos = cid;
}
bool trpgAttach::GetChildPos(int &id) const
bool trpgAttach::GetChildPos(int &cid) const
{
if (!isValid()) return false;
id = childPos;
cid = childPos;
return true;
}

View File

@@ -204,9 +204,9 @@ bool trpgr_Parser::Parse(trpgReadBuffer &buf)
// Run the callback
if (tcb->cb)
{
void *ret = tcb->cb->Parse(tok,buf);
void *retval = tcb->cb->Parse(tok,buf);
// Note: Do something with the return value
lastObject = ret;
lastObject = retval;
}
}
catch (...)

View File

@@ -267,12 +267,12 @@ bool trpgRangeTable::SetRange(int id,trpgRange &inRange)
int trpgRangeTable::AddRange(trpgRange &range)
{
int handle = range.GetHandle();
if(handle==-1) {
handle = rangeMap.size();
int range_handle = range.GetHandle();
if(range_handle==-1) {
range_handle = rangeMap.size();
}
rangeMap[handle] = range;
return handle;
rangeMap[range_handle] = range;
return range_handle;
}

View File

@@ -102,7 +102,7 @@ trpgrAppFileCache* trpgr_Archive::GetNewRAppFileCache(const char *fullBase, cons
return new trpgrAppFileCache(fullBase,ext);
}
trpgrImageHelper* trpgr_Archive::GetNewRImageHelper(trpgEndian ness,char *dir,const trpgMatTable &matTable,const trpgTexTable &texTable)
trpgrImageHelper* trpgr_Archive::GetNewRImageHelper(trpgEndian endian,char *imagedir,const trpgMatTable &matTable,const trpgTexTable &tTable)
{
bool separateGeo = false;
int majorVer,minorVer;
@@ -110,7 +110,7 @@ trpgrImageHelper* trpgr_Archive::GetNewRImageHelper(trpgEndian ness,char *dir,co
if((majorVer >= TRPG_NOMERGE_VERSION_MAJOR) && (minorVer>=TRPG_NOMERGE_VERSION_MINOR)) {
separateGeo = true;
}
return new trpgrImageHelper(ness,dir,matTable,texTable,separateGeo);
return new trpgrImageHelper(endian,imagedir,matTable,tTable,separateGeo);
}
// Close File
@@ -379,30 +379,30 @@ bool trpgr_Archive::ReadExternalTile(uint32 x,uint32 y,uint32 lod,trpgMemReadBuf
sprintf(filename,"%s" PATHSEPERATOR "tile_%d_%d_%d.tpt",dir,x,y,lod);
}
// Open the file and read the contents
FILE *fp= 0;
FILE *filep= 0;
try {
if (!(fp = osgDB::fopen(filename,"rb"))) {
if (!(filep = osgDB::fopen(filename,"rb"))) {
throw 1;
}
// Find the file end
if (fseek(fp,0,SEEK_END))
if (fseek(filep,0,SEEK_END))
throw 1;
// Note: This means tile is capped at 2 gigs
long pos = ftell(fp);
if (fseek(fp,0,SEEK_SET))
long pos = ftell(filep);
if (fseek(filep,0,SEEK_SET))
throw 1;
// Now we know the size. Read the whole file
buf.SetLength(pos);
char *data = buf.GetDataPtr();
if (fread(data,pos,1,fp) != 1)
if (fread(data,pos,1,filep) != 1)
throw 1;
fclose(fp);
fp = NULL;
fclose(filep);
filep = NULL;
}
catch (...) {
if (fp)
fclose(fp);
if (filep)
fclose(filep);
return false;
}
@@ -505,17 +505,17 @@ bool trpgr_Archive::trpgGetTileMBR(uint32 x,uint32 y,uint32 lod,trpg3dPoint &ll,
*/
trpgrImageHelper::trpgrImageHelper(trpgEndian inNess,char *inDir,
const trpgMatTable &inMatTable,const trpgTexTable &inTexTable,bool separateGeoTyp)
const trpgMatTable &inMatTable,const trpgTexTable &inTexTable,bool sepGeoTyp)
{
Init(inNess,inDir,inMatTable,inTexTable,separateGeoTyp);
Init(inNess,inDir,inMatTable,inTexTable,sepGeoTyp);
}
void trpgrImageHelper::Init(trpgEndian inNess,char *inDir,
const trpgMatTable &inMatTable,const trpgTexTable &inTexTable,bool separateGeoTyp)
const trpgMatTable &inMatTable,const trpgTexTable &inTexTable,bool sepGeoTyp)
{
ness = inNess;
strcpy(dir,inDir);
this->separateGeoTyp = separateGeoTyp;
separateGeoTyp = sepGeoTyp;
matTable = &inMatTable;
texTable = &inTexTable;
@@ -524,7 +524,7 @@ void trpgrImageHelper::Init(trpgEndian inNess,char *inDir,
char fullBase[1024];
sprintf(fullBase,"%s" PATHSEPERATOR "texFile",dir);
texCache = GetNewRAppFileCache(fullBase,"txf");
if(separateGeoTyp) {
if(sepGeoTyp) {
sprintf(fullBase,"%s" PATHSEPERATOR "geotypFile",dir);
geotypCache = GetNewRAppFileCache(fullBase,"txf");
}

View File

@@ -162,9 +162,9 @@ TX_EXDECL class TX_CLDECL trpgrImageHelper
{
return geotypCache;
}
void SetTexTable(trpgTexTable *texTable)
void SetTexTable(trpgTexTable *tt)
{
this->texTable = texTable;
this->texTable = tt;
}
protected:
char dir[1024];

View File

@@ -530,10 +530,10 @@ bool trpgwArchive::CheckpointHeader()
{
// Set up the sizes
int32 numLod;
header.GetNumLods(numLod);
tileTable.SetNumLod(numLod);
for (int i=0;i<numLod;i++) {
int32 numLods;
header.GetNumLods(numLods);
tileTable.SetNumLod(numLods);
for (int i=0;i<numLods;i++) {
trpg2iPoint lodSize;
header.GetLodSize(i,lodSize);
tileTable.SetNumTiles(lodSize.x,lodSize.y,i);
@@ -743,7 +743,7 @@ trpgwAppFile *trpgwArchive::GetNewWAppFile(trpgEndian inNess,const char *fileNam
/* Get a new write image helper
*/
trpgwImageHelper *trpgwArchive::GetNewWImageHelper(trpgEndian ness,char *dir,trpgTexTable &inTexTable)
trpgwImageHelper *trpgwArchive::GetNewWImageHelper(trpgEndian endian,char *imageDir,trpgTexTable &inTexTable)
{
bool separateGeo = false;
int majorVer,minorVer;
@@ -751,7 +751,7 @@ trpgwImageHelper *trpgwArchive::GetNewWImageHelper(trpgEndian ness,char *dir,trp
if((majorVer >= TRPG_NOMERGE_VERSION_MAJOR) && (minorVer>=TRPG_NOMERGE_VERSION_MINOR)) {
separateGeo = true;
}
return new trpgwImageHelper(ness,dir,inTexTable,separateGeo);
return new trpgwImageHelper(endian,imageDir,inTexTable,separateGeo);
}
/* Increment Tile File.
@@ -1371,19 +1371,19 @@ void trpgwGeomHelper::Optimize()
*************************
*/
trpgwImageHelper::trpgwImageHelper(trpgEndian inNess,char *inDir,trpgTexTable &inTable,bool separateGeoTypical)
trpgwImageHelper::trpgwImageHelper(trpgEndian inNess,char *inDir,trpgTexTable &inTable,bool sepGeoTypical)
{
Init(inNess,inDir,inTable,separateGeoTypical);
Init(inNess,inDir,inTable,sepGeoTypical);
}
void trpgwImageHelper::Init(trpgEndian inNess,char *inDir,trpgTexTable &inTable,bool separateGeoTypical)
void trpgwImageHelper::Init(trpgEndian inNess,char *inDir,trpgTexTable &inTable,bool sepGeoTypical)
{
ness = inNess;
strcpy(dir,inDir);
texTable = &inTable;
texFile = NULL;
geotypFile = NULL;
this->separateGeoTypical = separateGeoTypical;
separateGeoTypical = sepGeoTypical;
maxTexFileLen = -1;
}