Fixed warnings

This commit is contained in:
Robert Osfield
2008-12-18 12:26:14 +00:00
parent de17dad958
commit 215cd5f29b
5 changed files with 55 additions and 36 deletions

View File

@@ -23,7 +23,7 @@ TXPPagedLOD::~TXPPagedLOD()
void TXPPagedLOD::traverse(osg::NodeVisitor& nv)
{
TileMapper* tileMapper = dynamic_cast<TileMapper*>(nv.getUserData());
//TileMapper* tileMapper = dynamic_cast<TileMapper*>(nv.getUserData());
//Modified by Brad Anderegg (May-27-08) because the black listing process appears to make tiles switch lods
//when they clearly shouldnt, in the worst cases a tile will page out that is right in front of you.
bool forceUseOfFirstChild = /*tileMapper ? (tileMapper->isNodeBlackListed(this)) :*/ false;
@@ -49,7 +49,8 @@ void TXPPagedLOD::traverse(osg::NodeVisitor& nv)
for(unsigned int i=0;i<maxRangeSize;++i)
{
if (forceUseOfFirstChild || _rangeList[i].first<=distance && distance<_rangeList[i].second)
if (forceUseOfFirstChild ||
(_rangeList[i].first<=distance && distance<_rangeList[i].second))
{
if (i<_children.size())
{

View File

@@ -1417,11 +1417,15 @@ bool trpgTexture::Read(trpgReadBuffer &buf)
buf.Get(ival);
// Read the handle if we can..
try {
if(!buf.Get((int32 &)handle)) {
handle = -1;
}
else {
int32 tempHandle;
if(buf.Get(tempHandle))
{
writeHandle = true;
handle = tempHandle;
}
else
{
handle = -1;
}
}
catch (...) {

View File

@@ -248,7 +248,15 @@ bool trpgModel::Read(trpgReadBuffer &buf, bool hasHandle)
// TerraPage 2.2 will store the unique handle after the type
// we use a different token, so this is backwards compatible.
if(hasHandle) {
buf.Get((int32 &)handle);
int32 tempHandle;
if(buf.Get(tempHandle))
{
handle = tempHandle;
}
else
{
handle = -1;
}
}
else
handle = -1;

View File

@@ -763,13 +763,13 @@ bool trpgLightAttr::Print(trpgPrintBuffer &buf) const
buf.IncreaseIndent();
sprintf(ls,"type = %s",strType[(int)(data.type)]); buf.prnLine(ls);
sprintf(ls,"directionality = %s",strDirect[(int)(data.directionality)]); buf.prnLine(ls);
sprintf(ls,"front color (RGB) = %.2lf, %.2lf, %.2lf",
sprintf(ls,"front color (RGB) = %.2f, %.2f, %.2f",
data.frontColor.red, data.frontColor.green,data.frontColor.blue ); buf.prnLine(ls);
sprintf(ls,"front intensity = %.2lf", data.frontIntensity ); buf.prnLine(ls);
sprintf(ls,"back color (RGB) = %.2lf, %.2lf, %.2lf",
sprintf(ls,"front intensity = %.2f", data.frontIntensity ); buf.prnLine(ls);
sprintf(ls,"back color (RGB) = %.2f, %.2f, %.2f",
data.backColor.red, data.backColor.green,data.backColor.blue ); buf.prnLine(ls);
sprintf(ls,"back intensity = %.2lf", data.backIntensity ); buf.prnLine(ls);
sprintf(ls,"normal (xyz) = %.2lf,%.2lf,%.2lf",
sprintf(ls,"back intensity = %.2f", data.backIntensity ); buf.prnLine(ls);
sprintf(ls,"normal (xyz) = %.2f,%.2f,%.2f",
data.normal.x,data.normal.y,data.normal.z ); buf.prnLine(ls);
sprintf(ls,"smc = %d",data.smc); buf.prnLine(ls);
sprintf(ls,"fid = %d",data.fid); buf.prnLine(ls);
@@ -783,15 +783,15 @@ bool trpgLightAttr::Print(trpgPrintBuffer &buf) const
(data.flags & trpgLightAttr::trpg_Directional ? "yes" : "no" )); buf.prnLine(ls);
sprintf(ls,"enable back color = %s",
(data.flags & trpgLightAttr::trpg_BackColor ? "yes" : "no" )); buf.prnLine(ls);
sprintf(ls,"horizontal lobe angle = %.2lf",data.horizontalLobeAngle); buf.prnLine(ls);
sprintf(ls,"vertical lobe angle = %.2lf",data.verticalLobeAngle); buf.prnLine(ls);
sprintf(ls,"lobe roll angle = %.2lf",data.lobeRollAngle); buf.prnLine(ls);
sprintf(ls,"lobe falloff = %.2lf",data.lobeFalloff); buf.prnLine(ls);
sprintf(ls,"ambient intensity = %.2lf",data.ambientIntensity); buf.prnLine(ls);
sprintf(ls,"horizontal lobe angle = %.2f",data.horizontalLobeAngle); buf.prnLine(ls);
sprintf(ls,"vertical lobe angle = %.2f",data.verticalLobeAngle); buf.prnLine(ls);
sprintf(ls,"lobe roll angle = %.2f",data.lobeRollAngle); buf.prnLine(ls);
sprintf(ls,"lobe falloff = %.2f",data.lobeFalloff); buf.prnLine(ls);
sprintf(ls,"ambient intensity = %.2f",data.ambientIntensity); buf.prnLine(ls);
sprintf(ls,"reflective only = %s",
(data.flags & trpgLightAttr::trpg_Reflective ? "yes" : "no") ); buf.prnLine(ls);
sprintf(ls,"quality = %s", strQuality[(int)(data.quality)]); buf.prnLine(ls);
sprintf(ls,"significance for RASCAL lights = %.2lf",
sprintf(ls,"significance for RASCAL lights = %.2f",
data.rascalSignificance ); buf.prnLine(ls);
sprintf(ls,"calligraphic draw order = %d",
data.calligraphicAttr.drawOrder ); buf.prnLine(ls);
@@ -809,27 +809,27 @@ bool trpgLightAttr::Print(trpgPrintBuffer &buf) const
(data.flags & trpgLightAttr::trpg_FogPunch ? "yes" : "no" ) ); buf.prnLine(ls);
sprintf(ls,"performer range mode enable Z buffer = %s",
(data.flags & trpgLightAttr::trpg_ZBuffer ? "yes" : "no" ) ); buf.prnLine(ls);
sprintf(ls,"performer maximum pixel size = %.2lf",
sprintf(ls,"performer maximum pixel size = %.2f",
data.performerAttr.maxPixelSize ); buf.prnLine(ls);
sprintf(ls,"performer minimum pixel size = %.2lf",
sprintf(ls,"performer minimum pixel size = %.2f",
data.performerAttr.minPixelSize ); buf.prnLine(ls);
sprintf(ls,"performer actual size = %.2lf",
sprintf(ls,"performer actual size = %.2f",
data.performerAttr.actualSize ); buf.prnLine(ls);
sprintf(ls,"performer transparent pixel size = %.2lf",
sprintf(ls,"performer transparent pixel size = %.2f",
data.performerAttr.transparentPixelSize ); buf.prnLine(ls);
sprintf(ls,"performer transparent falloff exponent = %.2lf",
sprintf(ls,"performer transparent falloff exponent = %.2f",
data.performerAttr.transparentFallofExp ); buf.prnLine(ls);
sprintf(ls,"performer transparent scale = %.2lf",
sprintf(ls,"performer transparent scale = %.2f",
data.performerAttr.transparentScale ); buf.prnLine(ls);
sprintf(ls,"performer transparent clamp = %.2lf",
sprintf(ls,"performer transparent clamp = %.2f",
data.performerAttr.transparentClamp ); buf.prnLine(ls);
sprintf(ls,"performer fog scale = %.2lf",
sprintf(ls,"performer fog scale = %.2f",
data.performerAttr.fogScale ); buf.prnLine(ls);
sprintf(ls,"animation period = %.2lf",data.animationAttr.period); buf.prnLine(ls);
sprintf(ls,"animation phase delay = %.2lf",
sprintf(ls,"animation period = %.2f",data.animationAttr.period); buf.prnLine(ls);
sprintf(ls,"animation phase delay = %.2f",
data.animationAttr.phaseDelay ); buf.prnLine(ls);
sprintf(ls,"animation time on = %.2lf",data.animationAttr.timeOn); buf.prnLine(ls);
sprintf(ls,"animation vector (ijk) = %.2lf, %.2lf, %.2lf",
sprintf(ls,"animation time on = %.2f",data.animationAttr.timeOn); buf.prnLine(ls);
sprintf(ls,"animation vector (ijk) = %.2f, %.2f, %.2f",
data.animationAttr.vector.x,data.animationAttr.vector.y,
data.animationAttr.vector.z); buf.prnLine(ls);
sprintf(ls,"animation - flashing = %s",

View File

@@ -139,8 +139,8 @@ bool trpgRange::operator == (const trpgRange &in) const
if (strcmp(category,in.category))
return false;
} else {
if (category && !in.category ||
!category && in.category)
if ((category && !in.category) ||
(!category && in.category) )
return false;
}
@@ -148,8 +148,8 @@ bool trpgRange::operator == (const trpgRange &in) const
if (strcmp(subCategory,in.subCategory))
return false;
} else {
if (subCategory && !in.subCategory ||
!subCategory && in.subCategory)
if ((subCategory && !in.subCategory) ||
(subCategory && in.subCategory))
return false;
}
if(handle != in.handle)
@@ -192,8 +192,14 @@ bool trpgRange::Read(trpgReadBuffer &buf)
// Read the handle if we can..
try {
if(!buf.Get((int32 &)handle)) {
handle = -1;
int32 tempHandle;
if(buf.Get(tempHandle))
{
handle = tempHandle;
}
else
{
handle = -1;
}
}
catch (...) {