Permalink
Browse files

From Lilin Xiong, "When writing proxyNode to ive file, we forget "Loa…

…dingExternalReferenceMode ". Add some code to fix this.

if (out->getVersion() >= VERSION_0045)
{
    out->writeInt(getLoadingExternalReferenceMode());
}

if (in->getVersion() >= VERSION_0045)
{
   setLoadExternalReferenceFiles( (osg::ProxyNode::LoadingExternalReferenceMode)in->readInt() );
}
"
  • Loading branch information...
osg-training-guest committed Jun 28, 2013
1 parent d55751e commit 3ceb941047c5fac6d1020d383023e6b819fe2d63
Showing with 12 additions and 1 deletion.
  1. +2 −1 src/osgPlugins/ive/IveVersion.h
  2. +10 −0 src/osgPlugins/ive/ProxyNode.cpp
@@ -53,8 +53,9 @@
#define VERSION_0042 42
#define VERSION_0043 43
#define VERSION_0044 44
+#define VERSION_0045 45
-#define VERSION VERSION_0044
+#define VERSION VERSION_0045
/* The BYTE_SEX tag is used to check the endian
of the IVE file being read in. The IVE format
@@ -63,6 +63,11 @@ void ProxyNode::write(DataOutputStream* out)
out->writeInt(getCenterMode());
out->writeVec3(getCenter());
+ if (out->getVersion() >= VERSION_0045)
+ {
+ out->writeInt(getLoadingExternalReferenceMode());
+ }
+
out->writeUInt(getNumFileNames());
unsigned int numChildrenToWriteOut = 0;
unsigned int i;
@@ -171,6 +176,11 @@ void ProxyNode::read(DataInputStream* in)
setCenterMode((osg::ProxyNode::CenterMode)in->readInt());
setCenter(in->readVec3());
+ if (in->getVersion() >= VERSION_0045)
+ {
+ setLoadingExternalReferenceMode( (osg::ProxyNode::LoadingExternalReferenceMode)in->readInt() );
+ }
+
unsigned int numFileNames = in->readUInt();
unsigned int i;
for(i=0; i<numFileNames; i++)

0 comments on commit 3ceb941

Please sign in to comment.