From Wojciech Lewandowski and Robert Osfield, Support from LightPointNode::s/getPointSprite parameter.
This commit is contained in:
parent
a4a39d32ff
commit
eb46608be4
@ -32,8 +32,9 @@
|
|||||||
#define VERSION_0021 21
|
#define VERSION_0021 21
|
||||||
#define VERSION_0022 22
|
#define VERSION_0022 22
|
||||||
#define VERSION_0023 23
|
#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
|
/* The BYTE_SEX tag is used to check the endian
|
||||||
of the IVE file being read in. The IVE format
|
of the IVE file being read in. The IVE format
|
||||||
|
@ -34,6 +34,11 @@ void LightPointNode::write(DataOutputStream* out){
|
|||||||
out->writeFloat(getMaxPixelSize());
|
out->writeFloat(getMaxPixelSize());
|
||||||
out->writeFloat(getMaxVisibleDistance2());
|
out->writeFloat(getMaxVisibleDistance2());
|
||||||
|
|
||||||
|
if (out->getVersion() >= VERSION_0024)
|
||||||
|
{
|
||||||
|
out->writeBool(getPointSprite());
|
||||||
|
}
|
||||||
|
|
||||||
// Write out LightPoints.
|
// Write out LightPoints.
|
||||||
unsigned int size = getNumLightPoints();
|
unsigned int size = getNumLightPoints();
|
||||||
out->writeUInt(size);
|
out->writeUInt(size);
|
||||||
@ -60,6 +65,11 @@ void LightPointNode::read(DataInputStream* in){
|
|||||||
setMaxPixelSize(in->readFloat());
|
setMaxPixelSize(in->readFloat());
|
||||||
setMaxVisibleDistance2(in->readFloat());
|
setMaxVisibleDistance2(in->readFloat());
|
||||||
|
|
||||||
|
if (in->getVersion() >= VERSION_0024)
|
||||||
|
{
|
||||||
|
setPointSprite(in->readBool());
|
||||||
|
}
|
||||||
|
|
||||||
// Read in lightpoints.
|
// Read in lightpoints.
|
||||||
unsigned int size = in->readUInt();
|
unsigned int size = in->readUInt();
|
||||||
for(unsigned int i=0; i<size; i++ ){
|
for(unsigned int i=0; i<size; i++ ){
|
||||||
|
@ -64,6 +64,22 @@ bool LightPointNode_readLocalData(osg::Object &obj, osgDB::Input &fr)
|
|||||||
itAdvanced = true;
|
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")) {
|
if (fr[0].matchWord("lightPoint")) {
|
||||||
LightPoint lp;
|
LightPoint lp;
|
||||||
if (readLightPoint(lp, fr)) {
|
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() << "maxVisibleDistance2 " << lightpointnode.getMaxVisibleDistance2() << std::endl;
|
||||||
|
|
||||||
|
fw.indent() << "pointSprite " << ( lightpointnode.getPointSprite() ? "TRUE" : "FALSE" ) << std::endl;
|
||||||
|
|
||||||
LightPointNode::LightPointList const lightpointlist = lightpointnode.getLightPointList();
|
LightPointNode::LightPointList const lightpointlist = lightpointnode.getLightPointList();
|
||||||
LightPointNode::LightPointList::const_iterator itr;
|
LightPointNode::LightPointList::const_iterator itr;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user