From Wojciech Lewandowski and Robert Osfield, Support from LightPointNode::s/getPointSprite parameter.

This commit is contained in:
Robert Osfield 2008-02-27 12:11:02 +00:00
parent a4a39d32ff
commit eb46608be4
3 changed files with 30 additions and 1 deletions

View File

@ -32,8 +32,9 @@
#define VERSION_0021 21
#define VERSION_0022 22
#define VERSION_0023 23
#define VERSION_0024 24
#define VERSION VERSION_0023
#define VERSION VERSION_0024
/* The BYTE_SEX tag is used to check the endian
of the IVE file being read in. The IVE format

View File

@ -34,6 +34,11 @@ void LightPointNode::write(DataOutputStream* out){
out->writeFloat(getMaxPixelSize());
out->writeFloat(getMaxVisibleDistance2());
if (out->getVersion() >= VERSION_0024)
{
out->writeBool(getPointSprite());
}
// Write out LightPoints.
unsigned int size = getNumLightPoints();
out->writeUInt(size);
@ -60,6 +65,11 @@ void LightPointNode::read(DataInputStream* in){
setMaxPixelSize(in->readFloat());
setMaxVisibleDistance2(in->readFloat());
if (in->getVersion() >= VERSION_0024)
{
setPointSprite(in->readBool());
}
// Read in lightpoints.
unsigned int size = in->readUInt();
for(unsigned int i=0; i<size; i++ ){

View File

@ -64,6 +64,22 @@ bool LightPointNode_readLocalData(osg::Object &obj, osgDB::Input &fr)
itAdvanced = true;
}
if (fr[0].matchWord("pointSprite"))
{
if (fr[1].matchWord("FALSE"))
{
lightpointnode.setPointSprite(false);
fr+=2;
itAdvanced = true;
}
else if (fr[1].matchWord("TRUE"))
{
lightpointnode.setPointSprite(true);
fr+=2;
itAdvanced = true;
}
}
if (fr[0].matchWord("lightPoint")) {
LightPoint lp;
if (readLightPoint(lp, fr)) {
@ -87,6 +103,8 @@ bool LightPointNode_writeLocalData(const osg::Object &obj, osgDB::Output &fw)
fw.indent() << "maxVisibleDistance2 " << lightpointnode.getMaxVisibleDistance2() << std::endl;
fw.indent() << "pointSprite " << ( lightpointnode.getPointSprite() ? "TRUE" : "FALSE" ) << std::endl;
LightPointNode::LightPointList const lightpointlist = lightpointnode.getLightPointList();
LightPointNode::LightPointList::const_iterator itr;