Fixed warnings.

This commit is contained in:
Robert Osfield 2006-07-04 11:24:36 +00:00
parent 0170689c9d
commit c8aec2a07d
11 changed files with 108 additions and 105 deletions

View File

@ -131,9 +131,9 @@ class Multitexture : public Record
if (mask & layerBit)
{
int16 textureIndex = in.readInt16();
int16 effectIndex = in.readInt16();
int16 mappingIndex = in.readInt16();
uint16 data= in.readUInt16();
/* int16 effectIndex =*/ in.readInt16();
/* int16 mappingIndex =*/ in.readInt16();
/* uint16 data=*/ in.readUInt16();
osg::ref_ptr<osg::StateSet> texturePoolStateset = document.getOrCreateTexturePool()->get(textureIndex);
if (stateset.valid() && texturePoolStateset.valid())
@ -181,7 +181,7 @@ class UVList : public Record
return count;
}
virtual void readRecord(RecordInputStream& in, Document& document)
virtual void readRecord(RecordInputStream& in, Document& /*document*/)
{
uint32 mask = in.readUInt32(0);
@ -223,7 +223,7 @@ class Replicate : public Record
virtual ~Replicate() {}
virtual void readRecord(RecordInputStream& in, Document& document)
virtual void readRecord(RecordInputStream& in, Document& /*document*/)
{
int16 replicate = in.readInt16();

View File

@ -25,7 +25,7 @@ class PushLevel : public Record
META_Record(PushLevel)
virtual void read(RecordInputStream& in, Document& document)
virtual void read(RecordInputStream& /*in*/, Document& document)
{
document.pushLevel();
}
@ -48,7 +48,7 @@ class PopLevel : public Record
META_Record(PopLevel)
virtual void read(RecordInputStream& in, Document& document)
virtual void read(RecordInputStream& /*in*/, Document& document)
{
document.popLevel();
}
@ -71,7 +71,7 @@ class PushSubface : public Record
META_Record(PushSubface)
virtual void read(RecordInputStream& in, Document& document)
virtual void read(RecordInputStream& /*in*/, Document& document)
{
document.pushSubface();
}
@ -94,7 +94,7 @@ class PopSubface : public Record
META_Record(PopSubface)
virtual void read(RecordInputStream& in, Document& document)
virtual void read(RecordInputStream& /*in*/, Document& document)
{
document.popSubface();
}

View File

@ -126,7 +126,7 @@ osg::Vec4f DataInputStream::readColor32()
uint8 green = readUInt8();
uint8 red = readUInt8();
osg::Vec4f color((float)red/255,(float)green/255,(float)blue/255,1);
osg::Vec4f color((float)red/255,(float)green/255,(float)blue/255,(float)alpha/255);
return color;
}

View File

@ -10,16 +10,16 @@ using namespace flt;
Document::Document() :
_done(false),
_level(0),
_subfaceLevel(0),
_version(0),
_unitScale(1.0),
_preserveFace(false),
_defaultDOFAnimationState(false),
_useTextureAlphaForTransparancyBinning(true),
_doUnitsConversion(true),
_desiredUnits(METERS)
_desiredUnits(METERS),
_done(false),
_level(0),
_subfaceLevel(0),
_unitScale(1.0),
_version(0)
{
}

View File

@ -164,7 +164,7 @@ public:
UVs->push_back(uv);
}
virtual void addMorphVertex(Vertex& vertex0, Vertex& vertex100)
virtual void addMorphVertex(Vertex& vertex0, Vertex& /*vertex100*/)
{
osg::Vec3Array* vertices = getOrCreateVertexArray(*_geometry);
vertices->push_back(vertex0._coord);
@ -205,34 +205,34 @@ protected:
virtual void readRecord(RecordInputStream& in, Document& document)
{
std::string id = in.readString(8);
int32 IRColor = in.readInt32();
int16 relativePriority = in.readInt16();
/*int32 IRColor =*/ in.readInt32();
/*int16 relativePriority =*/ in.readInt16();
_drawFlag = in.readUInt8();
uint8 texturedWhite = in.readUInt8();
int16 primaryNameIndex = in.readInt16(-1);
int16 secondaryNameIndex = in.readInt16(-1);
/*int16 secondaryNameIndex =*/ in.readInt16(-1);
in.forward(1);
_template = in.readUInt8(FIXED_NO_ALPHA_BLENDING);
int detailTexture = in.readInt16(-1);
/*int detailTexture =*/ in.readInt16(-1);
int textureIndex = in.readInt16(-1);
int materialIndex = in.readInt16(-1);
int16 surface = in.readInt16();
int16 feature = in.readInt16();
int32 IRMaterial = in.readInt32(-1);
/*int16 surface =*/ in.readInt16();
/*int16 feature =*/ in.readInt16();
/*int32 IRMaterial =*/ in.readInt32(-1);
_transparency = in.readUInt16(0);
// version > 13
uint8 influenceLOD = in.readUInt8();
uint8 linestyle = in.readUInt8();
/*uint8 influenceLOD =*/ in.readUInt8();
/*uint8 linestyle =*/ in.readUInt8();
_flags = in.readUInt32(0);
_lightMode = in.readUInt8(FACE_COLOR);
in.forward(7);
osg::Vec4 primaryPackedColor = in.readColor32();
osg::Vec4 secondaryPackedColor = in.readColor32();
// version >= VERSION_15_1
int textureMappingIndex = in.readInt16(-1);
/*int textureMappingIndex =*/ in.readInt16(-1);
in.forward(2);
int primaryColorIndex = in.readInt32(-1);
int alternateColorIndex = in.readInt32(-1);
/*int alternateColorIndex =*/ in.readInt32(-1);
// version >= 16
in.forward(2);
int shaderIndex = in.readInt16(-1);
@ -566,6 +566,8 @@ public:
if (_parent.valid())
_parent->addMorphVertex(_vertex0, _vertex100);
break;
case UNDEFINED:
break;
}
}
@ -728,34 +730,34 @@ protected:
{
std::string id = in.readString(8);
in.forward(4);
int32 IRColor = in.readInt32();
int16 relativePriority = in.readInt16();
/*int32 IRColor =*/ in.readInt32();
/*int16 relativePriority =*/ in.readInt16();
_drawFlag = in.readUInt8();
uint8 texturedWhite = in.readUInt8();
int16 primaryNameIndex = in.readInt16(-1);
int16 secondaryNameIndex = in.readInt16(-1);
/*int16 secondaryNameIndex =*/ in.readInt16(-1);
in.forward(1);
_template = in.readUInt8(FIXED_NO_ALPHA_BLENDING);
int detailTexture = in.readInt16(-1);
/*int detailTexture =*/ in.readInt16(-1);
int textureIndex = in.readInt16(-1);
int materialIndex = in.readInt16(-1);
int16 surface = in.readInt16();
int16 feature = in.readInt16();
int32 IRMaterial = in.readInt32(-1);
/*int16 surface =*/ in.readInt16();
/*int16 feature =*/ in.readInt16();
/*int32 IRMaterial =*/ in.readInt32(-1);
_transparency = in.readUInt16(0);
// version > 13
uint8 influenceLOD = in.readUInt8();
uint8 linestyle = in.readUInt8();
/*uint8 influenceLOD =*/ in.readUInt8();
/*uint8 linestyle =*/ in.readUInt8();
_flags = in.readUInt32(0);
_lightMode = in.readUInt8(FACE_COLOR);
in.forward(7);
osg::Vec4 primaryPackedColor = in.readColor32();
osg::Vec4 secondaryPackedColor = in.readColor32();
// version >= VERSION_15_1
int textureMappingIndex = in.readInt16(-1);
/*int textureMappingIndex =*/ in.readInt16(-1);
in.forward(2);
int primaryColorIndex = in.readInt32(-1);
int alternateColorIndex = in.readInt32(-1);
/*int alternateColorIndex =*/ in.readInt32(-1);
// version >= 16
in.forward(2);
int shaderIndex = in.readInt16(-1);
@ -1028,7 +1030,7 @@ protected:
virtual ~MeshPrimitive() {}
virtual void readRecord(RecordInputStream& in, Document& document)
virtual void readRecord(RecordInputStream& in, Document& /*document*/)
{
Mesh* mesh = dynamic_cast<Mesh*>(_parent.get());
if (!mesh) return;

View File

@ -122,7 +122,7 @@ protected:
virtual ~LightPoint() {}
virtual void readRecord(RecordInputStream& in, Document& document)
virtual void readRecord(RecordInputStream& in, Document& /*document*/)
{
std::string id = in.readString(8);
_material = in.readInt16();
@ -259,8 +259,8 @@ protected:
{
std::string id = in.readString(8);
int32 appearanceIndex = in.readInt32();
int32 animationIndex = in.readInt32();
int32 drawOrder = in.readInt32(); // for calligraphic lights
/*int32 animationIndex =*/ in.readInt32();
/*int32 drawOrder =*/ in.readInt32(); // for calligraphic lights
LightPointAppearancePool* lpaPool = document.getOrCreateLightPointAppearancePool();
_appearance = lpaPool->get(appearanceIndex);
@ -313,7 +313,7 @@ protected:
virtual ~LightPointSystem() {}
virtual void readRecord(RecordInputStream& in, Document& document)
virtual void readRecord(RecordInputStream& in, Document& /*document*/)
{
std::string id = in.readString(8);
osg::notify(osg::INFO) << "ID: " << id << std::endl;

View File

@ -84,7 +84,7 @@ protected:
uint8 green = in.readUInt8(1);
uint8 red = in.readUInt8(1);
(*cp)[i] = osg::Vec4((float)red/255,(float)green/255,(float)blue/255,1);
(*cp)[i] = osg::Vec4((float)red/255,(float)green/255,(float)blue/255,(float)alpha/255);
}
}
else // version <= 13
@ -132,7 +132,7 @@ protected:
virtual ~NameTable() {}
virtual void readRecord(RecordInputStream& in, Document& document)
virtual void readRecord(RecordInputStream& /*in*/, Document& /*document*/)
{
}
};
@ -156,7 +156,7 @@ protected:
{
int32 index = in.readInt32();
std::string name = in.readString(12);
uint32 flags = in.readUInt32();
/*uint32 flags =*/ in.readUInt32();
osg::Vec3f ambient = in.readVec3f();
osg::Vec3f diffuse = in.readVec3f();
osg::Vec3f specular = in.readVec3f();
@ -201,7 +201,7 @@ protected:
osg::Vec3f emissive = in.readVec3f();
float32 shininess = in.readFloat32();
float32 alpha = in.readFloat32();
uint32 flags = in.readUInt32();
/*uint32 flags =*/ in.readUInt32();
std::string name = in.readString(12);
in.forward(4*28);
@ -249,6 +249,7 @@ protected:
return osg::Texture2D::REPEAT;
break;
}
return osg::Texture2D::REPEAT;
}
virtual void readRecord(RecordInputStream& in, Document& document)
@ -256,8 +257,8 @@ protected:
int maxLength = (document.version() < VERSION_14) ? 80 : 200;
std::string filename = in.readString(maxLength);
int32 index = in.readInt32(-1);
int32 x = in.readInt32();
int32 y = in.readInt32();
/*int32 x =*/ in.readInt32();
/*int32 y =*/ in.readInt32();
osg::ref_ptr<osg::Image> image = osgDB::readImageFile(filename,document.getOptions());
if (!image.valid())
@ -382,7 +383,7 @@ protected:
virtual ~EyepointAndTrackplanePalette() {}
virtual void readRecord(RecordInputStream& in, Document& document) {}
virtual void readRecord(RecordInputStream& /*in*/, Document& /*document*/) {}
};
RegisterRecordProxy<EyepointAndTrackplanePalette> g_EyepointAndTrackplanePalette(EYEPOINT_AND_TRACKPLANE_PALETTE_OP);
@ -400,7 +401,7 @@ protected:
virtual ~LinkagePalette() {}
virtual void readRecord(RecordInputStream& in, Document& document) {}
virtual void readRecord(RecordInputStream& /*in*/, Document& /*document*/) {}
};
RegisterRecordProxy<LinkagePalette> g_LinkagePalette(LINKAGE_PALETTE_OP);
@ -418,7 +419,7 @@ protected:
virtual ~SoundPalette() {}
virtual void readRecord(RecordInputStream& in, Document& document) {}
virtual void readRecord(RecordInputStream& /*in*/, Document& /*document*/) {}
};
RegisterRecordProxy<SoundPalette> g_SoundPalette(SOUND_PALETTE_OP);
@ -436,7 +437,7 @@ protected:
virtual ~LightSourcePalette() {}
virtual void readRecord(RecordInputStream& in, Document& document) {}
virtual void readRecord(RecordInputStream& /*in*/, Document& /*document*/) {}
};
RegisterRecordProxy<LightSourcePalette> g_LightSourcePalette(LIGHT_SOURCE_PALETTE_OP);
@ -522,27 +523,27 @@ protected:
virtual ~LightPointAnimationPalette() {}
virtual void readRecord(RecordInputStream& in, Document& document)
virtual void readRecord(RecordInputStream& in, Document& /*document*/)
{
in.forward(4);
std::string name = in.readString(256);
int32 index = in.readInt32(-1);
float32 animationPeriod = in.readFloat32();
float32 animationPhaseDelay = in.readFloat32();
float32 animationEnabledPeriod = in.readFloat32();
osg::Vec3f axisOfRotation = in.readVec3f();
uint32 flags = in.readUInt32();
int32 animationType = in.readInt32();
int32 morseCodeTiming = in.readInt32();
int32 wordRate = in.readInt32();
int32 characterRate = in.readInt32();
/*int32 index =*/ in.readInt32(-1);
/*float32 animationPeriod =*/ in.readFloat32();
/*float32 animationPhaseDelay =*/ in.readFloat32();
/*float32 animationEnabledPeriod =*/ in.readFloat32();
/*osg::Vec3f axisOfRotation =*/ in.readVec3f();
/*uint32 flags =*/ in.readUInt32();
/*int32 animationType =*/ in.readInt32();
/*int32 morseCodeTiming =*/ in.readInt32();
/*int32 wordRate =*/ in.readInt32();
/*int32 characterRate =*/ in.readInt32();
std::string morseCodeString = in.readString(1024);
int32 numberOfSequences = in.readInt32();
for (int n=0; n<numberOfSequences; ++n)
{
uint32 sequenceState = in.readUInt32();
float32 sequenceDuration = in.readFloat32();
osg::Vec4f sequenceColor = in.readColor32();
/*uint32 sequenceState =*/ in.readUInt32();
/*float32 sequenceDuration =*/ in.readFloat32();
/*osg::Vec4f sequenceColor =*/ in.readColor32();
}
}
};
@ -562,7 +563,7 @@ protected:
virtual ~LineStylePalette() {}
virtual void readRecord(RecordInputStream& in, Document& document)
virtual void readRecord(RecordInputStream& /*in*/, Document& /*document*/)
{
}
};
@ -582,7 +583,7 @@ protected:
virtual ~TextureMappingPalette() {}
virtual void readRecord(RecordInputStream& in, Document& document)
virtual void readRecord(RecordInputStream& /*in*/, Document& /*document*/)
{
}
};
@ -620,8 +621,8 @@ protected:
// CG support is currently not implemented. Just parse.
std::string vertexProgramFilename = in.readString(1024);
std::string fragmentProgramFilename = in.readString(1024);
int32 vertexProgramProfile = in.readInt32();
int32 fragmentProgramProfile = in.readInt32();
/*int32 vertexProgramProfile =*/ in.readInt32();
/*int32 fragmentProgramProfile =*/ in.readInt32();
std::string vertexProgramEntry = in.readString(256);
std::string fragmentProgramEntry = in.readString(256);
}

View File

@ -20,7 +20,7 @@ osg::Vec4 ColorPool::getColor(int indexIntensity) const
// bit 12 fixed intensity bit
bool fixedIntensity = (indexIntensity & 0x1000) ? true : false;
unsigned int index = (fixedIntensity) ? (indexIntensity & 0x0fff)+(4096>>7) : indexIntensity >> 7;
assert(index>=0 && index<size());
assert(index<size());
osg::Vec4 col = at(index);
if (!fixedIntensity)
{

View File

@ -54,7 +54,7 @@ protected:
osg::notify(osg::DEBUG_INFO) << "Format: " << format << std::endl;
document._version = format;
uint32 revision = in.readUInt32();
/*uint32 revision =*/ in.readUInt32();
std::string revisionTime = in.readString(32);
osg::notify(osg::INFO) << "Last revision: " << revisionTime << std::endl;
@ -64,8 +64,8 @@ protected:
// Flight v.11 & 12 use integer coordinates
int16 multDivUnits = in.readInt16(); // Units multiplier/divisor
uint8 units = in.readUInt8(); // 0=Meters 1=Kilometers 4=Feet 5=Inches 8=Nautical miles
uint8 textureWhite = in.readUInt8();
uint32 flags = in.readUInt32();
/*uint8 textureWhite =*/ in.readUInt8();
/*uint32 flags =*/ in.readUInt32();
if (document.getDoUnitsConversion())
document._unitScale = unitsToMeters((CoordUnits)units) / unitsToMeters(document.getDesiredUnits());
@ -118,7 +118,7 @@ protected:
virtual ~Object() {}
virtual void readRecord(RecordInputStream& in, Document& document)
virtual void readRecord(RecordInputStream& in, Document& /*document*/)
{
std::string id = in.readString(8);
uint32 flags = in.readUInt32();
@ -180,17 +180,17 @@ protected:
std::string id = in.readString(8);
osg::notify(osg::DEBUG_INFO) << "ID: " << id << std::endl;
int16 relativePriority = in.readInt16();
/*int16 relativePriority =*/ in.readInt16();
in.forward(2);
uint32 flags = in.readUInt32();
uint16 specialId0 = in.readUInt16();
uint16 specialId1 = in.readUInt16();
uint16 significance = in.readUInt16();
int8 layer = in.readInt8();
/*uint16 specialId0 =*/ in.readUInt16();
/*uint16 specialId1 =*/ in.readUInt16();
/*uint16 significance =*/ in.readUInt16();
/*int8 layer =*/ in.readInt8();
in.forward(5);
uint32 loopCount = in.readUInt32();
float32 loopDuration = in.readFloat32();
float32 lastFrameDuration = in.readFloat32();
/*uint32 loopCount =*/ in.readUInt32();
/*float32 loopDuration =*/ in.readFloat32();
/*float32 lastFrameDuration =*/ in.readFloat32();
// Check for forward animation (sequence)
bool forwardAnim = (flags & FORWARD_ANIM) != 0;
@ -423,9 +423,9 @@ protected:
in.forward(4);
float64 switchInDistance = in.readFloat64();
float64 switchOutDistance = in.readFloat64();
int16 specialEffectID1 = in.readInt16();
int16 specialEffectID2 = in.readInt16();
uint32 flags = in.readUInt32();
/*int16 specialEffectID1 =*/ in.readInt16();
/*int16 specialEffectID2 =*/ in.readInt16();
/*uint32 flags =*/ in.readUInt32();
osg::Vec3d center = in.readVec3d();
_lod = new osg::LOD;
@ -478,9 +478,9 @@ protected:
std::string id = in.readString(8);
uint32 switchInDistance = in.readUInt32();
uint32 switchOutDistance = in.readUInt32();
int16 specialEffectID1 = in.readInt16();
int16 specialEffectID2 = in.readInt16();
uint32 flags = in.readUInt32();
/*int16 specialEffectID1 =*/ in.readInt16();
/*int16 specialEffectID2 =*/ in.readInt16();
/*uint32 flags =*/ in.readUInt32();
osg::Vec3 center;
center.x() = (float)in.readInt32();
@ -550,7 +550,7 @@ protected:
virtual ~Switch() {}
virtual void readRecord(RecordInputStream& in, Document& document)
virtual void readRecord(RecordInputStream& in, Document& /*document*/)
{
std::string id = in.readString(8);
in.forward(4);
@ -606,7 +606,7 @@ protected:
virtual ~ExternalReference() {}
virtual void readRecord(RecordInputStream& in, Document& document)
virtual void readRecord(RecordInputStream& in, Document& /*document*/)
{
std::string strFile = in.readString(200);
@ -722,7 +722,7 @@ protected:
virtual ~Extension() {}
virtual void readRecord(RecordInputStream& in, Document& document)
virtual void readRecord(RecordInputStream& in, Document& /*document*/)
{
std::string id = in.readString(8);
std::string siteId = in.readString(8);

View File

@ -35,7 +35,7 @@ class RoadSegment : public PrimaryRecord
virtual ~RoadSegment() {}
virtual void readRecord(RecordInputStream& in, Document& document)
virtual void readRecord(RecordInputStream& /*in*/, Document& /*document*/)
{
_roadSegment = new osg::Group;
@ -70,7 +70,7 @@ class RoadConstruction : public PrimaryRecord
virtual ~RoadConstruction() {}
virtual void readRecord(RecordInputStream& in, Document& document)
virtual void readRecord(RecordInputStream& /*in*/, Document& /*document*/)
{
_roadConstruction = new osg::Group;
@ -105,7 +105,7 @@ class RoadPath : public PrimaryRecord
virtual ~RoadPath() {}
virtual void readRecord(RecordInputStream& in, Document& document)
virtual void readRecord(RecordInputStream& /*in*/, Document& /*document*/)
{
_roadPath = new osg::Group;

View File

@ -43,7 +43,7 @@ class VertexC : public Record
virtual void readRecord(RecordInputStream& in, Document& document)
{
int colorNameIndex = in.readInt16();
/*int colorNameIndex =*/ in.readInt16();
uint16 flags = in.readUInt16();
osg::Vec3d coord = in.readVec3d();
osg::Vec4f packedColor = in.readColor32();
@ -80,7 +80,7 @@ class VertexCN : public Record
virtual void readRecord(RecordInputStream& in, Document& document)
{
int colorNameIndex = in.readInt16();
/*int colorNameIndex =*/ in.readInt16();
uint16 flags = in.readUInt16();
osg::Vec3d coord = in.readVec3d();
osg::Vec3f normal = in.readVec3f();
@ -119,7 +119,7 @@ class VertexCT : public Record
virtual void readRecord(RecordInputStream& in, Document& document)
{
int colorNameIndex = in.readInt16();
/*int colorNameIndex =*/ in.readInt16();
uint16 flags = in.readUInt16();
osg::Vec3d coord = in.readVec3d();
osg::Vec2f uv = in.readVec2f();
@ -158,7 +158,7 @@ class VertexCNT : public Record
virtual void readRecord(RecordInputStream& in, Document& document)
{
int colorNameIndex = in.readInt16();
/*int colorNameIndex =*/ in.readInt16();
uint16 flags = in.readUInt16();
osg::Vec3d coord = in.readVec3d();
osg::Vec3f normal = in.readVec3f();
@ -246,8 +246,8 @@ class ShadedVertex : public Record
int32 x = in.readInt32();
int32 y = in.readInt32();
int32 z = in.readInt32();
uint8 edgeFlag = in.readUInt8();
uint8 shadingFlag = in.readUInt8();
/*uint8 edgeFlag =*/ in.readUInt8();
/*uint8 shadingFlag =*/ in.readUInt8();
int colorIndex = (int)in.readInt16();
Vertex vertex;
@ -294,8 +294,8 @@ class NormalVertex : public Record
int32 x = in.readInt32();
int32 y = in.readInt32();
int32 z = in.readInt32();
uint8 edgeFlag = in.readUInt8();
uint8 shadingFlag = in.readUInt8();
/*uint8 edgeFlag =*/ in.readUInt8();
/*uint8 shadingFlag =*/ in.readUInt8();
int colorIndex = (int)in.readInt16();
osg::Vec3f normal = in.readVec3d();